Importing KVM ivda drives as xdva drives

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Importing KVM ivda drives as xdva drives

Predrag Punosevac
Hi Guys,

This is my first post to this mailing list so please excuse my
ignorance. I started running Alpine Linux Dom0 about half a year ago and
I am very happy with it.

Recently I inherited a KVM hypervisor with about dozen guests some of
which are Windows servers.  All KVM guests are either raw or qcow2 image
file formats. I am trying to move them from KVM host to Dom0 (not
block devices or block device partitions).

I did a bit of playing trying to migrate RHEL 7.5 image to Xen Dom0
Alpine. It seems that the only obstacle in importing KVM images into the
Xen is the disk naming. Namely KVM is using virtio (paravirtualization
driver) for disks which are named as

/dev/vda

for a OS drive. Xen on the another hand is using different naming
convention where the drives inside disk images .img are denoted for
example as

/dev/xvda

When I create DomU out of KVM image file the both process proceed
successfully until it drops into dracut shell as it can't find root
partition which is on the /dev/vda drive. Is the HDDs naming superficial
problem or is it fundamental incompatibility on the level of disk
drivers? This is my rhel.cfg file

entebuilder = "hvm"
name = "rhel75"
vcpus=2
memory = 4096
vif = [ 'mac=52:54:00:3b:22:4b, bridge=br0']
disk = [ 'file:/xen-images/rhel75.img,format=raw,xvda,rw' ]
boot = "dc"
on_reboot="restart"

Notice that I did try replacing xvda with vda but it is unrecognized
vdev. I also tried putting hda instead which also dropped me to dracut
shell during the both process.

I am sure I am not the first one who is trying this but except this
unhelpful post

https://serverfault.com/questions/311709/kvm-to-xen-migration

I could not fine any hints about the proper procedure.

Best,
Predrag

_______________________________________________
Xen-users mailing list
[hidden email]
https://lists.xenproject.org/mailman/listinfo/xen-users
Reply | Threaded
Open this post in threaded view
|

Re: Importing KVM ivda drives as xdva drives

George Dunlap
On Sat, Jun 9, 2018 at 2:06 AM, Predrag Punosevac <[hidden email]> wrote:

> Hi Guys,
>
> This is my first post to this mailing list so please excuse my
> ignorance. I started running Alpine Linux Dom0 about half a year ago and
> I am very happy with it.
>
> Recently I inherited a KVM hypervisor with about dozen guests some of
> which are Windows servers.  All KVM guests are either raw or qcow2 image
> file formats. I am trying to move them from KVM host to Dom0 (not
> block devices or block device partitions).
>
> I did a bit of playing trying to migrate RHEL 7.5 image to Xen Dom0
> Alpine. It seems that the only obstacle in importing KVM images into the
> Xen is the disk naming. Namely KVM is using virtio (paravirtualization
> driver) for disks which are named as
>
> /dev/vda
>
> for a OS drive. Xen on the another hand is using different naming
> convention where the drives inside disk images .img are denoted for
> example as
>
> /dev/xvda
>
> When I create DomU out of KVM image file the both process proceed
> successfully until it drops into dracut shell as it can't find root
> partition which is on the /dev/vda drive. Is the HDDs naming superficial
> problem or is it fundamental incompatibility on the level of disk
> drivers? This is my rhel.cfg file

It would be helpful to have the actual console output from the guest;
look for the 'serial' option in the xl.cfg manpage.

But the first thing to check is whether your grub and fstab entries
are using persistent device naming[1], or are using hard-coded device
names.  If your guest grub entry says "root=/dev/vda", then Linux will
look for that specific device, not xvda, because that's what you've
told it to do; similarly with secondary entries in fstab.

If you do have hard-coded device names, the quick-and-dirty option is
to go around change vdN to xvdN in grub and fstab.  The more robust
long-term option is to use UUIDs (or something else); that should be
robust against any future device renames as well (for example, if you
wanted to try moving back to KVM).

 -George

[1] https://wiki.archlinux.org/index.php/persistent_block_device_naming

_______________________________________________
Xen-users mailing list
[hidden email]
https://lists.xenproject.org/mailman/listinfo/xen-users
Reply | Threaded
Open this post in threaded view
|

Re: Importing KVM ivda drives as xdva drives

Manfred Haertel, DB3HM
In reply to this post by Predrag Punosevac
Predrag Punosevac schrieb:

> Namely KVM is using virtio (paravirtualization
> driver) for disks which are named as
>
> /dev/vda
>
> for a OS drive. Xen on the another hand is using different naming
> convention where the drives inside disk images .img are denoted for
> example as
>
> /dev/xvda

You can also use virtio under Xen!

Use the following directive as one line in your xl.cfg (example, please
adapt it for your configuration):

device_model_args = [ '-drive' ,
'file=/path/to/your/root.img,if=virtio,index=0,media=disk,format=raw,cache=writeback'
]

--
Manfred Härtel, DB3HM    mailto:[hidden email]
                          http://rz-home.de/mhaertel

_______________________________________________
Xen-users mailing list
[hidden email]
https://lists.xenproject.org/mailman/listinfo/xen-users