<div dir="ltr"><br><div class="gmail_quote"><div dir="ltr">On Wed, Sep 26, 2018 at 11:39 AM Richard W.M. Jones <<a href="mailto:rjones@redhat.com">rjones@redhat.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Wed, Sep 26, 2018 at 09:57:22AM +0200, Fabien Dupont wrote:<br>
> Hi,<br>
> <br>
> There has been discussion about the OpenStack output and Richard asked for<br>
> a public thread on this list, so here it is.<br>
> <br>
> For v2v from VMware to RHV, there is a Python script that does some extra<br>
> steps to create the virtual machine after the disks have been converted. We<br>
> want to have the same behavior for OpenStack, i.e. have virt-v2v create the<br>
> instance once the volumes have been created.<br>
<br>
Note that for RHV we create *but do not start* the virtual machine.<br>
<br>
In fact virt-v2v doesn't start the virtual machine on any output, with<br>
the exception of the ‘--qemu-boot’ flag (which we remove in RHEL since<br>
it's essentially a debugging feature).<br>
<br>
So I don't necessarily accept the premise that virt-v2v should start<br>
the VM on OpenStack.  One reason not to is that the VM might not have<br>
been running on the source, and converting a VM should not change its<br>
state from shutdown to running for what I think are fairly obvious<br>
reasons.<br>
<br>
Complicating this is that OpenStack itself doesn't seem to have a<br>
concept of a VM which is created but not running (in this way it is<br>
different from libvirt and RHV).<br>
<br>
We currently create Cinder volume(s) with the VM disk data, plus image<br>
properties attached to those volume(s), plus other volume properties<br>
[NB: in Cinder properties and image properties are different things]<br>
which is sufficient for someone else to start the instance (see<br>
virt-v2v(1) man page for exactly how to start it).<br></blockquote><div><br></div><div>I do agree that we ask virt-v2v to do one more thing compared to RHV,</div><div>which is start the VM. But, virt-v2v doesn't really start the VM: it creates it,</div><div>then OpenStack starts it once created. I think we can fairly consider that</div><div>a user converting a VM, not only disks, from VMware to OpenStack will know</div><div>it and I think we should emphasize that in the OpenStack output documentation.</div><div><br></div><div>Also, I think it would be nice option for RHV to have a -oo start-vm option that</div><div>allows starting the VM after conversion. But I might be pushing too much ;)</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">> For that, I've written a Python script [1] that takes a JSON file (sample<br>
> here [2]) as input. I expect this JSON input to be generated by virt-v2v<br>
> openstack output module, from the command line options and the volumes ids<br>
> generated during conversion.<br>
> <br>
> Here are the options I think we should have for the OpenStack output:<br>
> <br>
> -o openstack<br>
> -oo os-auth-url='<a href="http://controller.example.com:5000/v3" rel="noreferrer" target="_blank">http://controller.example.com:5000/v3</a>'<br>
> -oo os-user-domain-name='Default'<br>
> -oo os-project-name='v2v-project'<br>
> -oo os-username='admin'<br>
> -oo os-password='secret'<br>
> -oo server-id='01234567-89ab-cdef-0123-456789abcdef'<br>
> -oo destination_project_id='01234567-89ab-cdef-0123-456789abcdef'<br>
> -oo volume_type_id='01234567-89ab-cdef-0123-456789abcdef'<br>
> -oo flavor_id='01234567-89ab-cdef-0123-456789abcdef'<br>
> -oo<br>
> security_groups_ids='01234567-89ab-cdef-0123-456789abcdef,01234567-89ab-cdef-0123-456789abcdef'<br>
> --mac 01:23:45:67:89:ab:network:01234567-89ab-cdef-0123-456789abcdef<br>
> <br>
> You'll see that the --mac option is not specific to OpenStack, but it shows<br>
> how it would look like with a network id. And it should be passed to the<br>
> post-conversion script.<br>
> <br>
> The translation to JSON is pretty straight forward and should not be<br>
> difficult. We simply have to agree on the JSON keys we expect and the where<br>
> the new -oo keys go. Also, the script is quite simple and relies on<br>
> OpenStack Python SDK, which is also used by the OpenStack CLI, so no<br>
> additional dependencies are required and it should be easy to maintain.<br>
> <br>
> [1]<br>
> <a href="https://gist.github.com/fdupont-redhat/934b3efb6d66a991a80149235066d7d7#file-post_conversion-py" rel="noreferrer" target="_blank">https://gist.github.com/fdupont-redhat/934b3efb6d66a991a80149235066d7d7#file-post_conversion-py</a><br>
> [2]<br>
> <a href="https://gist.github.com/fdupont-redhat/934b3efb6d66a991a80149235066d7d7#file-test-migration-json" rel="noreferrer" target="_blank">https://gist.github.com/fdupont-redhat/934b3efb6d66a991a80149235066d7d7#file-test-migration-json</a><br>
<br>
I'm still confused about how this fits with virt-v2v, even<br>
conceptually.<br>
<br>
Why don't you just run virt-v2v with the options you want, then<br>
examine the resulting Cinder volumes, extract the properties and image<br>
properties and run the VM using those properties?<br>
<br>
Did you look at a converted VM and see the properties and image<br>
properties that we are setting?<br></blockquote><div><br></div><div>That would mean moving that part into ManageIQ or virt-v2v-wrapper. But, I don't</div><div>see why virt-v2v-wrapper is not part of librguest/virt-v2v as it is not limited to RHV</div><div>conversions anymore. It adds a API-like interface to virt-v2v, as well as monitoring</div><div>capabilities that are really valuable. I'm thinking about a evolution of virt-v2v-wrapper,</div><div>and I will probably start a new thread for that.</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Rich.<br>
<br>
-- <br>
Richard Jones, Virtualization Group, Red Hat <a href="http://people.redhat.com/~rjones" rel="noreferrer" target="_blank">http://people.redhat.com/~rjones</a><br>
Read my programming and virtualization blog: <a href="http://rwmj.wordpress.com" rel="noreferrer" target="_blank">http://rwmj.wordpress.com</a><br>
libguestfs lets you edit virtual machines.  Supports shell scripting,<br>
bindings from many languages.  <a href="http://libguestfs.org" rel="noreferrer" target="_blank">http://libguestfs.org</a><br>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><p style="margin:0px!important;padding:0px!important"><b style="font-family:arial,helvetica,sans-serif;font-size:small"><font color="#cc0000"><span style="margin:0px!important;padding:0px!important">Fabien</span> <span style="margin:0px!important;padding:0px!important">Dupont</span></font></b><br></p><p style="color:rgb(0,0,0);margin:0px!important;padding:0px!important"></p><p style="font-size:small;color:rgb(0,0,0);margin:0px!important;padding:0px!important"><span style="font-family:arial,helvetica,sans-serif;font-size:x-small">PRINCIPAL SOFTWARE ENGINEER</span><font size="1" face="arial, helvetica, sans-serif"><br style="margin:0px!important;padding:0px!important"></font></p><p style="font-size:small;margin:0px!important;padding:0px!important"><font face="arial, helvetica, sans-serif" size="1" color="#000000">Red Hat - Solutions Engineering</font></p><p style="margin:0px!important;padding:0px!important"><font size="1" face="arial, helvetica, sans-serif"><span style="margin:0px!important;padding:0px!important"><span style="margin:0px!important;padding:0px!important"><a href="mailto:fabien@redhat.com" target="_blank"><font color="#0b5394">fabien@redhat.com</font></a></span><font color="#000000">     </font></span><span style="margin:0px!important;padding:0px!important"><font color="#000000">M: </font><a href="tel:+33662784971" style="margin:0px!important;padding:0px!important" target="_blank"><font color="#0b5394">+33 (0) 662 784 971</font></a></span></font></p><p style="margin:0px!important;padding:0px!important"><span style="margin:0px!important;padding:0px!important"><font size="1" face="arial, helvetica, sans-serif"><a href="http://redhat.com" style="color:rgb(0,0,0)" target="_blank"><img src="https://www.redhat.com/profiles/rh/themes/redhatdotcom/img/logo-red-hat-black.png" width="96" height="30"></a><font color="#000000">  </font><span style="margin:0px!important;padding:0px!important"><font color="#cc0000"><b>TRIED. TESTED. TRUSTED.</b></font></span></font></span></p><p style="color:rgb(0,0,0);margin:0px!important;padding:0px!important"><font size="1" face="arial, helvetica, sans-serif"><span style="margin:0px!important;padding:0px!important"></span></font></p><div style="color:rgb(0,0,0);margin:0px!important;padding:0px!important"><div style="margin:0px!important;padding:0px!important"><font size="1" face="arial, helvetica, sans-serif">Twitter: <a href="https://twitter.com/redhatway" target="_blank">@redhatway</a> | Instagram: <a href="https://www.instagram.com/redhatinc/" target="_blank">@redhatinc</a> | Snapchat: @redhatsnaps</font></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div>