Bug 1309572 - [RFE] Provide flag to run Hosted Engine VM from local conf file instead of the one in the shared storage.
Summary: [RFE] Provide flag to run Hosted Engine VM from local conf file instead of th...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: ovirt-hosted-engine-setup
Classification: oVirt
Component: Tools
Version: 1.3.3.3
Hardware: Unspecified
OS: Unspecified
high
unspecified with 1 vote
Target Milestone: ovirt-3.6.5
: 1.3.5.0
Assignee: Simone Tiraboschi
QA Contact: Artyom
URL:
Whiteboard:
Depends On:
Blocks: 1321997
TreeView+ depends on / blocked
 
Reported: 2016-02-18 07:35 UTC by Sandro Bonazzola
Modified: 2021-08-30 12:01 UTC (History)
8 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2016-04-21 14:36:11 UTC
oVirt Team: Integration
Embargoed:
rule-engine: ovirt-3.6.z+
ylavi: planning_ack+
sbonazzo: devel_ack+
mavital: testing_ack+


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker RHV-43190 0 None None None 2021-08-30 12:01:09 UTC
Red Hat Knowledge Base (Solution) 2209751 0 None None None 2016-03-24 19:11:37 UTC
oVirt gerrit 54813 0 master MERGED tool: let the user pass a custom vm.conf 2021-02-08 11:56:35 UTC
oVirt gerrit 54814 0 ovirt-hosted-engine-setup-1.3 MERGED tool: let the user pass a custom vm.conf 2021-02-08 11:56:35 UTC

Description Sandro Bonazzola 2016-02-18 07:35:02 UTC
Now that the configuration is on a shared storage in the OVF store, it's not easy to tweak the Hosted Engine VM.
Since the VM can't be edited from the Web UI as previously planned, we need at least a command line tool to edit it.

Comment 1 Simone Tiraboschi 2016-02-18 10:48:42 UTC
Roy, simply directly tweaking a few parameters in the OVF_STORE (ram, core number, MAC addr for instance) could work or we need also to save them in the engine DB?

Comment 2 Doron Fediuck 2016-02-21 11:59:55 UTC
1. It is needed to save it into the DB as well, since the OVF is re-written.

2. We also need to handle editing the HA agents config files stored in the shared storage.

