Red Hat Bugzilla – Bug 1013675
[RFE] In-place transformation of a VM to a Template
Last modified: 2018-01-29 07:32:55 EST
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.
oved - how was this resolved in the end for import template from glance to flag as readonly?
(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.
Michal - still relevant?
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