Re: [lago-devel] [ovirt-devel] Lago and vm templates

On Thu, Aug 24, 2017 at 4:56 AM, Marc Young <3vilpenguin@gmail.com> wrote:
Im currently neck deep in ovirt-system-tests and lago I see alot of usages about importing VMs from templates, but are there any examples of exporting a VM to template?
I assume you are looking into Lago templates, not oVirt templates? Currently, I'm not aware of a way. What template do you need?
Side note I cant find a good source of methods available for use in python-lago-ovirt (or even python-lago). The docs[1] are pretty lacking
Can you open an issue about it? What do you wish to perform? TIA, Y.
[1] http://lago.readthedocs.io/en/latest/lago.html
_______________________________________________ Devel mailing list Devel@ovirt.org http://lists.ovirt.org/mailman/listinfo/devel

Im currently neck deep in ovirt-system-tests and lago I see alot of usages about importing VMs from templates, but are there any examples of exporting a VM to template?
If you're referring to the available Lago templates it is described at [1]. With regard to the lago-ost-plugin(aka python-lago-ovirt), true, we are lacking some docs there. Also note that for OST it self we have [2], which has some more OST specific details. Please elaborate on what you are trying to achieve, we might already have that feature(but lacking docs, such as 'lago export'). Thanks, Nadav. [1] http://lago.readthedocs.io/en/latest/Templates.html [2] http://ovirt-system-tests.readthedocs.io On Thu, Aug 24, 2017 at 8:42 AM, Yaniv Kaul <ykaul@redhat.com> wrote:
On Thu, Aug 24, 2017 at 4:56 AM, Marc Young <3vilpenguin@gmail.com> wrote:
Im currently neck deep in ovirt-system-tests and lago I see alot of usages about importing VMs from templates, but are there any examples of exporting a VM to template?
I assume you are looking into Lago templates, not oVirt templates? Currently, I'm not aware of a way. What template do you need?
Side note I cant find a good source of methods available for use in python-lago-ovirt (or even python-lago). The docs[1] are pretty lacking
Can you open an issue about it? What do you wish to perform? TIA, Y.
[1] http://lago.readthedocs.io/en/latest/lago.html
_______________________________________________ Devel mailing list Devel@ovirt.org http://lists.ovirt.org/mailman/listinfo/devel
_______________________________________________ lago-devel mailing list lago-devel@ovirt.org http://lists.ovirt.org/mailman/listinfo/lago-devel

Thanks for the quick feedback. Didn't realize there was a better mailing list. Basically what I'm trying to do is create a big suite of integration tests for the vagrant provider. My first attempt of tests basically assumes there's an active ovirt setup to use and uses secrets to run vagrant configs and assertions. It works but having a cluster up isn't a good practice. I'm looking at using bits and pieces from ovirt-system-tests and Lago to bootstrap a simple cluster (master and single host). Vagrant requires coming up from a template (and a modified one at that [1]. So I was hoping to use lago and the Lago ost to create a VM (done). Run things against it (done) then create an ovirt vm template from it (where I'm currently stuck). That would get me a great place to start running a matrix of the Ruby sdk versions, vagrant versions, and ovirt versions (4.0,4.1, etc) to run true integration tests on the vagrant provider. The issue right now is the lago documentation is pretty scattered and limited so I'm left cargo culting allot of existing stuff and working off very limited examples. My suspicion is I'll need to mix and match the ovirt python sdk and Lago to get the template portion working. I was surprised to see that the system tests assert alot around VM creating, snapshotting, stopping, and importing templates, but no tests around exporting templates [1] https://github.com/myoung34/vagrant-ovirt4/blob/master/tools/prepare_redhat_... On Thu, Aug 24, 2017, 1:55 AM Nadav Goldin <ngoldin@redhat.com> wrote:
Im currently neck deep in ovirt-system-tests and lago I see alot of usages about importing VMs from templates, but are there any examples of exporting a VM to template?
If you're referring to the available Lago templates it is described at [1]. With regard to the lago-ost-plugin(aka python-lago-ovirt), true, we are lacking some docs there. Also note that for OST it self we have [2], which has some more OST specific details.
Please elaborate on what you are trying to achieve, we might already have that feature(but lacking docs, such as 'lago export').
Thanks,
Nadav.
[1] http://lago.readthedocs.io/en/latest/Templates.html [2] http://ovirt-system-tests.readthedocs.io
On Thu, Aug 24, 2017 at 8:42 AM, Yaniv Kaul <ykaul@redhat.com> wrote:
On Thu, Aug 24, 2017 at 4:56 AM, Marc Young <3vilpenguin@gmail.com>
wrote:
Im currently neck deep in ovirt-system-tests and lago I see alot of usages about importing VMs from templates, but are there
any
examples of exporting a VM to template?
I assume you are looking into Lago templates, not oVirt templates? Currently, I'm not aware of a way. What template do you need?
Side note I cant find a good source of methods available for use in python-lago-ovirt (or even python-lago). The docs[1] are pretty lacking
Can you open an issue about it? What do you wish to perform? TIA, Y.
[1] http://lago.readthedocs.io/en/latest/lago.html
_______________________________________________ Devel mailing list Devel@ovirt.org http://lists.ovirt.org/mailman/listinfo/devel
_______________________________________________ lago-devel mailing list lago-devel@ovirt.org http://lists.ovirt.org/mailman/listinfo/lago-devel

