Contents |
Remote VM Installation
virt-manager-0.6.0 and virtinst-0.400.0 both added support for libvirt Storage Management. This effectively allows the user to control storage management and provisioning on local and remote libvirt enabled machines. (See virt-manager storage management for more info.
This helps us overcome the major hurdle for remote guest creation. Currently for remote installs, the supported installation methods are:
- PXE Booting
- Boot from CDROM media (this media must be available as a storage volume on the remote host).
To proceed from here, we assume that remote libvirt storage is set up appropriately. Please see the previous links for more info with this.
NOTE: If you would like to skip some initial configuration, see the 'Out of the Box' section at the end!
Via virt-manager
As of 0.6.0, UI in virt-manager has not been changed to reflect remote installs, so the options are a little stiff. Start the 'New VM' as usual. You will see that the only install options available are for PXE or CDROM media. Choosing PXE requires no extra configuration.
If using cdrom media, you'll notice that the cd drive drop down is disabled: this will also apply to physical disk partitions and shared network devices later, as well as all browse dialogs, since we currently have no means to determine this info from the host. In the 'ISO Image Location' field, put the full path to the volume on the remote host, and proceed. If this volume is shared via libvirt, there should be no issues.
On the storage screen, you will only have an option to enter a 'File Location'. If you have pre-allocated storage on the remote host, enter the full path to the allocated file (or device, it should work).
If you haven't pre-allocated storage, all is not lost! Enter the path you want to create. If the root directory of the path is a storage pool, virt-manager will create the new volume for you.
Ex. With pool name 'default', target path '/var/lib/libvirt/images' File Location: '/var/lib/libvirt/images/idontexist.img'
Unfortunately you cannot customize the volume much (like choosing a format), but it 'just works' for the simple case.
The final piece to point out is that a virtual network is required on the remote host, otherwise the VM will have no networking. This is usually present though because libvirt installs one out of the box.
NOTE: The above also applies to attaching storage to remote guests, such as disks or ejecting/connecting cdrom media.
Via virt-install
virt-install provides a bit more granularity for remote installations. The same issues apply as above: pxe or shared cdrom for installation method, requires a shared volume or pool for storage, virtual networking only.
The central change to facilitate remote installations is the new --disk option. The disk option allows the user to specify a full path (similar to --file), a poolname, volume name combination, or just a pool name to provision on. See the virt-install man page for more particulars.
To specify cdrom media, we have two options:
--cdrom /full/path/to/shared/media/on/remote/host/media.iso --disk vol=poolname:media.iso,device=cdrom
Assuming the remote host is properly set up, this should work fine.
For existing storage, we have:
--file /full/path/to/existing/storage.img OR --disk path=/full/path/to/existing/storage.img OR --disk vol=some-pool-name:storage.img
To create new storage:
--file /managed/pool/path/some-new-file.img --size 5 (--nonsparse) --disk path=/managed/pool/path/some-new-file.img,size=5,sparse=True|False --disk pool=some-pool-name,size=5,sparse=True|False
For the last case, the created volume will be named vmname.img. If that exists, the volume will be called vmname-1.img, and so on.
A point worth mentioning is that any new options in future will be added to the --disk option. The --file option is deprecated, so I'd recommend ignoring it.
Out of the box
virt-manager and virt-install can actually help skip some initial storage configuration, namely pre setting up a pool for disk images.
If with virt-install, you specify a root path '/var/lib/libvirt/images' or a pool name 'default', virt-install will set up the pool for you on the remote host. The same applies for virt-manager, if you specify the above directory. Unfortunately, we can't help you with sharing your install media, so this would only allow out of the box installations for PXE.

