Description of problem: When we have a VM and we start it with API, we can set Initialization type to it. There are flags such as: useCloudInit, useSysprep, useIgnition that will tell the engine which initialization we wish to use. But, in case we don't supply this flag we still wish the initialization will pass, and be determined by the OS type. How reproducible: 100% Steps to Reproduce: 1. Create a VM. 2. Start the VM wish REST-API(SDK) and set the Initialization in it. Actual results: VM doesn't have payload, no initialization in action. Expected results: The VM should have the initialization with it. Additional info: For example to SDK using ignition(python script): connection = sdk.Connection( url='https://<engine-fqdn>/ovirt-engine/api', username=<user>, password=<password, insecure=True, debug=True ) vms_service = connection.system_service().vms_service() ignition=''' { "ignition": { "version": "3.0.0" }, "passwd": { "users": [ { "name": "core", "passwordHash": "$y$j9T$skCa2x5kFis7p58gYjz3C1$ykelHfCckRToZKAVYK7GDdLOCi3pcF2WMioI.vmYkj5" } ] } } ''' vm = vms_service.list(search='name=<vm_name>')[0] vm_service = vms_service.vm_service(vm.id) vm_service.start( vm=types.Vm( initialization=types.Initialization( custom_script=ignition, ) ) ) connection.close()
Changing the bug title. We will have now a generic flag in API. The flag will let the engine decide the initialization type depending on the operation system of the VM. In case the user will run-once with this flag, the VM will have the desired payload.
Verified with: - ovirt-engine-4.3.9.4-11.el7.noarch - ovirt-engine-restapi-4.3.9.4-11.el7.noarch - libvirt-4.5.0-33.el7.x86_64 (host) - vdsm-4.30.43-1.el7ev.x86_64 (host) - cloud-init-18.5-7.el8.noarch (vm) Verification steps: curl -k --location --request POST 'https://<ENGINE_FQDN>/ovirt-engine/api/vms/<VM_ID>/start' \ --header 'Content-Type: application/xml' \ --user '<USER>:<PASS>' \ --data-raw '<action> <use_initialization>true</use_initialization> <vm> <initialization> <host_name>test_hostname</host_name> <timezone>NZ</timezone> <user_name>test_user</user_name> <root_password>654321</root_password> </initialization> </vm> </action>' Result: - The VM is up and running with the initialization parameters (Hostname, TZ, u/p)
This bugzilla is included in oVirt 4.3.9 release, published on March 20th 2020. Since the problem described in this bug report should be resolved in oVirt 4.3.9 release, it has been closed with a resolution of CURRENT RELEASE. If the solution does not work for you, please open a new bug report.