Eldan Shachar has uploaded a new change for review.

Change subject: restapi: Cluster parameters override
......................................................................

restapi: Cluster parameters override

This feature allows to configure the 'emulated machine' and 'cpu 
model'parameters for each VM separately instead of relying on the cluster 
default.

Change-Id: Ibfe64e713edd43cad33b385699159db534112c02
Bug-Url: https://bugzilla.redhat.com/838487
Feature-page:http://www.ovirt.org/Features/Cluster_parameters_override
Signed-off-by: Eldan Shachar <[email protected]>
---
M 
backend/manager/modules/restapi/interface/definition/src/main/resources/api.xsd
M 
backend/manager/modules/restapi/interface/definition/src/main/resources/rsdl_metadata.yaml
M 
backend/manager/modules/restapi/types/src/main/java/org/ovirt/engine/api/restapi/types/VmMapper.java
3 files changed, 20 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/81/31581/1

diff --git 
a/backend/manager/modules/restapi/interface/definition/src/main/resources/api.xsd
 
b/backend/manager/modules/restapi/interface/definition/src/main/resources/api.xsd
index 5ff3af2..12eadcf 100644
--- 
a/backend/manager/modules/restapi/interface/definition/src/main/resources/api.xsd
+++ 
b/backend/manager/modules/restapi/interface/definition/src/main/resources/api.xsd
@@ -488,6 +488,8 @@
     </xs:sequence>
   </xs:complexType>
 
+  <xs:element name="custom_emulated_machine" type="xs:string"/>
+
   <xs:complexType name="TemplateVersion">
     <xs:sequence>
        <xs:element name="base_template" type="Template"  minOccurs="0" 
maxOccurs="1"/>
@@ -2634,6 +2636,7 @@
           <xs:element name="tunnel_migration" type="xs:boolean" minOccurs="0" 
maxOccurs="1"/>
           <xs:element name="migration_downtime" type="xs:int" minOccurs="0" 
maxOccurs="1" />
           <xs:element ref="virtio_scsi" minOccurs="0" maxOccurs="1"/>
+          <xs:element ref="custom_emulated_machine" minOccurs="0" 
maxOccurs="1"/>
           <xs:element ref="permissions" minOccurs="0" maxOccurs="1"/>
           <!-- also rel="cdroms/disks/nics/watchdogs" links, see Devices below 
-->
           <xs:element name="version" type="TemplateVersion" minOccurs="0" 
maxOccurs="1"/>
@@ -3054,6 +3057,7 @@
           <xs:element name="tunnel_migration" type="xs:boolean" minOccurs="0" 
maxOccurs="1"/>
           <xs:element name="migration_downtime" type="xs:int" minOccurs="0" 
maxOccurs="1" />
           <xs:element ref="virtio_scsi" minOccurs="0" maxOccurs="1"/>
+          <xs:element ref="custom_emulated_machine" minOccurs="0" 
maxOccurs="1"/>
           <xs:element ref="permissions" minOccurs="0" maxOccurs="1"/>
           <xs:element ref="vmpool" minOccurs="0" maxOccurs="1">
             <xs:annotation>
diff --git 
a/backend/manager/modules/restapi/interface/definition/src/main/resources/rsdl_metadata.yaml
 
b/backend/manager/modules/restapi/interface/definition/src/main/resources/rsdl_metadata.yaml
index 790b49d..e135cc1 100644
--- 
a/backend/manager/modules/restapi/interface/definition/src/main/resources/rsdl_metadata.yaml
+++ 
b/backend/manager/modules/restapi/interface/definition/src/main/resources/rsdl_metadata.yaml
@@ -96,6 +96,7 @@
           vm.tunnel_migration: xs:boolean
           vm.migration_downtime: xs:int
           vm.virtio_scsi.enabled: xs:boolean
+          vm.custom_emulated_machine: xs:string
           vm.use_latest_template_version: xs:boolean
           vm.payloads.payload--COLLECTION: {payload.type: 'xs:string', 
payload.volume_id: 'xs:string', payload.files.file--COLLECTION: {file.name: 
'xs:string', file.content: 'xs:string'}}
           vm.cpu.cpu_tune.vcpu_pin--COLLECTION: {vcpu_pin.vcpu: 'xs:int', 
vcpu_pin.cpu_set: 'xs:string'}
@@ -182,6 +183,7 @@
           vm.tunnel_migration: xs:boolean
           vm.migration_downtime: xs:int
           vm.virtio_scsi.enabled: xs:boolean
