how to take over VM's not launched by kubevirt

39 views
Skip to first unread message

Alexander Gallego

unread,
May 4, 2018, 10:18:11 AM5/4/18
to kubevirt-dev
Hi Guys, asking for pointers even if it's just pointers to the code

Say I have some VM's launched manually - for simplicity - by libvirtd. 

How would I bring those existing VM's into active mgnmnt by kubevirt (effectively migrating to it). 


I have a prototype working and launching VM's (yay!) and I wanted to understand if there was a story to moving VMs to be controlled by kubevirt. 

One possible answer is to do an offline migration, start a VM in offline mode (by kubevirt) and somehow patch it to start the migrated-also-offline VM instead of the one launched by kubevirt.

Any thoughts / pointers / ideas?

Thanks! 

Itamar Heim

unread,
May 4, 2018, 10:26:48 AM5/4/18
to Alexander Gallego, kubevirt-dev
Fabian can probably add more color, he demo'd this yesterday:
https://twitter.com/dummdida/status/992320203915743232

Alexander Gallego

unread,
May 4, 2018, 12:32:29 PM5/4/18
to Itamar Heim, kubevirt-dev
Thanks @Itamar! 

is this on a branch or smth?

Itamar Heim

unread,
May 4, 2018, 12:33:37 PM5/4/18
to Alexander Gallego, kubevirt-dev

Alexander Gallego

unread,
May 4, 2018, 12:35:51 PM5/4/18
to Itamar Heim, kubevirt-dev
Got it. sorry, i missed it the first time.

Thanks!  

Fabian Deutsch

unread,
May 4, 2018, 12:40:03 PM5/4/18
to Alexander Gallego, Itamar Heim, kubevirt-dev
Heya Alexander,

so yes, there is this POC from my side, to achieve this.
This work has just begun there, and also on the virt-v2v side.

To me it looks like strategically it makes sense to strengthen the virt-v2v codebase and add proper kubevirt support.

However, this will take some time :)

Thus for now your are probably bound to the poc code from twitter.

- fabian
 

--
You received this message because you are subscribed to the Google Groups "kubevirt-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kubevirt-dev+unsubscribe@googlegroups.com.
To post to this group, send email to kubevi...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kubevirt-dev/CAL%2BiW2-BcJUVwbp7vJ5pmTbcp53RorzArdkq2ACAUU1fLHFNng%40mail.gmail.com.

For more options, visit https://groups.google.com/d/optout.

Alexander Gallego

unread,
May 4, 2018, 12:42:27 PM5/4/18
to Fabian Deutsch, Itamar Heim, kubevirt-dev
hi fabian!
 
so yes, there is this POC from my side, to achieve this.
This work has just begun there, and also on the virt-v2v side.


what's virt-v2v? 

 
To me it looks like strategically it makes sense to strengthen the virt-v2v codebase and add proper kubevirt support.

However, this will take some time :)

Thus for now your are probably bound to the poc code from twitter.

already cloned it and reading the code atm. 

thanks! 

.alex 

Alexander Gallego

unread,
May 4, 2018, 12:43:37 PM5/4/18
to Fabian Deutsch, Itamar Heim, kubevirt-dev


 
To me it looks like strategically it makes sense to strengthen the virt-v2v codebase and add proper kubevirt support.

Any pointers, even as to the strategy. i.e.: any design doc i can read

Richard W.M. Jones

unread,
May 14, 2018, 8:00:03 AM5/14/18
to galleg...@gmail.com, fdeu...@redhat.com, kubevi...@googlegroups.com
> you mean this: http://libguestfs.org/virt-v2v.1.html
>
> > To me it looks like strategically it makes sense to strengthen the
> >> virt-v2v codebase and add proper kubevirt support.
> >>
> >
> Any pointers, even as to the strategy. i.e.: any design doc i can read

There was a simple prototype of an ‘-o kubevirt’ mode posted:

https://www.redhat.com/archives/libguestfs/2018-March/msg00194.html

Apply that patch to virt-v2v and then you should be able to do
something like this to test:

$ virt-builder fedora-27
$ virt-v2v -i disk fedora-27.img -o kubevirt -os /tmp

which will create /tmp/fedora-27.yaml and a converted disk image.

Rich.

--
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
virt-df lists disk usage of guests without needing to install any
software inside the virtual machine. Supports Linux and Windows.
http://people.redhat.com/~rjones/virt-df/

Alexander Gallego

unread,
May 14, 2018, 9:20:06 AM5/14/18
to Richard W.M. Jones, Fabian Deutsch, kubevirt-dev
On Mon, May 14, 2018 at 8:00 AM, Richard W.M. Jones <rjo...@redhat.com> wrote:
> you mean this: http://libguestfs.org/virt-v2v.1.html
>
> > To me it looks like strategically it makes sense to strengthen the
> >> virt-v2v codebase and add proper kubevirt support.
> >>
> >
> Any pointers, even as to the strategy. i.e.: any design doc i can read

