Ensure offline migrations update SR-IOV NIC states
This commit is contained in:
		| @@ -630,6 +630,10 @@ def move_vm(zkhandler, domain, target_node, wait=False, force_live=False): | |||||||
|  |  | ||||||
|     retmsg = 'Permanently migrating VM "{}" to node "{}".'.format(domain, target_node) |     retmsg = 'Permanently migrating VM "{}" to node "{}".'.format(domain, target_node) | ||||||
|  |  | ||||||
|  |     if target_state not in ['migrate', 'migrate-live']: | ||||||
|  |         # Update any SR-IOV NICs - with online migrations this is done by pvcnoded, but offline we must do it here | ||||||
|  |         update_vm_sriov_nics(zkhandler, dom_uuid, zkhandler.read(('domain.node', dom_uuid)), target_node) | ||||||
|  |  | ||||||
|     lock = zkhandler.exclusivelock(('domain.state', dom_uuid)) |     lock = zkhandler.exclusivelock(('domain.state', dom_uuid)) | ||||||
|     with lock: |     with lock: | ||||||
|         zkhandler.write([ |         zkhandler.write([ | ||||||
| @@ -698,6 +702,10 @@ def migrate_vm(zkhandler, domain, target_node, force_migrate, wait=False, force_ | |||||||
|  |  | ||||||
|     retmsg = 'Migrating VM "{}" to node "{}".'.format(domain, target_node) |     retmsg = 'Migrating VM "{}" to node "{}".'.format(domain, target_node) | ||||||
|  |  | ||||||
|  |     if target_state not in ['migrate', 'migrate-live']: | ||||||
|  |         # Update any SR-IOV NICs - with online migrations this is done by pvcnoded, but offline we must do it here | ||||||
|  |         update_vm_sriov_nics(zkhandler, dom_uuid, zkhandler.read(('domain.node', dom_uuid)), target_node) | ||||||
|  |  | ||||||
|     lock = zkhandler.exclusivelock(('domain.state', dom_uuid)) |     lock = zkhandler.exclusivelock(('domain.state', dom_uuid)) | ||||||
|     with lock: |     with lock: | ||||||
|         zkhandler.write([ |         zkhandler.write([ | ||||||
| @@ -741,6 +749,10 @@ def unmigrate_vm(zkhandler, domain, wait=False, force_live=False): | |||||||
|  |  | ||||||
|     retmsg = 'Unmigrating VM "{}" back to node "{}".'.format(domain, target_node) |     retmsg = 'Unmigrating VM "{}" back to node "{}".'.format(domain, target_node) | ||||||
|  |  | ||||||
|  |     if target_state not in ['migrate', 'migrate-live']: | ||||||
|  |         # Update any SR-IOV NICs - with online migrations this is done by pvcnoded, but offline we must do it here | ||||||
|  |         update_vm_sriov_nics(zkhandler, dom_uuid, zkhandler.read(('domain.node', dom_uuid)), target_node) | ||||||
|  |  | ||||||
|     lock = zkhandler.exclusivelock(('domain.state', dom_uuid)) |     lock = zkhandler.exclusivelock(('domain.state', dom_uuid)) | ||||||
|     with lock: |     with lock: | ||||||
|         zkhandler.write([ |         zkhandler.write([ | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user