KVM host // storage & live-migration

storage

assuming /data/ is an NFS mount point already, enable it as storage for vdisks and configs

virsh pool-list
virsh pool-dumpxml default > pool.xml
virsh pool-destroy default
vi pool.xml

    <path>/data/guests</path>

mkdir -p /data/guests/
virsh pool-create pool.xml
virsh pool-list

ready to go

mkdir -p /data/guests/

ifconfig virbr0

and install some guests

live-migration

to be able to talk to the other hypervisors and enable the farm, you will have to share a few SSH keys.

to migrate a guest, make sure the machine type is compatible on both ends,

kvm -M ?

and fix it (DO NOT USE the pc alias that is pointing to different latest versions depending on the hypervisors – choose the latest available on all hypervisors e.g. pc-i440fx-2.5) if required,

virsh shutdown GUESTNAME
virsh edit GUESTNAME

  <os>
    <type arch='x86_64' machine='pc-i440fx-2.5'>hvm</type>
    <boot dev='hd'/>
  </os>

the available virtual network devices can be displayed as such,

qemu-system-x86_64 -net nic,model=? /dev/null

e.g.,

qemu: Supported NIC models: ne2k_pci,i82551,i82557b,i82559er,rtl8139,e1000,pcnet,virtio

replacing rtl8139 with virtio,

    <interface type='bridge'>
      <mac address='xx:xx:xx:xx:xx:xx'/>
      <source bridge='xenbr0'/>
      <model type='virtio'/>
            <driver name='vhost' txmode='iothread' ioeventfd='on' event_idx='off' queues='5' rx_queue_size='256' tx_queue_size='256'>
              <host csum='off' gso='off' tso4='off' tso6='off' ecn='off' ufo='off' mrg_rxbuf='off'/>
              <guest csum='off' tso4='off' tso6='off' ecn='off' ufo='off'/>
            </driver>
    </interface>

you may also have to disable caching on the virtual drive,

  <driver name='qemu' type='qcow2' cache='none'/>

refs https://access.redhat.com/solutions/158363

you will then be able to live-migrate,

virsh -c qemu+ssh://ANOTHER-KVM-SRV/system list
virsh migrate GUESTNAME qemu+ssh://ANOTHER-KVM-SRV/system

resources

storage

http://ask.xmodulo.com/change-default-location-libvirt-vm-images.html

live-migration

https://mike42.me/blog/libvirt-migrate-a-vm-from-qemusession-to-qemusystem

https://wiki.libvirt.org/page/Failed_to_connect_to_the_hypervisor

http://blog.programster.org/kvm-offline-migration

https://libvirt.org/migration.html

https://libvirt.org/formatdomain.html

https://libvirt.org/formatdomain.html#elementsNICS

https://wiki.ubuntu.com/QemuKVMMigration

https://bugs.launchpad.net/ubuntu/+source/libvirt/+bug/1617214

https://bugs.launchpad.net/ubuntu/+source/libvirt/+bug/1637438

https://www.linux-kvm.org/page/Management_Tools

https://www.linux-kvm.org/page/Networking

https://www.redhat.com/archives/libvirt-users/2015-February/msg00024.html

https://access.redhat.com/errata/RHSA-2016:2577


HOME | GUIDES | LECTURES | LAB | SMTP HEALTH | HTML5 | CONTACT
Copyright © 2024 Pierre-Philipp Braun