User Tools

Site Tools


libvirt:libvirt

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
libvirt:libvirt [2014/08/07 10:05] – [Restore] devalibvirt:libvirt [2016/09/15 21:18] (current) deva
Line 1: Line 1:
 ======Libvirt====== ======Libvirt======
 +=====Resize qcov2 image=====
 +<code>
 +# Shut down vm
 +
 +# On host (to grow 8GB):
 +qemu-img resize /images/myimage.qcow2 +8GB
 +
 +# Start vm
 +# Assuming lvm logical volume inside extended partition...
 +# fdisk -l should now show the new disk size.
 +# run parted
 +(parted) resizepart 2
 +16GB
 +(parted) resizepart 5
 +16GB
 +(parted) quit
 +
 +# resize volume group
 +pvresize /dev/sda5 # on lvm partition
 +
 +# extend lvm
 +lvextend -l +100%FREE /dev/mapper/devuan--vg-root
 +
 +# finally resize file system
 +resize2fs /dev/mapper/devuan--vg-root
 +</code>
 +
 +=====List VMs=====
 +<code>
 +virsh list --all
 +</code>
  
 =====Copy a VM===== =====Copy a VM=====
Line 53: Line 84:
  
 **NOTE**: Using ntpd to sync a clock that is more than a matter of seconds out-of-sync might require special attention to its config file as it might refuse to synchronize the clock because it is too much out of sync. **NOTE**: Using ntpd to sync a clock that is more than a matter of seconds out-of-sync might require special attention to its config file as it might refuse to synchronize the clock because it is too much out of sync.
 +
 +FIXME: Use "virsh blockcopy" for harddrive backup, which will reduce downtime to a matter of seconds in the VM.
 ====Restore==== ====Restore====
 <code> <code>
Line 68: Line 101:
 </code> </code>
  
-**WARNING**: After restoration the rct (clock) will be set to whatever it was on store time. Set the date manually by calling ntpdate (on centos call: "service ntpdate start")+**WARNING**: After restoration the rtc (clock) will be set to whatever it was on store time. Set the date manually by calling ntpdate (on centos call: "service ntpdate start")
libvirt/libvirt.1407398730.txt.gz · Last modified: 2014/08/07 10:05 by deva