<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<p>Hello everyone once again.</p>
<p>Regarding an email bellow, i found why is  this happening. Namely I've tried updating libvirt and all it's components to version 4.10.0, but still the same issue happened. I've reviewed xml files between CentOS 6 hypervisors and new one on CentOS 7. And
 basically this is the difference when i comes to disk setup:</p>
<p>CentOS 6 (Libvirt 0.10.2)<br>
    <disk type='<b>block</b>' device='disk'><br>
      <driver name='qemu' type='raw' cache='none' io='native'/><br>
      <source <b>dev</b>='/dev/mapper/tables1'/><br>
      <target dev='vda' bus='virtio'/><br>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/><br>
    </disk><br>
</p>
<p>CentOS 7 (Libvirt 4.10.0)<br>
    <disk type='<b>file</b>' device='disk'><br>
      <driver name='qemu' type='raw' cache='none' io='native'/><br>
      <source <b>file</b>='/dev/mapper/proba'/><br>
      <target dev='vda' bus='virtio'/><br>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/><br>
    </disk><br>
<br>
So basically, even if i put disk as a path to block device, libvirt will recognize it as a "file" instead of "block" device. When i changed the xml file and tried to migrate with options bellow - all worked well!</p>
<p>Now, is this a bug in libvirt causing it not to recognize block device or am i doing something wrong? We have been creating VM's in CentOS 7 the same way we did in CentOS 6 hypervisors, and this is the way:</p>
<p><i>virt-install --connect=qemu+ssh://kvm_aquila-01/system \</i><i><br>
</i><i>--name=proba \</i><i><br>
</i><i>--hvm \</i><i><br>
</i><i>--graphics vnc \</i><i><br>
</i><i>--disk path=/dev/mapper/proba,bus=virtio,cache=none \</i><i><br>
</i><i>--vcpus 2 \</i><i><br>
</i><i>--ram=2048 \</i><i><br>
</i><i>--location=<a class="moz-txt-link-freetext" href="http://192.168.54.182/mirror">http://192.168.54.182/mirror</a> \</i><i><br>
</i><i>--extra-args "ksdevice=eth0 inst.ks=<a class="moz-txt-link-freetext" href="http://192.168.53.99/ks/proba.cfg">http://192.168.53.99/ks/proba.cfg</a>" \</i><i><br>
</i><i>--network bridge=br7,model=virtio \</i><i><br>
</i><i>--boot hd,cdrom,menu=on \</i><i><br>
</i><i>--os-type=linux \</i><i><br>
</i><i>--os-variant=rhel7.0 \</i><i><br>
</i><i>--metadata description="LinuxTim - Proba" \</i><i><br>
</i><i>--noreboot</i><br>
<br>
How do we make libvirt automatically default to block device instead of file when it comes to disk type?<br>
</p>
<div class="moz-signature">
<title></title>
<p>Srdačan pozdrav,<br>
Marko Todorić<br>
Inženjer za razvoj i održavanje servisa</p>
<p><img src="cid:part1.25AC1762.814452EE@oriontelekom.rs" alt=""></p>
<div>Orion telekom d.o.o. Beograd</div>
<div>Naselje Zemun Polje, Mala pruga 8</div>
<div>11080 Zemun, Srbija</div>
<div><b style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);
          font-family: Calibri, sans-serif;"><span style="font-size:
            8.5pt; font-family: Tahoma, sans-serif; color: rgb(172, 0,
            132);" lang="EN-US">m:</span></b> +381
 64 8379 337 </div>
<div><b style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);
          font-family: Calibri, sans-serif;"><span style="font-size:
            8.5pt; font-family: Tahoma, sans-serif; color: rgb(172, 0,
            132);" lang="EN-US">e:</span></b>
<a href="mailto:dusan.radisavljevic@oriontelekom.rs">marko.todoric@oriontelekom.rs</a></div>
<div><b style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);
          font-family: Calibri, sans-serif;"><span style="font-size:
            8.5pt; font-family: Tahoma, sans-serif; color: rgb(172, 0,
            132);" lang="EN-US">w:</span></b>
<a href="http://www.oriontelekom.rs">www.oriontelekom.rs</a></div>
</div>
<div class="moz-cite-prefix">On 6/25/19 5:16 PM, Marko Todoric wrote:<br>
</div>
<blockquote type="cite" cite="mid:b7f48abd-3787-c392-b3bb-ab4e97e5dcb0@oriontelekom.rs">
Hello everyone, <br>
<br>
We've been using libvirt version 0.10.2 for a long time (on CentOS 6 OS) and now we have started creating new KVM cluster all based on CentOS 7 OS and libvirt version 4.5.0 (that came with CentOS repo).
<br>
<br>
TLDR Version: <br>
- When we try to migrate using "virsh migrate test --live qemu+ssh://kvm_aquila-02/system" we get an error "error: Unsafe migration: Migration without shared storage is unsafe".
<br>
- When we try to migrate using same method but adding "--unsafe" migration works.
<br>
- When we try to migrate a VPS that is using QCOW image on a shared GFS2 image, mapped on both servers, migration is successful.
<br>
We have two servers in a cluster so far, they are connected to NetApp storage and all luns that VPS server should be using are mapped to both servers.
<br>
<br>
Long version with background: <br>
<br>
We have plenty CentOS 6 Servers which work perfectly fine with libvirt version up to 0.10.2. All connected also to a NetApp storage and all luns are mapped to all servers. LUN's (disks) are visible under /dev/mapper directory. When we create VPS, we point to
 raw disk to the same location, /dev/mapper. For example, VPS "test" would use "/dev/mapper/test" for disk with "cache=none" in xml file. If we issue "virsh migrate test --live qemu+ssh://kvm_server-0X/system", it will successfully migrate VPS to another hypervisor
 without errors, because disk already exists there. <br>
We also have a LUN mapped to each hypervisor and GFS2 established in a cluster between hypervisors where we keep qcow images. We can also migrate those machines without issues.
<br>
<br>
On new CentOS 7 hypervisors, we have pretty much the exact same setup. NetApp storage connected to servers. All VPS LUN's mapped to all hypervisors. Clustered GFS2 volume.
<br>
When we define VPS with approximately same XML, it will NOT migrate it and will issue out an error stated above. "--unsafe" parameter seems to work fine. BUT.
<br>
<br>
We want to setup a proper libvirt/kvm cluster with pcs. I've defined a pcs resource for each VPS and live migration also doesn't work if i try "pcs resource move" command. It will not migrate it "live" as it should, and as it does with QCOW images, probably
 because of the same reason - because it's unable to perform live migrate via libvirt without "unsafe". If there would be any trick to add "--unsafe" parameter to pcs i would do it, but I'm not aware of it.
<br>
<br>
Still, seems like a bug that libvirt would not realize that netapp storage is present in this configuration. Is this maybe corrected in later versions of libvirt? Unfortunately, 4.5.0 is latest in CentOS repo but i would try to compile it if needed.
<br>
<br>
Any help would be greatly appreciated and if more info is needed i will be more than happy to provide.
<br>
<br>
<br>
Thanks in advance, <br>
<br>
Marko Todoric <br>
<br>
</blockquote>
</body>
</html>