1 October 2016

Working with QEMU

Convert VM from RAW to QCOW2
qemu-img convert -O qcow2 /dev/main/nms2 /mnt/backups/nms2.qcow2

When using RAW based disks for VM's, you will need to backup the LVM directly with snapshots. Otherwise if using QCOW2 format on a filesystem, you will be able to perform snapshots and backups at the QEMU level.

Copy RAW image from RAW on one machine to RAW partition on another machine
dd if=/dev/main/lvm1 | ssh <remoteserver> dd of=/dev/zvol/rpool/data/vm-100-disk-1

General virsh Commands
virsh list --all
virsh start <vm>
virsh autostart <vm>
virsh shutdown <vm>

MD RAID Performance with LVMs and RAW
When you dont have a RAID controller and only have spinning disks, and you want to host some VMs for example, you will have to be careful with the very limited disk IO. Highly recomend getting SSDs for VM Hypervisors if you cannot afford a proper hardware RAID card.

In particular you want to look at using "far 2" layout instead of the default "near 2" layout with MD RAID 1.
This means you will be reading from both disks at the same time, obviously writes can only go to one disk at a time.

I.e. Build a new Linux server using only a small partition using the Linux installer or other install system like FAI etc.
Then create a new software MD raid volumne using "far 2", before setting up your LVMs on top.

ZFS is probably the most advanced storage type regarding snapshot and cloning.
https://www.howtoforge.com/tutorial/how-to-install-and-configure-zfs-on-debian-8-jessie/

zpool list
zpool status
zpool create -f pool0 /dev/sdb
zpool create -f pool1 mirror /dev/sdc /dev/sdd

Need a full ZFS notes write up here..


No comments:

Post a Comment