Bug 1013675 - [RFE] In-place transformation of a VM to a Template
[RFE] In-place transformation of a VM to a Template
Product: ovirt-engine
Classification: oVirt
Component: RFEs (Show other bugs)
Unspecified Unspecified
medium Severity medium (vote)
: ---
: ---
Assigned To: Rob Young
: FutureFeature
Depends On:
  Show dependency treegraph
Reported: 2013-09-30 11:03 EDT by Federico Simoncelli
Modified: 2018-01-29 07:32 EST (History)
9 users (show)

See Also:
Fixed In Version:
Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2017-11-16 10:37:51 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: Virt
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
ylavi: ovirt‑future?
rule-engine: planning_ack?
rule-engine: devel_ack?
rule-engine: testing_ack?

Attachments (Terms of Use)

  None (edit)
Description Federico Simoncelli 2013-09-30 11:03:21 EDT
Description of problem:
It should be possible to transform in place a VM to a Template (Make Template).
At the moment the flow for the creation of a new template is:

1. create a new VM
2. install the VM (OS and additional SW), relevant configurations
3. create a Template (Make Template)

During step 3 the disks are copied to different images but in some cases it could be preferable and faster to directly transform the vm in a template (skipping the copy), for example when the orginal vm is not needed anymore as it was created only to generate the template for thin provisioning purpose.
This would be useful for imported disks as well (e.g. from glance) in order to transform them in templates as soon as they're assigned to a new or existing vm.
Comment 1 Itamar Heim 2014-06-22 05:40:42 EDT
oved - how was this resolved in the end for import template from glance to flag as readonly?
Comment 2 Oved Ourfali 2014-06-24 01:05:13 EDT
(In reply to Itamar Heim from comment #1)
> oved - how was this resolved in the end for import template from glance to
> flag as readonly?

Up until now, the only way to create a 'template' disk was by using the
copyImage command.  This has 2 limitations:
1. It forces the user to copy all the data instead of doing an in-place
convert of an image to a template image
2. Resulting image cannot be qcow which is wasteful in some cases

I've sent a patch to address that, and allows using an existing disk as a
template disk, by allowing to "share" a disk that isn't marked as
"shared", but can be shared as it doesn't have snapshots. This disk will
be marked as "shared" upon first use.

So, as far as I understand the only thing that needs to be done is setting it properly on the engine side (marking this VM as a template).
Now, the first time a VM is created from this template the disks will be marked as shared.

However, it will only work in cluster level which is 3.4 or higher, as this code doesn't exist in older versions of VDSM.

Federico - if I wasn't accurate enough in the description above then please correct me.
Comment 6 Yaniv Kaul 2017-11-16 07:57:51 EST
Michal - still relevant?
Comment 7 Michal Skrivanek 2017-11-16 10:37:51 EST
no one seem to request that anymore. After 4 years it seems to be the time to close wontfix

We have virt-sysprep integrated to clean up the (linux) template, but not really without the first step of creating the template

Note You need to log in before you can comment on or make changes to this bug.