Project

General

Profile

Actions

Feature #14833

closed

Add oVirt API option to provision VMs to be "Clone/Independent" from their template

Added by Justin Foreman almost 8 years ago. Updated about 5 years ago.

Status:
Closed
Priority:
Normal
Category:
Compute resources - oVirt
Target version:
-
Fixed in Releases:
Found in Releases:

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!

Actions #1

Updated by Dominic Cleal almost 8 years ago

  • Category set to Compute resources - oVirt
Actions #2

Updated by The Foreman Bot almost 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
Actions #3

Updated by Ori Rabin almost 6 years ago

  • Triaged set to No
  • Bugzilla link set to 1559006
Actions #4

Updated by The Foreman Bot over 5 years ago

  • Pull request https://github.com/theforeman/foreman/pull/6295 added
Actions #5

Updated by Shimon Shtein about 5 years ago

  • Fixed in Releases 1.22.0 added
Actions #6

Updated by Ori Rabin about 5 years ago

  • Status changed from Ready For Testing to Closed
Actions

Also available in: Atom PDF