Created attachment 745204 [details] engine log Description of problem: updating VM configured to run on specific host to run on different cluster, succeed with an error message. The VM should be in down state. Same operation passed successfully (200-OK) on REST API and failed in UI. Version-Release number of selected component (if applicable): SF15 How reproducible: 100% Steps to Reproduce: add datacenter --name 'test1' --version-minor 2 --version-major 3 --storage_type iscsi add cluster --name 'test1a' --data_center-name 'test1' --cpu-id 'Intel Conroe Family' add cluster --name 'test1b' --data_center-name 'test1' --cpu-id 'Intel Conroe Family' add vm --name 'vm_test1' --cluster-name 'test1a' --template-name 'Blank' add host --name myhost --address myhost.redhat.com --cluster-name test1a --root_password pass update vm vm_test1 --placement_policy-host-name myhost --placement_policy-affinity 'pinned' [RHEVM shell (connected)]# list clusters id : d51bc49d-1c98-481a-a230-299cc94f60fd name : test1a id : f099a376-538f-49d7-8f74-5fcded3480f8 name : test1b [RHEVM shell (connected)]# show vm vm_test1 id : f4f96412-42e3-4e4d-863b-100341e66d17 name : vm_test1 cluster-id : d51bc49d-1c98-481a-a230-299cc94f60fd <-- cpu-mode : CUSTOM cpu-topology-cores : 1 cpu-topology-sockets : 1 creation_time : 2013-05-07 06:10:34.964000+03:00 delete_protected : False display-allow_override : False display-monitors : 1 display-smartcard_enabled : False display-type : spice high_availability-enabled : False high_availability-priority: 1 memory : 536870912 memory_policy-guaranteed : 536870912 origin : rhev os-boot-dev : hd os-type : unassigned placement_policy-affinity : pinned placement_policy-host-id : 739107e5-6dc2-4506-926f-aae9009e6f03 <-- quota-id : 00000000-0000-0000-0000-000000000000 stateless : False status-state : down template-id : 00000000-0000-0000-0000-000000000000 type : desktop usb-enabled : False [RHEVM shell (connected)]# update vm vm_test1 --cluster-id f099a376-538f-49d7-8f74-5fcded3480f8 error: status: 400 reason: Bad Request detail: Cannot edit VM. VM is pinned to a specific host. The host's cluster must be the same as the selected VM cluster. [RHEVM shell (connected)]# show vm vm_test1 id : f4f96412-42e3-4e4d-863b-100341e66d17 name : vm_test1 cluster-id : f099a376-538f-49d7-8f74-5fcded3480f8 <--- cpu-mode : CUSTOM cpu-topology-cores : 1 cpu-topology-sockets : 1 creation_time : 2013-05-07 06:10:34.964000+03:00 delete_protected : False display-allow_override : False display-monitors : 1 display-smartcard_enabled : False display-type : spice high_availability-enabled : False high_availability-priority: 1 memory : 536870912 memory_policy-guaranteed : 536870912 origin : rhev os-boot-dev : hd os-type : unassigned placement_policy-affinity : pinned quota-id : 00000000-0000-0000-0000-000000000000 stateless : False status-state : down template-id : 00000000-0000-0000-0000-000000000000 type : desktop usb-enabled : False Actual results: passed with error Expected results: either pass with no error (RESTAPI) or fail with error (UI) Additional info:
This flow was fixed with the separation of ChangeVMClusterCommand from the UpdateVmCommand. Now the rest api succeeds (changes the cluster and removes the pin) without returning an error Now extra work was done.