+          vm.custom_emulated_machine: xs:string
           vm.payloads.payload--COLLECTION: {payload.type: 'xs:string', 
payload.volume_id: 'xs:string', payload.files.file--COLLECTION: {file.name: 
'xs:string', file.content: 'xs:string'}}
           vm.initialization.configuration.type: 'xs:string'
           vm.initialization.configuration.data: 'xs:string'
@@ -240,6 +242,7 @@
           vm.tunnel_migration: xs:boolean
           vm.migration_downtime: xs:int
           vm.virtio_scsi.enabled: xs:boolean
+          vm.custom_emulated_machine: xs:string
           vm.payloads.payload--COLLECTION: {payload.type: 'xs:string', 
payload.volume_id: 'xs:string', payload.files.file--COLLECTION: {file.name: 
'xs:string', file.content: 'xs:string'}}
           vm.cpu.cpu_tune.vcpu_pin--COLLECTION: {vcpu_pin.vcpu: 'xs:int', 
vcpu_pin.cpu_set: 'xs:string'}
           vm.serial_number.policy: xs:string
@@ -3664,6 +3667,7 @@
           template.tunnel_migration: xs:boolean
           template.migration_downtime: xs:int
           template.virtio_scsi.enabled: xs:boolean
+          template.custom_emulated_machine: xs:string
           template.version.version_name: xs:string
           template.serial_number.policy: xs:string
           template.serial_number.value: xs:string
@@ -3722,6 +3726,7 @@
           template.tunnel_migration: xs:boolean
           template.migration_downtime: xs:int
           template.virtio_scsi.enabled: xs:boolean
+          template.custom_emulated_machine: xs:string
           template.vm.disks.disk--COLLECTION: {disk.id: 'xs:string', 
storage_domains.storage_domain--COLLECTION: {storage_domain.id: 'xs:string'}}
           template.permissions.clone: xs:boolean
           template.version.version_name: xs:string
@@ -5096,6 +5101,7 @@
           instance_type.usb.type: xs:string
           instance_type.migration_downtime: xs:int
           instance_type.virtio_scsi.enabled: xs:boolean
+          instance_type.custom_emulated_machine: xs:string
         description: add a new instance type to the system
     urlparams: {}
     headers:
diff --git 
a/backend/manager/modules/restapi/types/src/main/java/org/ovirt/engine/api/restapi/types/VmMapper.java
 
b/backend/manager/modules/restapi/types/src/main/java/org/ovirt/engine/api/restapi/types/VmMapper.java
index 144ac45..79a60a7 100644
--- 
a/backend/manager/modules/restapi/types/src/main/java/org/ovirt/engine/api/restapi/types/VmMapper.java
+++ 
b/backend/manager/modules/restapi/types/src/main/java/org/ovirt/engine/api/restapi/types/VmMapper.java
@@ -130,6 +130,7 @@
         
staticVm.setSpiceFileTransferEnabled(entity.isSpiceFileTransferEnabled());
         staticVm.setSpiceCopyPasteEnabled(entity.isSpiceCopyPasteEnabled());
         staticVm.setRunAndPause(entity.isRunAndPause());
+        staticVm.setEmulatedMachine(entity.getEmulatedMachine());
         return staticVm;
     }
 
@@ -333,6 +334,10 @@
 
         if (vm.isSetStartPaused()) {
             staticVm.setRunAndPause(vm.isStartPaused());
+        }
+
+        if (vm.isSetCustomEmulatedMachine()) {
+            staticVm.setEmulatedMachine(vm.getCustomEmulatedMachine());
         }
 
         return staticVm;
@@ -578,6 +583,11 @@
         if (entity.getSerialNumberPolicy() != null) {
             
model.setSerialNumber(SerialNumberMapper.map(entity.getStaticData(), null));
         }
+
+        if (entity.getEmulatedMachine() != null) {
+            model.setCustomEmulatedMachine(entity.getEmulatedMachine());
+        }
+
         
model.setNextRunConfigurationExists(entity.isNextRunConfigurationExists());
         model.setNumaTuneMode(map(entity.getNumaTuneMode(), null));
         model.setStartPaused(entity.isRunAndPause());


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

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

Reply via email to