Comment 3 Simone Tiraboschi 2016-02-22 12:00:23 UTC
(In reply to Doron Fediuck from comment #2)
> 1. It is needed to save it into the DB as well, since the OVF is re-written.
> 
> 2. We also need to handle editing the HA agents config files stored in the
> shared storage.

Currently ovirt-ha-agent already reads the OVF_STORE, the initial/boostrap vm.conf on the shared storage is used as a fallback configuration just if the OVF_STORE is not available.

Comment 4 Yaniv Lavi 2016-02-24 08:07:37 UTC
I'm not sure if we should make a tool like this since we are going to add edit VM. The question what target you are planning to finish the bug fixes for that.

Comment 5 Roy Golan 2016-03-16 13:37:27 UTC
The solution would be bypass to shared configuration rather than to supply an edit configuration tool from the cli.

Something like:

  hosted-engine --vm-start --vm-conf=/path/to/vm.conf

And that will load the VM straight from that conf. User can copy the /var/run/hosted-engine/vm.conf locally and amend it to its needs. Then the VM will be up and the user will use the 'edit vm' flow and that will persist the configuration and make them ready for next run.

Comment 6 Simone Tiraboschi 2016-03-21 15:56:54 UTC
The recovery flow is:

1. set global maintenance mode: hosted-engine --set-maintenance --mode=global 
2. poweroff engine VM if somehow up: hosted-engine --vm-poweroff
3. copy /var/run/ovirt-hosted-engine-ha/vm.conf somewhere as a template
4. edit it according to what you need
5. restart engine VM with a custom vm.conf: hosted-engine --vm-start --vm-conf=my_custom_vm.conf
6. from the engine, revert your latest changes to the hosted-engine VM

Comment 7 Marina Kalinin 2016-03-23 20:29:07 UTC
(In reply to Simone Tiraboschi from comment #6)
> The recovery flow is:
> 
> 1. set global maintenance mode: hosted-engine --set-maintenance
> --mode=global 
> 2. poweroff engine VM if somehow up: hosted-engine --vm-poweroff
> 3. copy /var/run/ovirt-hosted-engine-ha/vm.conf somewhere as a template
> 4. edit it according to what you need
> 5. restart engine VM with a custom vm.conf: hosted-engine --vm-start
> --vm-conf=my_custom_vm.conf
> 6. from the engine, revert your latest changes to the hosted-engine VM

Simone, step#6 is not clear. isn't this whole bug is about the fact that we cannot edit the vm in the engine? Or did you mean - start the HE VM and then get out of maintenance?

Comment 8 Simone Tiraboschi 2016-03-24 08:29:10 UTC
In a near future the user will be able to edit the engine VM from the engine; on next boot the engine VM will be loaded with the new configuration.

This RFE was just about providing a recovery mechanism if, for any reason, the engine VM isn't able to start with the new configuration since at that point there is no running engine to edit it again.

With this RFE the user can pass a custom vm.conf to start the engine VM and at that point, having an engine, the user can edit again the engine VM configuration.

To be fully precise in comment 6 I didn't described the two final steps:

7. reboot again the engine VM to load the fresh configuration
8. If everything is fine, exit global maintenance mode

Comment 9 Marina Kalinin 2016-03-24 19:11:37 UTC
Thanks a lot, Simone.
I documented it here:
https://access.redhat.com/solutions/2209751

Comment 10 Artyom 2016-04-03 14:52:54 UTC
Checked on ovirt-hosted-engine-setup-1.3.5.0-1.el7ev.noarch
I see that it works and VM received parameters from my configuration file, but I see that parameters not updated under the engine.
For example:
1) Change VM memory from 4Gb to 8Gb
2) I see that VM has 8GB, but engine shows that HE VM has 4Gb

Does it desired behaviour?

Comment 11 Simone Tiraboschi 2016-04-04 07:54:32 UTC
(In reply to Artyom from comment #10)
> Checked on ovirt-hosted-engine-setup-1.3.5.0-1.el7ev.noarch
> I see that it works and VM received parameters from my configuration file,
> but I see that parameters not updated under the engine.
> For example:
> 1) Change VM memory from 4Gb to 8Gb
> 2) I see that VM has 8GB, but engine shows that HE VM has 4Gb
> 
> Does it desired behaviour?

No, it's not: the engine should report it coherently.
But, if you see the correct amount inside the VM, this is just a different issue on engine side (probably just a refresh issue).

Comment 12 Artyom 2016-04-04 08:04:38 UTC
I tried to refresh, but I still see only 4Gb instead of 8Gb under the engine. Looks like it does not update DB:
engine=# select mem_size_mb from vm_static where vm_name='HostedEngine';
 mem_size_mb 
-------------
        4096
(1 row)

so I will open another bug.

Comment 13 Artyom 2016-04-04 15:19:09 UTC
Verified on ovirt-hosted-engine-setup-1.3.5.0-1.el7ev.noarch

Comment 14 Marina Kalinin 2016-05-18 21:45:28 UTC
Why do we need the flag?
I have just added an additional vnic to my RHEV-M that is HE VM through the admin portal. However:
# engine-config -g AllowEditingHostedEngine
AllowEditingHostedEngine: false version: general

This is 3.6.5 rhevm appliance upgraded from 3.6.3.

Comment 15 Marina Kalinin 2016-05-19 16:38:23 UTC
Apologies,
The flag mentioned here is the --vm-conf.
I got it confused with AllowEditingHostedEngine.
Taking my question back.


Note You need to log in before you can comment on or make changes to this bug.