myoung34 / vagrant-ovirt4

oVirt v4 provider for Vagrant
MIT License
36 stars 23 forks source link

Start VMs in normal mode instead of run_once #147

Closed mika-b closed 2 years ago

mika-b commented 3 years ago

I can't think of any viable use case where run_once mode would be useful with vagrant. This causes VMs to be created in normal mode. I can make it configurable if it's preferred or there's a use case for it. Doesn't affect cloud-init.

Fixes #127

https://www.rubydoc.info/gems/ovirt-engine-sdk/OvirtSDK4/Vm#run_once=-instance_method

mika-b commented 3 years ago

I think I need to look more into this.

The original issue I had was that things configured with cloud-init disappeared when guests were shutdown and later restarted. Setting run_once false seemed to fix it. Now I'm unable to reproduce the issue and run_once doesn't seem to have any effect at all. Rebasing and rebuilding changed ovirt-engine-sdk from 4.0 to 4.4 (and I'm using ovirt 4.3) that could effect something.

Ansible has a setting 'cloud_init_persists' don't know how that's implemented but sounds familiar regarding the issue I had.

I don't mind this being postponed to some future release if you're about to make one now.

myoung34 commented 3 years ago

For your question, im not familiar with the ovirt ansible plugin but a quick search turned up this which looks like a bool to set run_once as true or false, so same idea as here by a different name

mika-b commented 3 years ago

That's basically what I tried to say. Your link is to the source format of the documentation I linked in my previous comment. :) I wasn't actually asking anything about it.

The thing is that even when I set run_once: false the configuration on oVirt side claims: <run_once>true</run_once>

In the original bug report the description of the issue seems a bit off. At least on oVirt 4.3 the exclamation mark is shown when guest agent hasn't responded yet or is not even installed. It's actually the blue circle that indicates the run once mode.

Since I can't reproduce the issue of disappearing configuration I don't see much to gain here.

jeremytourville commented 3 years ago

@myoung34 @cliffe @mika-b

A general comment - I too have been having issues with the run once config for the ovirt plugin. I am using the SecGen project. When I run vagrant up the VMs are starting in run once config. This causes the scenario for SecGen to never finish as it waits for the VM to be ready/available.

oVirt Open Virtualization Manager Software Version:4.4.2.6-1.el8

myoung34 commented 3 years ago

I'm ok to merge this if my suggestions to make it configurable are made

cliffe commented 3 years ago

Just FYI, we've not seen this issue with SecGen in our own oVirt infrastructure. Having said that we don't really make use of cloud-init, so maybe that's why.

jeremytourville commented 3 years ago

Just FYI, we've not seen this issue with SecGen in our own oVirt infrastructure. Having said that we don't really make use of cloud-init, so maybe that's why.

I'm not using cloud-init either. What version of oVirt are you running? I think that might be the common issue.

cliffe commented 3 years ago

We are on the current release.

tomeon commented 2 years ago

Popping in to note that #160 supersedes this PR.

myoung34 commented 2 years ago

@tomeon if you can rebase I'll cut this into a release

tomeon commented 2 years ago

@myoung34

[I]f you can rebase I'll cut this into a release

PR #147 is no longer needed, now that #160 is merged (#160 covers everything in this PR, and also provides the configurability you requested). IMO this PR can be closed.