Lab Virtual Machines: Difference between revisions
Jump to navigation
Jump to search
Line 22: | Line 22: | ||
# to get list of VMs on hypervisor | # to get list of VMs on hypervisor | ||
virsh list --all | virsh list --all <br /> | ||
# to start a VM | # to start a VM | ||
virsh start <VM-name or VMid> | virsh start <VM-name or VMid> <br /> | ||
# to shutdown a VM | # to shutdown a VM | ||
virsh shutdown <VM-name or VMid> | virsh shutdown <VM-name or VMid> <br /> | ||
# to force shutdown a VM (equivalent of pulling the plug on a computer) | # to force shutdown a VM (equivalent of pulling the plug on a computer) | ||
virsh destroy --graceful <VM-name or VMid> | virsh destroy --graceful <VM-name or VMid> <br /> | ||
# to pause a VM | # to pause a VM | ||
virsh suspend <VM-name or VMid> | virsh suspend <VM-name or VMid> <br /> | ||
# to unpause a VM | # to unpause a VM | ||
virsh resume <VM-name or VMid> | virsh resume <VM-name or VMid> <br /> | ||
# get XML file contents of VM | # get XML file contents of VM | ||
virsh dumpxml <VM-name or VMid> | virsh dumpxml <VM-name or VMid> |
Revision as of 19:08, 3 January 2017
There are important VMs on both Cluster 0 and Cluster 2. Cluster 0 uses VMware while Cluster 2 uses KVM/libvirt.
Cluster 0
Significant hypervisors on Cluster 0: vmware1 (access via root with clust 0 formulax2)
VMWare Commands
Webpage that describes numerous VMware commands: http://www.doublecloud.org/2013/11/vmware-esxi-vim-cmd-command-a-quick-tutorial/
# To get a list of all VMs and obtain VMid vim-cmd vmsvc/getallvms
# To shutdown a VM: vim-cmd vmsvc/power.off <VMid>
# To turn on a VM: vim-cmd vmsvc/power.on <VMid>
Cluster 2
kvm/libvirt commands
In order for a user to issue KVM commands, the service libvirtd must be running. Check the status of libvirtd by issuing the command: service libvirtd status. If libvirtd is not running, then you may issue command: service libvirtd start.
# to get list of VMs on hypervisor virsh list --all
# to start a VM virsh start <VM-name or VMid>
# to shutdown a VM virsh shutdown <VM-name or VMid>
# to force shutdown a VM (equivalent of pulling the plug on a computer) virsh destroy --graceful <VM-name or VMid>
# to pause a VM virsh suspend <VM-name or VMid>
# to unpause a VM virsh resume <VM-name or VMid>
# get XML file contents of VM virsh dumpxml <VM-name or VMid>