Juan Hernandez has posted comments on this change.

Change subject: restapi: add use_sysprep and use_cloud_init for Vm creation
......................................................................


Patch Set 3:

(1 comment)

https://gerrit.ovirt.org/#/c/40988/3/backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/BackendVmsResource.java
File 
backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/BackendVmsResource.java:

Line 491:     }
Line 492: 
Line 493:     private void setDefaultInitialization(VmStatic staticVm, VM vm) {
Line 494:         if (!Boolean.FALSE.equals(vm.isUseSysprep()) && 
!Boolean.FALSE.equals(vm.isUseCloudInit())) {
Line 495:             // We are setting default initialization for backward 
compatibility
> I think that we need to combine the flags UseSysprep and UseCloudInit to on
The "use_sysprep" and "use_cloud_init" flags should be part of the parameters 
to the "start" action of the VM, not part of the VM itself. This gives the user 
the freedom to start a VM activating sysprep or cloud-init regardless of the OS 
of the VM, should the backend support that.

A flag like "use_initialization" isn't user friendly, as it doesn't clearly 
convey what is the meaning. On the other hand "use_sysprep" and 
"use_cloud_init" are very clear.

I'd also suggest to implement these two ways to start a VM as two different 
operations, instead of one with magic flags:

  POST /vms/{vm:id}/startwithsysprep
  
  POST /vms/{vm:id}/startwithcloudinit

This is even clearer than the flags, and prevents a potential conflict when 
using both:

  POST /vms/{vm:id}/start
  <action>
    <!-- What???? -->
    <use_sysprep>true</use_sysprep>
    <use_cloud_init>true</use_cloudinit>
  </action>
Line 496:             if (staticVm.getVmInit() == null) {
Line 497:                 staticVm.setVmInit(new VmInit());
Line 498:             }
Line 499:         }


-- 
To view, visit https://gerrit.ovirt.org/40988
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Ie712895fa3414e33f0bbd158d79505bbbb5d877b
Gerrit-PatchSet: 3
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Shahar Havivi <shav...@redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Juan Hernandez <juan.hernan...@redhat.com>
Gerrit-Reviewer: Michal Skrivanek <mskri...@redhat.com>
Gerrit-Reviewer: Ori Liel <ol...@redhat.com>
Gerrit-Reviewer: Shahar Havivi <shav...@redhat.com>
Gerrit-Reviewer: automat...@ovirt.org
Gerrit-HasComments: Yes
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to