We're going to be using logical volumes & LVM on our RAID 5 array for the storage of the virtual guests
# pvcreate /dev/md0Also create a volume to hold the ISOs for building the guestsPhysical volume "/dev/md0" successfully created# vgcreate vg_guests /dev/md0Volume group "vg_guests" successfully created
# lvcreate -L 25G vg_guests -n lv_isos# mkfs.ext4 /dev/vg_guests/lv_isos
Auto-mount it in /etc/fstab
/dev/mapper/vg_guests-lv_isos /isos ext4 defaults 0 2Mount and set permissions so 'paul' can upload ISOs directly to it
# mount /isos# chmod 755 /isos# chgrp paul /isos
Finally upload some ISOs...
Using virt-manager, connect to the local QEMU
- Remove the virtual network created inside the Virtual Network tab ; we'll be using my home lan for the guests
- Add a storage pool for the ISOs so they are available to the guests for mounting
- Name: ISOs
- Type: dir Filesystem Directory
- Target Path: /isos
- Add a storage pool for the RAID 5 LVM array to hold the virtual guest storage
- Name: Guests
- Type: logical: LVM Volume Group
- Target Path: /dev/vg_guests
- Source Name: vg_guests
So now we're set up, here's a run through of creating a typical guest:
Before getting into virt-manager create a logical volume for the storage, eg:
# lvcreate -L 10G vg_guests -n lv_myguestname
Now from within virt-manager:
- Give it a name
- Use Local install media / Use ISO image / Select an ISO from your ISO storage pool
- Set OS type & version, set applicable RAM & CPU
- Select managed or other existing storage & pick your newly created logical volume from the Guests storage pool.
- You'll notice no networking is available. This is fine just make sure to tick the 'Customize configuration before install' box and this can be added next.
- Add Hardware and select Network - Host device eth0: macvtap
- Select the newly created NIC and make sure source mode is set to Bridge otherwise the interface will not work.
Now hit 'Begin Installation' and install your lovely new guest.
Once built, if it's a Linux guest, configure the virtual serial port as detailed here so console access is via the command line rather than virt-manager.
A point to note about macvtap interfaces. They do not allow guest to hypervisor communication. Guest to guest is fine as is guest to rest of LAN. If you need to communicate with a guest from the hypervisor or vice versa you will need to create bridged interfaces and use those.
No comments:
Post a Comment