1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-23 22:50:09 +03:00

B OpenNebula/one#6319: Execute VNM post operation after revert

This affects KVM with libvirt 8.0.0+. As for 8.0.0, libvirt will stop and start a domain when reverting to a snapshot. It appears that this may recreate the Open vSwitch interface, which loses the VLAN configuration placed there by the Open vSwitch Driver.
This commit is contained in:
Ruben S. Montero 2023-09-25 08:57:38 +02:00
parent d59f30c382
commit 2efd976645
No known key found for this signature in database
GPG Key ID: A0CEA6FA880A1D87

View File

@ -817,18 +817,27 @@ class ExecDriver < VirtualMachineDriver
def snapshot_revert(id, drv_message)
xml_data = decode(drv_message)
host = xml_data.elements['HOST'].text
deploy_id = xml_data.elements['DEPLOY_ID'].text
snap_id_xpath = "VM/TEMPLATE/SNAPSHOT[ACTIVE='YES']/HYPERVISOR_ID"
snapshot_name = xml_data.elements[snap_id_xpath].text
do_action("#{deploy_id} #{snapshot_name}",
id,
host,
ACTION[:snapshot_revert],
:script_name => 'snapshot_revert',
:stdin => xml_data.to_s)
action = VmmAction.new(self, id, :snapshot_revert, drv_message)
steps = [
# Run the snapshot_revert action script
{
:driver => :vmm,
:action => :snapshot_revert,
:parameters => [:deploy_id, snapshot_name]
},
# Execute post-boot networking setup
{
:driver => :vnm,
:action => :post,
:parameters => [:deploy_id, :host]
}
]
action.run(steps)
end
#