User Tools

Site Tools


virtual_servers

Connect to and Manage virtual machines

  • Normal management of virtual machines should take place over SSH or Remote Desktop to the VM itself
  • In cases where the VM is not responding, SSH to the virtual host with X11 forwarding
 $ ssh -Y ares
  • then run virt-manager
 $ sudo virt-manager
  • double-click on localhost, then the name of the virtual machine to manage

A list of virtual servers is available at Virtual_Servers

Live Migration

Live migration works across virtual server hosts running Ubuntu 14.04 or later. Migration takes about 30 minutes for a machine with a 100 GB disk image, during the migration the virtual server is available.

To migrate Hank from Ares to Mars without interruption, run this on Ares:

sudo virsh migrate --live --persistent --copy-storage-all --verbose hank qemu+ssh://mars/system

Offline Migration

Migrate across different storage types

Converting a file disk image to an LVM partition:

  • Dump/import the xml config file with virsh
 user@mars:~$ virsh dumpxml grumpy > grumpy.xml
 user@mars:~$ scp grumpy.xml user@thor:
 user@thor:~$ virsh define grumpy.xml 
  • Start virt-manager on Thor, delete the disk image and create a new one of equal size or larger
 user@thor:~$ sudo virt-manager
 Add Hardware > Storage > Block Device (partition): Browse > New Volume (name the new block device after the vm, such as "grumpy")
 Target: Device type: Virtio Disk
  • Make sure both VMs are shut down
  • Image the disk image file on Ares/Mars to the newly created LVM partition on Thor
# over a gigabit connection:
 root@mars:~# dd if=grumpy.img bs=1M | ssh root@thor "dd of=/dev/array/grumpy bs=1M"
# over a slow connection, with compression:
 root@mars:~# dd if=grumpy.img bs=1M | ssh -C root@thor "dd of=/dev/array/grumpy bs=1M"
  • start the new VM, adjust/add partitions if expanding the disk
virtual_servers.txt ยท Last modified: 2016/03/07 11:06 by brand