On 24 August 2017 at 15:35, Marc Young <3vilpenguin@gmail.com> wrote:
Vagrant requires coming up from a template (and a modified one at that [1].
I was wondering about this approach. Could things be changed so that a vanilla image (Like the ones hosted on oVirt Glance) and a cloud-init script would be sufficient? It would be even better if Vargant could upload the images from libvirt boxes directly into oVirt. -- Barak Korren RHV DevOps team , RHCE, RHCi Red Hat EMEA redhat.com | TRIED. TESTED. TRUSTED. | redhat.com/trusted

Per cloud-init, I think that's doable. I added support for cloud-init so Ill see if that can get me going on an easy path. Per uploading: I'm not sure. This might be pretty complex. Vagrant has a concept of boxes (for non local files its usually just a zip folder with a metadata manifest) [1] and uploading to their cloud platform atlas [2] but that kind of gets outside the realm of Vagrant and more into the niche that Packer[3] fits. There has been some work on packer with qemu[4] but not oVirt so possibly thats a good place for another project to fit (ovirt packer provider) [1] https://github.com/myoung34/vagrant-ovirt4/tree/master/example_box [2] https://www.vagrantup.com/docs/boxes.html [3] https://www.packer.io/ [4] https://www.packer.io/docs/builders/qemu.html On Thu, Aug 24, 2017 at 8:17 AM, Barak Korren <bkorren@redhat.com> wrote:
On 24 August 2017 at 15:35, Marc Young <3vilpenguin@gmail.com> wrote:
Vagrant requires coming up from a template (and a modified one at that
[1].
I was wondering about this approach. Could things be changed so that a vanilla image (Like the ones hosted on oVirt Glance) and a cloud-init script would be sufficient?
It would be even better if Vargant could upload the images from libvirt boxes directly into oVirt.
-- Barak Korren RHV DevOps team , RHCE, RHCi Red Hat EMEA redhat.com | TRIED. TESTED. TRUSTED. | redhat.com/trusted

On 24 August 2017 at 16:53, Marc Young <3vilpenguin@gmail.com> wrote:
Per cloud-init, I think that's doable. I added support for cloud-init so Ill see if that can get me going on an easy path.
Per uploading: I'm not sure. This might be pretty complex. Vagrant has a concept of boxes (for non local files its usually just a zip folder with a metadata manifest) [1] and uploading to their cloud platform atlas [2] but that kind of gets outside the realm of Vagrant and more into the niche that Packer[3] fits. There has been some work on packer with qemu[4] but not oVirt so possibly thats a good place for another project to fit (ovirt packer provider)
I was thinking on the following flow that can make oVirt Vagrant feel much like Vagrant with the libvirt provider (I never tried it with any other provider, so can`t refer to those) and even mke moving between the two feel ratehr seamless: 1. User runs 'vagrant up' with a Vagrantfile that teles it to use the oVirt provider and names a box 2. Vagrant downloads the box from atlas. 3. If the box is a libvirt box, Vargarnt uploads the QCOW2 file in it to oVirt using the upload API 4. Vagrant launches a VM in oVirt from the uploaded image while using cloud-init to create /vagrant, inject SSH keys, etc. I guess a challenge here would be to avoid downloading the same box more then once if ti was already uploaded to oVirt. (Sorry for taking your thread off-topic ;) -- Barak Korren RHV DevOps team , RHCE, RHCi Red Hat EMEA redhat.com | TRIED. TESTED. TRUSTED. | redhat.com/trusted

On Thu, Aug 24, 2017 at 4:53 PM, Marc Young <3vilpenguin@gmail.com> wrote:
Per cloud-init, I think that's doable. I added support for cloud-init so Ill see if that can get me going on an easy path.
Regretfully there's something wrong with the cloud-init on the CirrOS image we download, so it doesn't work well. Two alternatives I can think of: 1. Download a different image - CentOS and Fedora both work well, for example. The downside is that it's a bit slow. 2. Upload an image using the upload API. This has the advantage that it's (1) quicker and (2) will add an additional test to ovirt-system-tests, which is always a good idea. There's already an example available ( https://github.com/oVirt/ovirt-engine-sdk/blob/master/sdk/examples/upload_di... ) . Downside: will take a bit of space on the git repo, if the image will be on o-s-t git repo.
Per uploading: I'm not sure. This might be pretty complex. Vagrant has a concept of boxes (for non local files its usually just a zip folder with a metadata manifest) [1] and uploading to their cloud platform atlas [2] but that kind of gets outside the realm of Vagrant and more into the niche that Packer[3] fits.
Packer support for oVirt is waiting for the Go SDK and for someone to implement it. Y.
There has been some work on packer with qemu[4] but not oVirt so possibly thats a good place for another project to fit (ovirt packer provider)
[1] https://github.com/myoung34/vagrant-ovirt4/tree/master/example_box [2] https://www.vagrantup.com/docs/boxes.html [3] https://www.packer.io/ [4] https://www.packer.io/docs/builders/qemu.html
On Thu, Aug 24, 2017 at 8:17 AM, Barak Korren <bkorren@redhat.com> wrote:
On 24 August 2017 at 15:35, Marc Young <3vilpenguin@gmail.com> wrote:
Vagrant requires coming up from a template (and a modified one at that
[1].
I was wondering about this approach. Could things be changed so that a vanilla image (Like the ones hosted on oVirt Glance) and a cloud-init script would be sufficient?
It would be even better if Vargant could upload the images from libvirt boxes directly into oVirt.
-- Barak Korren RHV DevOps team , RHCE, RHCi Red Hat EMEA redhat.com | TRIED. TESTED. TRUSTED. | redhat.com/trusted

Ive made progress on using pure cloud-init on the centos glance images to get the vagrant pre-requisites included and usable but so far thats introduced two issues that still make template exporting within Lago desirable: 1. Time and network resources to download packages as well as CPU/memory bloating from repeated installations of the same packages 2. Unable to test network configuration of vagrant, which is a large part of vagrant to leave untested 1. By that i mean dhcp/static/multiple network interfaces via blocks such as [1] and [2] In the mean time I'm contemplating using the vagrant/ruby sdk to make `vagrant package` export as an oVirt template which would let me call that in the middle of an ovirt-system-tests suite, if I'm not mistaken? [1] config.vm.network :private_network, :ovirt__network_name => 'ovirtmgmt' #DHCP [2] config.vm.network :private_network, :ovirt__ip => '192.168.2.198', :ovirt__network_name => 'ovirtmgmt', :ovirt__gateway => '192.168.2.125', :ovirt__netmask => '255.255.0.0', :ovirt__dns_servers => '192.168.2.1', :ovirt__dns_search => 'test.local' On Thu, Aug 24, 2017 at 9:32 AM, Yaniv Kaul <ykaul@redhat.com> wrote:
On Thu, Aug 24, 2017 at 4:53 PM, Marc Young <3vilpenguin@gmail.com> wrote:
Per cloud-init, I think that's doable. I added support for cloud-init so Ill see if that can get me going on an easy path.
Regretfully there's something wrong with the cloud-init on the CirrOS image we download, so it doesn't work well. Two alternatives I can think of: 1. Download a different image - CentOS and Fedora both work well, for example. The downside is that it's a bit slow. 2. Upload an image using the upload API. This has the advantage that it's (1) quicker and (2) will add an additional test to ovirt-system-tests, which is always a good idea. There's already an example available ( https://github.com/oVirt/ovirt-engine-sdk/blob/master/ sdk/examples/upload_disk.py) . Downside: will take a bit of space on the git repo, if the image will be on o-s-t git repo.
Per uploading: I'm not sure. This might be pretty complex. Vagrant has a concept of boxes (for non local files its usually just a zip folder with a metadata manifest) [1] and uploading to their cloud platform atlas [2] but that kind of gets outside the realm of Vagrant and more into the niche that Packer[3] fits.
Packer support for oVirt is waiting for the Go SDK and for someone to implement it. Y.
There has been some work on packer with qemu[4] but not oVirt so possibly thats a good place for another project to fit (ovirt packer provider)
[1] https://github.com/myoung34/vagrant-ovirt4/tree/master/example_box [2] https://www.vagrantup.com/docs/boxes.html [3] https://www.packer.io/ [4] https://www.packer.io/docs/builders/qemu.html
On Thu, Aug 24, 2017 at 8:17 AM, Barak Korren <bkorren@redhat.com> wrote:
On 24 August 2017 at 15:35, Marc Young <3vilpenguin@gmail.com> wrote:
Vagrant requires coming up from a template (and a modified one at that
[1].
I was wondering about this approach. Could things be changed so that a vanilla image (Like the ones hosted on oVirt Glance) and a cloud-init script would be sufficient?
It would be even better if Vargant could upload the images from libvirt boxes directly into oVirt.
-- Barak Korren RHV DevOps team , RHCE, RHCi Red Hat EMEA redhat.com | TRIED. TESTED. TRUSTED. | redhat.com/trusted

Would the issue (request for create template) go into the ost plugin[1] or the lago project itself? [2] [1] https://github.com/lago-project/lago-ost-plugin [1] https://github.com/lago-project/lago On Thu, Aug 24, 2017 at 12:42 AM, Yaniv Kaul <ykaul@redhat.com> wrote:
On Thu, Aug 24, 2017 at 4:56 AM, Marc Young <3vilpenguin@gmail.com> wrote:
Im currently neck deep in ovirt-system-tests and lago I see alot of usages about importing VMs from templates, but are there any examples of exporting a VM to template?
I assume you are looking into Lago templates, not oVirt templates? Currently, I'm not aware of a way. What template do you need?
Side note I cant find a good source of methods available for use in python-lago-ovirt (or even python-lago). The docs[1] are pretty lacking
Can you open an issue about it? What do you wish to perform? TIA, Y.
[1] http://lago.readthedocs.io/en/latest/lago.html
_______________________________________________ Devel mailing list Devel@ovirt.org http://lists.ovirt.org/mailman/listinfo/devel

On 24 August 2017 at 17:21, Marc Young <3vilpenguin@gmail.com> wrote:
Would the issue (request for create template) go into the ost plugin[1] or the lago project itself? [2]
[1] https://github.com/lago-project/lago-ost-plugin [1] https://github.com/lago-project/lago
I think neither, since the patch to do this will not go in any one of those projects. Instead it should probably go in ovirt-system-tests which has bugs tracked in bugzilla.redhat.com (Sorry for the "bureaucracy"). -- Barak Korren RHV DevOps team , RHCE, RHCi Red Hat EMEA redhat.com | TRIED. TESTED. TRUSTED. | redhat.com/trusted
participants (4)
-
Barak Korren
-
Marc Young
-
Nadav Goldin
-
Yaniv Kaul