Ravi Nori has uploaded a new change for review.

Change subject: restapi: <placement_policy> should accept <host> by name 
(#757115)
......................................................................

restapi: <placement_policy> should accept <host> by name (#757115)

The addition of a VM by host name doesn't work as intended. The
VM is being added without a host id.

This patch fixes the issue by passing the computed host id from host
name to the VmStatic class, which is used by the backend to create
the VM.

Change-Id: I09c9ad52db15e18813632598aca701e2b18af3d6
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=757115
Signed-off-by: Ravi Nori <[email protected]>
---
M 
backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/BackendVmsResource.java
1 file changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/19/8819/1

diff --git 
a/backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/BackendVmsResource.java
 
b/backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/BackendVmsResource.java
index 286ef70..c044328 100644
--- 
a/backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/BackendVmsResource.java
+++ 
b/backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/BackendVmsResource.java
@@ -50,7 +50,7 @@
 import org.ovirt.engine.core.common.queries.VdcQueryParametersBase;
 import org.ovirt.engine.core.common.queries.VdcQueryType;
 import org.ovirt.engine.core.compat.Guid;
-
+import static org.ovirt.engine.core.compat.NGuid.createGuidFromString;
 
 public class BackendVmsResource extends
         AbstractBackendCollectionResource<VM, 
org.ovirt.engine.core.common.businessentities.VM>
@@ -101,7 +101,7 @@
                 if (vm.isSetPlacementPolicy() && 
vm.getPlacementPolicy().isSetHost()
                         && vm.getPlacementPolicy().getHost().isSetName()
                         && !vm.getPlacementPolicy().getHost().isSetId()) {
-                    
vm.getPlacementPolicy().getHost().setId(getHostId(vm.getPlacementPolicy().getHost().getName()));
+                    
staticVm.setdedicated_vm_for_vds(createGuidFromString(getHostId(vm.getPlacementPolicy().getHost().getName())));
                 }
             } else {
                 vm.setPlacementPolicy(null);


--
To view, visit http://gerrit.ovirt.org/8819
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I09c9ad52db15e18813632598aca701e2b18af3d6
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Ravi Nori <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to