Using kvmtool

       kvmtool create --name myvm [--host remoteserver] [--uri uri] [--flavour template]
                      [--cpus number] [--memory number] [--bridge interface-name]
                      [--mac mac-address] [--pool storagepoolname] [--disksize number]
                      [--diskallocation number] [--bootorder option[,option..]]

       kvmtool delete --name myvm [--host remoteserver] [--uri uri] [--purge]

       kvmtool setbootorder --name myvm --bootorder network,hd
                      [--host remoteserver] [--uri uri]

       kvmtool setmemory --name myvm --memory number
                      [--host remoteserver] [--uri uri]

       kvmtool console --name myvm [--host remoteserver] [--uri uri]

       kvmtool edit --name myvm [--host remoteserver] [--uri uri]

       kvmtool start --name myvm [--console] [--host remoteserver] [--uri uri]

       kvmtool shutdown --name myym [--host remoteserver] [--uri uri]

       kvmtool destroy --name myym [--host remoteserver] [--uri uri]

       kvmtool locate --name myym

       kvmtool info --name myym [--host remoteserver] [--uri uri]

For all commands other than ’create’, if a KVM host hasn’t been specified using the --uri or --host options, kvmtool will attempt to auto-locate the specified guest by querying each of the servers in the HOST_kvmserver netgroup.

Starting a guest (and connect to serial console)
kvmtool start --name <guest> --console 

Connect to guest's serial console
kvmtool console --name <guest> 

Trigger a clean shutdown
kvmtool shutdown --name <guest>

Kill a guest
kvmtool destroy --name <guest>

Modify boot order to network,hd
kvmtool setbootorder --name <guest>  --bootorder network,hd

Delete a guest
kvmtool delete --name <guest> 
Note that the guest's disk image will not be deleted: add -purge if you want to delete the disk image.

Emergency reboot of a stuck guest
not yet possible - use rvirsh

Find a guest's location
kvmtool locate --name <guest>

Display info about guest
kvmtool info --name <guest>

Add an ISO (e.g. CD) image to a guest
kvmtool edit --name <guest>
then add the following snippet to the <devices> section of the guest's XML file, remembering to use your own source file address in place of the one in this example:
<disk type='file' device='cdrom'>
     <driver name='qemu' type='raw'/>
     <source file='/var/lib/libvirt/isos/rhel-server-7.0-x86_64 dvd.iso'/>
     <target dev='hdc' bus='ide'/>
     <address type='drive' controller='0' bus='1' target='0' unit='0'/>
Topic revision: r3 - 20 Oct 2014 - 14:14:38 - ChrisCooke
This site is powered by the TWiki collaboration platformCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback
This Wiki uses Cookies