<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"><div dir="ltr">Hi,<div><br></div><div>There has been discussion about the OpenStack output and Richard asked for a public thread on this list, so here it is.</div><div><br></div><div>For v2v from VMware to RHV, there is a Python script that does some extra steps to create the virtual machine after the disks have been converted. We want to have the same behavior for OpenStack, i.e. have virt-v2v create the instance once the volumes have been created.</div><div><br></div><div>For that, I've written a Python script [1] that takes a JSON file (sample here [2]) as input. I expect this JSON input to be generated by virt-v2v openstack output module, from the command line options and the volumes ids generated during conversion.</div><div><br></div><div>Here are the options I think we should have for the OpenStack output:</div><div><br></div><div>-o openstack</div><div>-oo os-auth-url='<a href="http://controller.example.com:5000/v3">http://controller.example.com:5000/v3</a>'<br></div><div>-oo os-user-domain-name='Default'</div><div>-oo os-project-name='v2v-project'<br></div><div><div>-oo os-username='admin'</div><div>-oo os-password='secret'</div><div>-oo server-id='01234567-89ab-cdef-0123-456789abcdef'</div>-oo destination_project_id='01234567-89ab-cdef-0123-456789abcdef'</div><div><div>-oo volume_type_id='01234567-89ab-cdef-0123-456789abcdef'</div><div>-oo flavor_id='01234567-89ab-cdef-0123-456789abcdef'</div><div>-oo security_groups_ids='01234567-89ab-cdef-0123-456789abcdef,01234567-89ab-cdef-0123-456789abcdef'</div><div>--mac 01:23:45:67:89:ab:network:01234567-89ab-cdef-0123-456789abcdef</div><div><br></div></div><div>You'll see that the --mac option is not specific to OpenStack, but it shows how it would look like with a network id. And it should be passed to the post-conversion script.</div><div><br></div><div>The translation to JSON is pretty straight forward and should not be difficult. We simply have to agree on the JSON keys we expect and the where the new -oo keys go. Also, the script is quite simple and relies on OpenStack Python SDK, which is also used by the OpenStack CLI, so no additional dependencies are required and it should be easy to maintain.</div><div><br></div><div>[1] <a href="https://gist.github.com/fdupont-redhat/934b3efb6d66a991a80149235066d7d7#file-post_conversion-py">https://gist.github.com/fdupont-redhat/934b3efb6d66a991a80149235066d7d7#file-post_conversion-py</a></div><div>[2] <a href="https://gist.github.com/fdupont-redhat/934b3efb6d66a991a80149235066d7d7#file-test-migration-json">https://gist.github.com/fdupont-redhat/934b3efb6d66a991a80149235066d7d7#file-test-migration-json</a><br clear="all"><div><br></div>-- <br><div dir="ltr" class="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;padding:0px"><b style="font-family:arial,helvetica,sans-serif;font-size:small"><font color="#cc0000"><span style="margin:0px;padding:0px">Fabien</span> <span style="margin:0px;padding:0px">Dupont</span></font></b><br></p><p style="color:rgb(0,0,0);margin:0px;padding:0px"></p><p style="font-size:small;color:rgb(0,0,0);margin:0px;padding:0px"><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;padding:0px"></font></p><p style="font-size:small;margin:0px;padding:0px"><font face="arial, helvetica, sans-serif" size="1" color="#000000">Red Hat - Solutions Engineering</font></p><p style="margin:0px;padding:0px"><font size="1" face="arial, helvetica, sans-serif"><span style="margin:0px;padding:0px"><span style="margin:0px;padding:0px"><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;padding:0px"><font color="#000000">M: </font><a href="tel:+33662784971" style="margin:0px;padding:0px" target="_blank"><font color="#0b5394">+33 (0) 662 784 971</font></a></span></font></p><p style="margin:0px;padding:0px"><span style="margin:0px;padding:0px"><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;padding:0px"><font color="#cc0000"><b>TRIED. TESTED. TRUSTED.</b></font></span></font></span></p><p style="color:rgb(0,0,0);margin:0px;padding:0px"><font size="1" face="arial, helvetica, sans-serif"><span style="margin:0px;padding:0px"></span></font></p><div style="color:rgb(0,0,0);margin:0px;padding:0px"><div style="margin:0px;padding:0px"><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></div></div></div></div></div></div></div></div></div></div></div></div>