Bug 960941 - [REST-API]: moving VM (with placement_policy-host-id attribute) between clusters succeed with error message
[REST-API]: moving VM (with placement_policy-host-id attribute) between clust...
Status: CLOSED UPSTREAM
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: ovirt-engine-restapi (Show other bugs)
3.2.0
Unspecified Unspecified
unspecified Severity medium
: ---
: 3.3.0
Assigned To: Noam Slomianko
Barak Dagan
sla
: Triaged
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-05-08 06:53 EDT by Barak Dagan
Modified: 2016-02-10 15:17 EST (History)
10 users (show)

See Also:
Fixed In Version: is6
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-07-18 09:02:15 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: SLA
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
engine log (1.63 KB, application/x-gzip)
2013-05-08 06:53 EDT, Barak Dagan
no flags Details

  None (edit)
Description Barak Dagan 2013-05-08 06:53:34 EDT
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:
Comment 1 Noam Slomianko 2013-07-03 09:00:03 EDT
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.

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