There was a simple prototype of an ‘-o kubevirt’ mode posted:

  https://www.redhat.com/archives/libguestfs/2018-March/msg00194.html

Apply that patch to virt-v2v and then you should be able to do
something like this to test:

  $ virt-builder fedora-27
  $ virt-v2v -i disk fedora-27.img -o kubevirt -os /tmp

which will create /tmp/fedora-27.yaml and a converted disk image.

ah! i see what fabian meant then. 

Thanks! 

will apply and test. 

Fabian Deutsch

unread,
May 15, 2018, 5:18:25 AM5/15/18
to Alexander Gallego, Mohr, Roman, Richard W.M. Jones, David Vossel, kubevirt-dev
On Mon, May 14, 2018 at 3:19 PM, Alexander Gallego <galleg...@gmail.com> wrote:


On Mon, May 14, 2018 at 8:00 AM, Richard W.M. Jones <rjo...@redhat.com> wrote:
> you mean this: http://libguestfs.org/virt-v2v.1.html
>
> > To me it looks like strategically it makes sense to strengthen the
> >> virt-v2v codebase and add proper kubevirt support.
> >>
> >
> Any pointers, even as to the strategy. i.e.: any design doc i can read

There was a simple prototype of an ‘-o kubevirt’ mode posted:

  https://www.redhat.com/archives/libguestfs/2018-March/msg00194.html

Apply that patch to virt-v2v and then you should be able to do
something like this to test:

  $ virt-builder fedora-27
  $ virt-v2v -i disk fedora-27.img -o kubevirt -os /tmp

which will create /tmp/fedora-27.yaml and a converted disk image.

ah! i see what fabian meant then. 

Thanks! 

will apply and test. 

Cool.


All, this topic - v2v and some other playing around - actually lead me to the thought that we probably want a library which can do domxml to vmspec conversions.
v2v, a potential libvirt-to-kubevirt kubectl would benefit from this.

Thoughts?

- fabian

Richard W.M. Jones

unread,
May 15, 2018, 7:04:59 AM5/15/18
to Fabian Deutsch, Alexander Gallego, Mohr, Roman, David Vossel, kubevirt-dev
On Tue, May 15, 2018 at 11:18:24AM +0200, Fabian Deutsch wrote:
> All, this topic - v2v and some other playing around - actually lead me to
> the thought that we probably want a library which can do domxml to vmspec
> conversions.
> v2v, a potential libvirt-to-kubevirt kubectl would benefit from this.

While it sounds like a good idea in general, I don't think we should
use this for virt-v2v.

virt-v2v has its own concept of metadata[1]—which, to be fair, is
modelled after and closely follows a small subset of libvirt metadata.
However it's plainly cleaner and more straightforward for virt-v2v to
generate kubevirt yaml directly, rather than going through additional
steps and invoking an external program. If you look at the original
patch I posted[2], generating the yaml is only about 40 lines of code.

Rich.

[1] https://github.com/libguestfs/libguestfs/blob/22cae846ce305c9a772044ce181cb7efc3a93500/v2v/types.mli#L59

[2] ‘method create_metadata’ in
https://www.redhat.com/archives/libguestfs/2018-March/msg00194.html

--
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
virt-p2v converts physical machines to virtual machines. Boot with a
live CD or over the network (PXE) and turn machines into KVM guests.
http://libguestfs.org/virt-v2v

Richard W.M. Jones

unread,
May 16, 2018, 6:47:08 AM5/16/18
to Alexander Gallego, Fabian Deutsch, kubevirt-dev
On Mon, May 14, 2018 at 09:19:45AM -0400, Alexander Gallego wrote:
> On Mon, May 14, 2018 at 8:00 AM, Richard W.M. Jones <rjo...@redhat.com>
> wrote:
>
> > > you mean this: http://libguestfs.org/virt-v2v.1.html
> > >
> > > > To me it looks like strategically it makes sense to strengthen the
> > > >> virt-v2v codebase and add proper kubevirt support.
> > > >>
> > > >
> > > Any pointers, even as to the strategy. i.e.: any design doc i can read
> >
> > There was a simple prototype of an ‘-o kubevirt’ mode posted:
> >
> > https://www.redhat.com/archives/libguestfs/2018-March/msg00194.html
> >
> > Apply that patch to virt-v2v and then you should be able to do
> > something like this to test:
> >
> > $ virt-builder fedora-27
> > $ virt-v2v -i disk fedora-27.img -o kubevirt -os /tmp

The commands you actually want to use are:

$ ./run virt-builder fedora-27
$ ./run virt-v2v -i disk fedora-27.img -o kubevirt -os /tmp

Please read this document as it will save you a lot of time:

http://libguestfs.org/guestfs-building.1.html

Rich.

--
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
virt-builder quickly builds VMs from scratch
http://libguestfs.org/virt-builder.1.html
Reply all
Reply to author
Forward
0 new messages