Feature #14833
closedAdd oVirt API option to provision VMs to be "Clone/Independent" from their template
Description
Currently, any time I provision a VM in oVirt (3.6.4) from Foreman (1.11), the VM is marked as "Thin/Dependent" upon its source template. This is caused by a disk-related parameter, but it happens even if the source template contains no disks. It would be excellent if an option could be added to Foreman to allow VMs to be provisioned as "Clone/Independent."
The way to make a VM independent of its template is to add the "disks.clone=true" parameter. I've found working examples on how to do this with REST and with the Python SDK, but am not sure how to change the code in Foreman to do so.
I started by trying to add this to app/models/compute_resources/foreman/model/ovirt.rb to no avail.
vm.add_volume({:clone => true, ...
Examples:
In Python:
api.vms.add( params.VM( vmname=VMNAME, memory=MEM*GB, cluster=..., template=..., description=..., disks=params.Disks( clone=True ) ) )
Specifically:
disks=params.Disks( clone=True )
With the REST API (xml):
curl \ --verbose \ --insecure \ --request POST \ --user "${user}:${password}" \ --header "Content-Type: application/xml" \ --header "Accept: application/xml" \ --data " <vm> <name>myvm</name> <cluster> <name>mycluster</name> </cluster> <template> <name>mytemplate</name> </template> <disks> <clone>true</clone> </disks> </vm> " \ "${url}/vms"
Specifically:
<disks> <clone>true</clone> </disks>
Source: http://lists.ovirt.org/pipermail/users/2014-October/028463.html
Rationale:
My VMs don't need to be linked to my templates, as I'm using provisioning, not images, so there's no technical benefit to maintaining the relationship between the VM and its template. I've actually had some issues with disaster recovery, as oVirt has claimed that it couldn't import a VM provisioned in this manner because it couldn't find the linked template.
Any help will be greatly appreciated, and thank you for this amazing tool!
Updated by Dominic Cleal over 8 years ago
- Category set to Compute resources - oVirt
Updated by The Foreman Bot over 6 years ago
- Status changed from New to Ready For Testing
- Assignee set to Daniel Lobato Garcia
- Pull request https://github.com/theforeman/foreman/pull/5656 added
Updated by Ori Rabin over 6 years ago
- Triaged set to No
- Bugzilla link set to 1559006
Updated by The Foreman Bot almost 6 years ago
- Pull request https://github.com/theforeman/foreman/pull/6295 added
Updated by Ori Rabin over 5 years ago
- Status changed from Ready For Testing to Closed
Applied in changeset cdce7a24b5f4868da5e16c1da2dbcb53fa507a0b.