Discussion:
KVM NFS template image
ran huang
2018-11-16 21:38:50 UTC
Permalink
Greetings All,

For qcow2 format images, when creating a new VM in KVM, the template
image is copied from secondary storage to primary storage, and the root
volume image is created with the template image as a backing file.

But when I break this backing chain on primary(expunge VM or revert to a
snapshot previously created on the root volume image), the template
image is not deleted.

Might I ask how is the template image going to be cleaned from the
primary storage?


addendum:
CS ver 4.9.2 on CentOS 7.2

regards,
Ran
Andrija Panic
2018-11-16 22:15:19 UTC
Permalink
Hi Ran,

templates stays on Primary Storage "forever", at least for NFS (they are
moved from Secondary to Primary when you deploy a very first VM from
specific template). All VMs have this templates qcow2 as baking (parent)
image.

This template is a qcow2 copy of a file from Secondary Storage - and is
considered a "parent" image, from which all child images (VM volumes) are
created - as you stated baking file (qcow linked clones, in official
terminology)

you can have i.e. 100 VMs all linking (having it's backing file...) to a
template qcow2 file.
So in other words, it's not supposed to be removed.

Does this make sense?

Cheers
Post by ran huang
Greetings All,
For qcow2 format images, when creating a new VM in KVM, the template
image is copied from secondary storage to primary storage, and the root
volume image is created with the template image as a backing file.
But when I break this backing chain on primary(expunge VM or revert to a
snapshot previously created on the root volume image), the template
image is not deleted.
Might I ask how is the template image going to be cleaned from the
primary storage?
CS ver 4.9.2 on CentOS 7.2
regards,
Ran
--
Andrija Panić
ran huang
2018-11-16 22:51:42 UTC
Permalink
Hi Andrija,

Thanks for the clarification and quick response

regards,
Ran
Post by Andrija Panic
Hi Ran,
templates stays on Primary Storage "forever", at least for NFS (they are
moved from Secondary to Primary when you deploy a very first VM from
specific template). All VMs have this templates qcow2 as baking (parent)
image.
This template is a qcow2 copy of a file from Secondary Storage - and is
considered a "parent" image, from which all child images (VM volumes) are
created - as you stated baking file (qcow linked clones, in official
terminology)
you can have i.e. 100 VMs all linking (having it's backing file...) to a
template qcow2 file.
So in other words, it's not supposed to be removed.
Does this make sense?
Cheers
Post by ran huang
Greetings All,
For qcow2 format images, when creating a new VM in KVM, the template
image is copied from secondary storage to primary storage, and the root
volume image is created with the template image as a backing file.
But when I break this backing chain on primary(expunge VM or revert to a
snapshot previously created on the root volume image), the template
image is not deleted.
Might I ask how is the template image going to be cleaned from the
primary storage?
CS ver 4.9.2 on CentOS 7.2
regards,
Ran
Dag Sonstebo
2018-11-19 17:50:48 UTC
Permalink
Developers please correct me... but as far as I remember there is a garbage collector which does remove the templates from primary storage once they are not needed (i.e. have no more "child VMs"). This is controlled by the global setting "storage.template.cleanup.enabled".

Regards,
Dag Sonstebo
Cloud Architect
ShapeBlue


On 16/11/2018, 22:51, "ran huang" <***@gmail.com> wrote:

Hi Andrija,

Thanks for the clarification and quick response

regards,
Ran
Post by Andrija Panic
Hi Ran,
templates stays on Primary Storage "forever", at least for NFS (they are
moved from Secondary to Primary when you deploy a very first VM from
specific template). All VMs have this templates qcow2 as baking (parent)
image.
This template is a qcow2 copy of a file from Secondary Storage - and is
considered a "parent" image, from which all child images (VM volumes) are
created - as you stated baking file (qcow linked clones, in official
terminology)
you can have i.e. 100 VMs all linking (having it's backing file...) to a
template qcow2 file.
So in other words, it's not supposed to be removed.
Does this make sense?
Cheers
***@shapeblue.com 
www.shapeblue.com
Amadeus House, Floral Street, London WC2E 9DPUK
@shapeblue
Post by Andrija Panic
Post by ran huang
Greetings All,
For qcow2 format images, when creating a new VM in KVM, the template
image is copied from secondary storage to primary storage, and the root
volume image is created with the template image as a backing file.
But when I break this backing chain on primary(expunge VM or revert to a
snapshot previously created on the root volume image), the template
image is not deleted.
Might I ask how is the template image going to be cleaned from the
primary storage?
CS ver 4.9.2 on CentOS 7.2
regards,
Andrija Panic
2018-11-19 18:11:15 UTC
Permalink
True (at least I'm sure for SolidFire) - but I believe in general also
(will test this now...)
Post by Dag Sonstebo
Developers please correct me... but as far as I remember there is a
garbage collector which does remove the templates from primary storage once
they are not needed (i.e. have no more "child VMs"). This is controlled by
the global setting "storage.template.cleanup.enabled".
Regards,
Dag Sonstebo
Cloud Architect
ShapeBlue
Hi Andrija,
Thanks for the clarification and quick response
regards,
Ran
Post by Andrija Panic
Hi Ran,
templates stays on Primary Storage "forever", at least for NFS (they
are
Post by Andrija Panic
moved from Secondary to Primary when you deploy a very first VM from
specific template). All VMs have this templates qcow2 as baking
(parent)
Post by Andrija Panic
image.
This template is a qcow2 copy of a file from Secondary Storage - and
is
Post by Andrija Panic
considered a "parent" image, from which all child images (VM
volumes) are
Post by Andrija Panic
created - as you stated baking file (qcow linked clones, in official
terminology)
you can have i.e. 100 VMs all linking (having it's backing file...)
to a
Post by Andrija Panic
template qcow2 file.
So in other words, it's not supposed to be removed.
Does this make sense?
Cheers
www.shapeblue.com
Amadeus House, Floral Street, London WC2E 9DPUK
@shapeblue
Post by Andrija Panic
Post by ran huang
Greetings All,
For qcow2 format images, when creating a new VM in KVM, the template
image is copied from secondary storage to primary storage, and the
root
Post by Andrija Panic
Post by ran huang
volume image is created with the template image as a backing file.
But when I break this backing chain on primary(expunge VM or revert
to a
Post by Andrija Panic
Post by ran huang
snapshot previously created on the root volume image), the template
image is not deleted.
Might I ask how is the template image going to be cleaned from the
primary storage?
CS ver 4.9.2 on CentOS 7.2
regards,
Ran
--
Andrija Panić
Andrija Panic
2018-11-19 18:43:02 UTC
Permalink
new template, deployed new VM, destroyed VM (with Exunge option)...

up to 120sec later... (storage.cleanup.interval=120 sec, global config
option)

2018-11-19 19:35:59,525 DEBUGStorage pool garbage collector found 1
templates to clean up in storage pool: Primary-storage - NFS
2018-11-19 19:35:59,525 DEBUG [c.c.s.StorageManagerImpl]
(StorageManager-Scavenger-1:ctx-2c88c8e0) (logid:040f4ad1) Storage pool
garbage collector has marked template with ID: 219 on pool 4 for garbage
collection

Another 120sec later... (storage.cleanup.delay=120sec)

2018-11-19 19:37:59,598 DEBUG [c.c.s.StorageManagerImpl]
(StorageManager-Scavenger-2:ctx-f9dd338d) (logid:9ae40975) Storage pool
garbage collector found 1 templates to clean up in storage pool:
Primary-storage - NFS
...
2018-11-19 19:37:59,638 DEBUG [c.c.t.TemplateManagerImpl]
(StorageManager-Scavenger-2:ctx-f9dd338d) (logid:9ae40975) Evicting
TmplPool[37-219-4-563ea0f5-5164-4ac4-a183-728f418269b7]
2018-11-19 19:37:59,643 DEBUG [c.c.h.o.r.Ovm3HypervisorGuru]
(StorageManager-Scavenger-2:ctx-f9dd338d) (logid:9ae40975)
getCommandHostDelegation: class com.cloud.agent.api.storage.DestroyCommand
...
2018-11-19 19:37:59,665 DEBUG [c.c.t.TemplateManagerImpl]
(StorageManager-Scavenger-2:ctx-f9dd338d) (logid:9ae40975) Successfully
evicted template andrija-test-tmpl from storage pool null

template "andrija-test-tmpl" deleted...

Hope that helps Run.

Cheers
Andrija
Post by Andrija Panic
True (at least I'm sure for SolidFire) - but I believe in general also
(will test this now...)
Post by Dag Sonstebo
Developers please correct me... but as far as I remember there is a
garbage collector which does remove the templates from primary storage once
they are not needed (i.e. have no more "child VMs"). This is controlled by
the global setting "storage.template.cleanup.enabled".
Regards,
Dag Sonstebo
Cloud Architect
ShapeBlue
Hi Andrija,
Thanks for the clarification and quick response
regards,
Ran
Post by Andrija Panic
Hi Ran,
templates stays on Primary Storage "forever", at least for NFS
(they are
Post by Andrija Panic
moved from Secondary to Primary when you deploy a very first VM from
specific template). All VMs have this templates qcow2 as baking
(parent)
Post by Andrija Panic
image.
This template is a qcow2 copy of a file from Secondary Storage -
and is
Post by Andrija Panic
considered a "parent" image, from which all child images (VM
volumes) are
Post by Andrija Panic
created - as you stated baking file (qcow linked clones, in official
terminology)
you can have i.e. 100 VMs all linking (having it's backing file...)
to a
Post by Andrija Panic
template qcow2 file.
So in other words, it's not supposed to be removed.
Does this make sense?
Cheers
www.shapeblue.com
Amadeus House, Floral Street, London WC2E 9DPUK
@shapeblue
Post by Andrija Panic
Post by ran huang
Greetings All,
For qcow2 format images, when creating a new VM in KVM, the
template
Post by Andrija Panic
Post by ran huang
image is copied from secondary storage to primary storage, and the
root
Post by Andrija Panic
Post by ran huang
volume image is created with the template image as a backing file.
But when I break this backing chain on primary(expunge VM or
revert to a
Post by Andrija Panic
Post by ran huang
snapshot previously created on the root volume image), the template
image is not deleted.
Might I ask how is the template image going to be cleaned from the
primary storage?
CS ver 4.9.2 on CentOS 7.2
regards,
Ran
--
Andrija Panić
--
Andrija Panić
ran huang
2018-11-22 20:18:04 UTC
Permalink
Thanks Andrija, just tested myself with expunge and works as expected.

However, for KVM, when I revert a qcow disk from snapshot, which removes
the backing chain to template, the template will not be removed.

So it seems like despite the qcow disk is no longer backed by the
template, the template will still consider the disk as its children in
this case(revert from snapshot).

regards,
Ran
Post by Andrija Panic
new template, deployed new VM, destroyed VM (with Exunge option)...
up to 120sec later... (storage.cleanup.interval=120 sec, global config
option)
2018-11-19 19:35:59,525 DEBUGStorage pool garbage collector found 1
templates to clean up in storage pool: Primary-storage - NFS
2018-11-19 19:35:59,525 DEBUG [c.c.s.StorageManagerImpl]
(StorageManager-Scavenger-1:ctx-2c88c8e0) (logid:040f4ad1) Storage pool
garbage collector has marked template with ID: 219 on pool 4 for garbage
collection
Another 120sec later... (storage.cleanup.delay=120sec)
2018-11-19 19:37:59,598 DEBUG [c.c.s.StorageManagerImpl]
(StorageManager-Scavenger-2:ctx-f9dd338d) (logid:9ae40975) Storage pool
Primary-storage - NFS
...
2018-11-19 19:37:59,638 DEBUG [c.c.t.TemplateManagerImpl]
(StorageManager-Scavenger-2:ctx-f9dd338d) (logid:9ae40975) Evicting
TmplPool[37-219-4-563ea0f5-5164-4ac4-a183-728f418269b7]
2018-11-19 19:37:59,643 DEBUG [c.c.h.o.r.Ovm3HypervisorGuru]
(StorageManager-Scavenger-2:ctx-f9dd338d) (logid:9ae40975)
getCommandHostDelegation: class com.cloud.agent.api.storage.DestroyCommand
...
2018-11-19 19:37:59,665 DEBUG [c.c.t.TemplateManagerImpl]
(StorageManager-Scavenger-2:ctx-f9dd338d) (logid:9ae40975) Successfully
evicted template andrija-test-tmpl from storage pool null
template "andrija-test-tmpl" deleted...
Hope that helps Run.
Cheers
Andrija
Post by Andrija Panic
True (at least I'm sure for SolidFire) - but I believe in general also
(will test this now...)
Post by Dag Sonstebo
Developers please correct me... but as far as I remember there is a
garbage collector which does remove the templates from primary storage once
they are not needed (i.e. have no more "child VMs"). This is controlled by
the global setting "storage.template.cleanup.enabled".
Regards,
Dag Sonstebo
Cloud Architect
ShapeBlue
Hi Andrija,
Thanks for the clarification and quick response
regards,
Ran
Post by Andrija Panic
Hi Ran,
templates stays on Primary Storage "forever", at least for NFS
(they are
Post by Andrija Panic
moved from Secondary to Primary when you deploy a very first VM from
specific template). All VMs have this templates qcow2 as baking
(parent)
Post by Andrija Panic
image.
This template is a qcow2 copy of a file from Secondary Storage -
and is
Post by Andrija Panic
considered a "parent" image, from which all child images (VM
volumes) are
Post by Andrija Panic
created - as you stated baking file (qcow linked clones, in official
terminology)
you can have i.e. 100 VMs all linking (having it's backing file...)
to a
Post by Andrija Panic
template qcow2 file.
So in other words, it's not supposed to be removed.
Does this make sense?
Cheers
www.shapeblue.com
Amadeus House, Floral Street, London WC2E 9DPUK
@shapeblue
Post by Andrija Panic
Post by ran huang
Greetings All,
For qcow2 format images, when creating a new VM in KVM, the
template
Post by Andrija Panic
Post by ran huang
image is copied from secondary storage to primary storage, and the
root
Post by Andrija Panic
Post by ran huang
volume image is created with the template image as a backing file.
But when I break this backing chain on primary(expunge VM or
revert to a
Post by Andrija Panic
Post by ran huang
snapshot previously created on the root volume image), the template
image is not deleted.
Might I ask how is the template image going to be cleaned from the
primary storage?
CS ver 4.9.2 on CentOS 7.2
regards,
Ran
--
Andrija Panić
Andrija Panic
2018-11-22 20:53:48 UTC
Permalink
Hi Run,

not sure what you mean (I did not quite understand your explanation) - but
here is an exercise from my side (just done it):

Loading Image...

Check the image - explanation below:


Centos55 minimal (builtin) template, spin new VM:
--- new volume created with UUID/PATH (name on NFS files
system): 021e8602-235b-4e0d-b9e4-04f0ff46399f
--it's backing file: backing file:
/mnt/63a3ae7b-9ea9-3884-a772-1ea939ef6ec3/93682641-e7f6-11e8-8f64-089e01d943be

Create snapshots via GUI - there is qcow2 snapshots created, whole snapshot
copied over (converted via qemu-img - "ps aux | grep qemu-img") tool to
Secondary NFS Storage - and snapshot REMOVED from original volume on
Primary NFS Storage (qemu-img snapshot -l
021e8602-235b-4e0d-b9e4-04f0ff46399f shows zero snaps after ACS has
finished creating snapshots)
Volume still points to it's backing file - no changes so far (as expected)

Then I restore volume from snapshots.
CloudStack will (my conclusions from the exercise), remove original volume
on NFS Primary Storage (021e8602-235b-4e0d-b9e4-04f0ff46399f), then it will
copy back (convert via qemu-img) a qcow2 file from Secondary Storage back
to Primary Storage - but it will use SAME NAME, so you again see
021e8602-235b-4e0d-b9e4-04f0ff46399f on your NFS mount point.

This time when you check the image with qemu-img info - it will show it has
NO backing file at all - since it's brand new volume/qcow2 image created
(as a copy fom Secondary Storage)

that is how it works

I assume the template will be again cleaned-up/removed from Primary Storage
if no other VMs/volume use it as it's backing (parent) image.

Makes sense ?

Cheers
Post by ran huang
Thanks Andrija, just tested myself with expunge and works as expected.
However, for KVM, when I revert a qcow disk from snapshot, which removes
the backing chain to template, the template will not be removed.
So it seems like despite the qcow disk is no longer backed by the
template, the template will still consider the disk as its children in
this case(revert from snapshot).
regards,
Ran
Post by Andrija Panic
new template, deployed new VM, destroyed VM (with Exunge option)...
up to 120sec later... (storage.cleanup.interval=120 sec, global config
option)
2018-11-19 19:35:59,525 DEBUGStorage pool garbage collector found 1
templates to clean up in storage pool: Primary-storage - NFS
2018-11-19 19:35:59,525 DEBUG [c.c.s.StorageManagerImpl]
(StorageManager-Scavenger-1:ctx-2c88c8e0) (logid:040f4ad1) Storage pool
garbage collector has marked template with ID: 219 on pool 4 for garbage
collection
Another 120sec later... (storage.cleanup.delay=120sec)
2018-11-19 19:37:59,598 DEBUG [c.c.s.StorageManagerImpl]
(StorageManager-Scavenger-2:ctx-f9dd338d) (logid:9ae40975) Storage pool
Primary-storage - NFS
...
2018-11-19 19:37:59,638 DEBUG [c.c.t.TemplateManagerImpl]
(StorageManager-Scavenger-2:ctx-f9dd338d) (logid:9ae40975) Evicting
TmplPool[37-219-4-563ea0f5-5164-4ac4-a183-728f418269b7]
2018-11-19 19:37:59,643 DEBUG [c.c.h.o.r.Ovm3HypervisorGuru]
(StorageManager-Scavenger-2:ctx-f9dd338d) (logid:9ae40975)
getCommandHostDelegation: class
com.cloud.agent.api.storage.DestroyCommand
Post by Andrija Panic
...
2018-11-19 19:37:59,665 DEBUG [c.c.t.TemplateManagerImpl]
(StorageManager-Scavenger-2:ctx-f9dd338d) (logid:9ae40975) Successfully
evicted template andrija-test-tmpl from storage pool null
template "andrija-test-tmpl" deleted...
Hope that helps Run.
Cheers
Andrija
Post by Andrija Panic
True (at least I'm sure for SolidFire) - but I believe in general also
(will test this now...)
Post by Dag Sonstebo
Developers please correct me... but as far as I remember there is a
garbage collector which does remove the templates from primary storage
once
Post by Andrija Panic
Post by Andrija Panic
Post by Dag Sonstebo
they are not needed (i.e. have no more "child VMs"). This is
controlled by
Post by Andrija Panic
Post by Andrija Panic
Post by Dag Sonstebo
the global setting "storage.template.cleanup.enabled".
Regards,
Dag Sonstebo
Cloud Architect
ShapeBlue
Hi Andrija,
Thanks for the clarification and quick response
regards,
Ran
Post by Andrija Panic
Hi Ran,
templates stays on Primary Storage "forever", at least for NFS
(they are
Post by Andrija Panic
moved from Secondary to Primary when you deploy a very first VM
from
Post by Andrija Panic
Post by Andrija Panic
Post by Dag Sonstebo
Post by Andrija Panic
specific template). All VMs have this templates qcow2 as baking
(parent)
Post by Andrija Panic
image.
This template is a qcow2 copy of a file from Secondary Storage -
and is
Post by Andrija Panic
considered a "parent" image, from which all child images (VM
volumes) are
Post by Andrija Panic
created - as you stated baking file (qcow linked clones, in
official
Post by Andrija Panic
Post by Andrija Panic
Post by Dag Sonstebo
Post by Andrija Panic
terminology)
you can have i.e. 100 VMs all linking (having it's backing
file...)
Post by Andrija Panic
Post by Andrija Panic
Post by Dag Sonstebo
to a
Post by Andrija Panic
template qcow2 file.
So in other words, it's not supposed to be removed.
Does this make sense?
Cheers
www.shapeblue.com
Amadeus House, Floral Street, London WC2E 9DPUK
@shapeblue
Post by Andrija Panic
Post by ran huang
Greetings All,
For qcow2 format images, when creating a new VM in KVM, the
template
Post by Andrija Panic
Post by ran huang
image is copied from secondary storage to primary storage, and
the
Post by Andrija Panic
Post by Andrija Panic
Post by Dag Sonstebo
root
Post by Andrija Panic
Post by ran huang
volume image is created with the template image as a backing
file.
Post by Andrija Panic
Post by Andrija Panic
Post by Dag Sonstebo
Post by Andrija Panic
Post by ran huang
But when I break this backing chain on primary(expunge VM or
revert to a
Post by Andrija Panic
Post by ran huang
snapshot previously created on the root volume image), the
template
Post by Andrija Panic
Post by Andrija Panic
Post by Dag Sonstebo
Post by Andrija Panic
Post by ran huang
image is not deleted.
Might I ask how is the template image going to be cleaned from
the
Post by Andrija Panic
Post by Andrija Panic
Post by Dag Sonstebo
Post by Andrija Panic
Post by ran huang
primary storage?
CS ver 4.9.2 on CentOS 7.2
regards,
Ran
--
Andrija Panić
--
Andrija Panić
Ivan Kudryavtsev
2018-11-22 21:26:58 UTC
Permalink
Looks like a bug (missing processing case).
Post by Andrija Panic
Hi Run,
not sure what you mean (I did not quite understand your explanation) - but
https://pasteboard.co/HOowNao.png
--- new volume created with UUID/PATH (name on NFS files
system): 021e8602-235b-4e0d-b9e4-04f0ff46399f
/mnt/63a3ae7b-9ea9-3884-a772-1ea939ef6ec3/93682641-e7f6-11e8-8f64-089e01d943be
Create snapshots via GUI - there is qcow2 snapshots created, whole snapshot
copied over (converted via qemu-img - "ps aux | grep qemu-img") tool to
Secondary NFS Storage - and snapshot REMOVED from original volume on
Primary NFS Storage (qemu-img snapshot -l
021e8602-235b-4e0d-b9e4-04f0ff46399f shows zero snaps after ACS has
finished creating snapshots)
Volume still points to it's backing file - no changes so far (as expected)
Then I restore volume from snapshots.
CloudStack will (my conclusions from the exercise), remove original volume
on NFS Primary Storage (021e8602-235b-4e0d-b9e4-04f0ff46399f), then it will
copy back (convert via qemu-img) a qcow2 file from Secondary Storage back
to Primary Storage - but it will use SAME NAME, so you again see
021e8602-235b-4e0d-b9e4-04f0ff46399f on your NFS mount point.
This time when you check the image with qemu-img info - it will show it has
NO backing file at all - since it's brand new volume/qcow2 image created
(as a copy fom Secondary Storage)
that is how it works
I assume the template will be again cleaned-up/removed from Primary Storage
if no other VMs/volume use it as it's backing (parent) image.
Makes sense ?
Cheers
Post by ran huang
Thanks Andrija, just tested myself with expunge and works as expected.
However, for KVM, when I revert a qcow disk from snapshot, which removes
the backing chain to template, the template will not be removed.
So it seems like despite the qcow disk is no longer backed by the
template, the template will still consider the disk as its children in
this case(revert from snapshot).
regards,
Ran
Post by Andrija Panic
new template, deployed new VM, destroyed VM (with Exunge option)...
up to 120sec later... (storage.cleanup.interval=120 sec, global config
option)
2018-11-19 19:35:59,525 DEBUGStorage pool garbage collector found 1
templates to clean up in storage pool: Primary-storage - NFS
2018-11-19 19:35:59,525 DEBUG [c.c.s.StorageManagerImpl]
(StorageManager-Scavenger-1:ctx-2c88c8e0) (logid:040f4ad1) Storage pool
garbage collector has marked template with ID: 219 on pool 4 for
garbage
Post by ran huang
Post by Andrija Panic
collection
Another 120sec later... (storage.cleanup.delay=120sec)
2018-11-19 19:37:59,598 DEBUG [c.c.s.StorageManagerImpl]
(StorageManager-Scavenger-2:ctx-f9dd338d) (logid:9ae40975) Storage pool
Primary-storage - NFS
...
2018-11-19 19:37:59,638 DEBUG [c.c.t.TemplateManagerImpl]
(StorageManager-Scavenger-2:ctx-f9dd338d) (logid:9ae40975) Evicting
TmplPool[37-219-4-563ea0f5-5164-4ac4-a183-728f418269b7]
2018-11-19 19:37:59,643 DEBUG [c.c.h.o.r.Ovm3HypervisorGuru]
(StorageManager-Scavenger-2:ctx-f9dd338d) (logid:9ae40975)
getCommandHostDelegation: class
com.cloud.agent.api.storage.DestroyCommand
Post by Andrija Panic
...
2018-11-19 19:37:59,665 DEBUG [c.c.t.TemplateManagerImpl]
(StorageManager-Scavenger-2:ctx-f9dd338d) (logid:9ae40975) Successfully
evicted template andrija-test-tmpl from storage pool null
template "andrija-test-tmpl" deleted...
Hope that helps Run.
Cheers
Andrija
Post by Andrija Panic
True (at least I'm sure for SolidFire) - but I believe in general also
(will test this now...)
On Mon, 19 Nov 2018 at 18:51, Dag Sonstebo <
Post by Dag Sonstebo
Developers please correct me... but as far as I remember there is a
garbage collector which does remove the templates from primary
storage
Post by ran huang
once
Post by Andrija Panic
Post by Andrija Panic
Post by Dag Sonstebo
they are not needed (i.e. have no more "child VMs"). This is
controlled by
Post by Andrija Panic
Post by Andrija Panic
Post by Dag Sonstebo
the global setting "storage.template.cleanup.enabled".
Regards,
Dag Sonstebo
Cloud Architect
ShapeBlue
Hi Andrija,
Thanks for the clarification and quick response
regards,
Ran
Post by Andrija Panic
Hi Ran,
templates stays on Primary Storage "forever", at least for NFS
(they are
Post by Andrija Panic
moved from Secondary to Primary when you deploy a very first
VM
Post by ran huang
from
Post by Andrija Panic
Post by Andrija Panic
Post by Dag Sonstebo
Post by Andrija Panic
specific template). All VMs have this templates qcow2 as
baking
Post by ran huang
Post by Andrija Panic
Post by Andrija Panic
Post by Dag Sonstebo
(parent)
Post by Andrija Panic
image.
This template is a qcow2 copy of a file from Secondary
Storage -
Post by ran huang
Post by Andrija Panic
Post by Andrija Panic
Post by Dag Sonstebo
and is
Post by Andrija Panic
considered a "parent" image, from which all child images (VM
volumes) are
Post by Andrija Panic
created - as you stated baking file (qcow linked clones, in
official
Post by Andrija Panic
Post by Andrija Panic
Post by Dag Sonstebo
Post by Andrija Panic
terminology)
you can have i.e. 100 VMs all linking (having it's backing
file...)
Post by Andrija Panic
Post by Andrija Panic
Post by Dag Sonstebo
to a
Post by Andrija Panic
template qcow2 file.
So in other words, it's not supposed to be removed.
Does this make sense?
Cheers
www.shapeblue.com
Amadeus House, Floral Street, London WC2E 9DPUK
@shapeblue
Post by Andrija Panic
Post by ran huang
Greetings All,
For qcow2 format images, when creating a new VM in KVM, the
template
Post by Andrija Panic
Post by ran huang
image is copied from secondary storage to primary storage,
and
Post by ran huang
the
Post by Andrija Panic
Post by Andrija Panic
Post by Dag Sonstebo
root
Post by Andrija Panic
Post by ran huang
volume image is created with the template image as a backing
file.
Post by Andrija Panic
Post by Andrija Panic
Post by Dag Sonstebo
Post by Andrija Panic
Post by ran huang
But when I break this backing chain on primary(expunge VM or
revert to a
Post by Andrija Panic
Post by ran huang
snapshot previously created on the root volume image), the
template
Post by Andrija Panic
Post by Andrija Panic
Post by Dag Sonstebo
Post by Andrija Panic
Post by ran huang
image is not deleted.
Might I ask how is the template image going to be cleaned
from
Post by ran huang
the
Post by Andrija Panic
Post by Andrija Panic
Post by Dag Sonstebo
Post by Andrija Panic
Post by ran huang
primary storage?
CS ver 4.9.2 on CentOS 7.2
regards,
Ran
--
Andrija Panić
--
Andrija Panić
ran huang
2018-11-22 21:28:55 UTC
Permalink
Hi Andrija,

That is precisely the step I went through.

However the template was not cleaned up after expected interval when no
other volume have it as a backing image.

regards,
Ran
Post by Andrija Panic
Hi Run,
not sure what you mean (I did not quite understand your explanation) - but
https://pasteboard.co/HOowNao.png
--- new volume created with UUID/PATH (name on NFS files
system): 021e8602-235b-4e0d-b9e4-04f0ff46399f
/mnt/63a3ae7b-9ea9-3884-a772-1ea939ef6ec3/93682641-e7f6-11e8-8f64-089e01d943be
Create snapshots via GUI - there is qcow2 snapshots created, whole snapshot
copied over (converted via qemu-img - "ps aux | grep qemu-img") tool to
Secondary NFS Storage - and snapshot REMOVED from original volume on
Primary NFS Storage (qemu-img snapshot -l
021e8602-235b-4e0d-b9e4-04f0ff46399f shows zero snaps after ACS has
finished creating snapshots)
Volume still points to it's backing file - no changes so far (as expected)
Then I restore volume from snapshots.
CloudStack will (my conclusions from the exercise), remove original volume
on NFS Primary Storage (021e8602-235b-4e0d-b9e4-04f0ff46399f), then it will
copy back (convert via qemu-img) a qcow2 file from Secondary Storage back
to Primary Storage - but it will use SAME NAME, so you again see
021e8602-235b-4e0d-b9e4-04f0ff46399f on your NFS mount point.
This time when you check the image with qemu-img info - it will show it has
NO backing file at all - since it's brand new volume/qcow2 image created
(as a copy fom Secondary Storage)
that is how it works
I assume the template will be again cleaned-up/removed from Primary Storage
if no other VMs/volume use it as it's backing (parent) image.
Makes sense ?
Cheers
Post by ran huang
Thanks Andrija, just tested myself with expunge and works as expected.
However, for KVM, when I revert a qcow disk from snapshot, which removes
the backing chain to template, the template will not be removed.
So it seems like despite the qcow disk is no longer backed by the
template, the template will still consider the disk as its children in
this case(revert from snapshot).
regards,
Ran
Post by Andrija Panic
new template, deployed new VM, destroyed VM (with Exunge option)...
up to 120sec later... (storage.cleanup.interval=120 sec, global config
option)
2018-11-19 19:35:59,525 DEBUGStorage pool garbage collector found 1
templates to clean up in storage pool: Primary-storage - NFS
2018-11-19 19:35:59,525 DEBUG [c.c.s.StorageManagerImpl]
(StorageManager-Scavenger-1:ctx-2c88c8e0) (logid:040f4ad1) Storage pool
garbage collector has marked template with ID: 219 on pool 4 for garbage
collection
Another 120sec later... (storage.cleanup.delay=120sec)
2018-11-19 19:37:59,598 DEBUG [c.c.s.StorageManagerImpl]
(StorageManager-Scavenger-2:ctx-f9dd338d) (logid:9ae40975) Storage pool
Primary-storage - NFS
...
2018-11-19 19:37:59,638 DEBUG [c.c.t.TemplateManagerImpl]
(StorageManager-Scavenger-2:ctx-f9dd338d) (logid:9ae40975) Evicting
TmplPool[37-219-4-563ea0f5-5164-4ac4-a183-728f418269b7]
2018-11-19 19:37:59,643 DEBUG [c.c.h.o.r.Ovm3HypervisorGuru]
(StorageManager-Scavenger-2:ctx-f9dd338d) (logid:9ae40975)
getCommandHostDelegation: class
com.cloud.agent.api.storage.DestroyCommand
Post by Andrija Panic
...
2018-11-19 19:37:59,665 DEBUG [c.c.t.TemplateManagerImpl]
(StorageManager-Scavenger-2:ctx-f9dd338d) (logid:9ae40975) Successfully
evicted template andrija-test-tmpl from storage pool null
template "andrija-test-tmpl" deleted...
Hope that helps Run.
Cheers
Andrija
Post by Andrija Panic
True (at least I'm sure for SolidFire) - but I believe in general also
(will test this now...)
Post by Dag Sonstebo
Developers please correct me... but as far as I remember there is a
garbage collector which does remove the templates from primary storage
once
Post by Andrija Panic
Post by Andrija Panic
Post by Dag Sonstebo
they are not needed (i.e. have no more "child VMs"). This is
controlled by
Post by Andrija Panic
Post by Andrija Panic
Post by Dag Sonstebo
the global setting "storage.template.cleanup.enabled".
Regards,
Dag Sonstebo
Cloud Architect
ShapeBlue
Hi Andrija,
Thanks for the clarification and quick response
regards,
Ran
Post by Andrija Panic
Hi Ran,
templates stays on Primary Storage "forever", at least for NFS
(they are
Post by Andrija Panic
moved from Secondary to Primary when you deploy a very first VM
from
Post by Andrija Panic
Post by Andrija Panic
Post by Dag Sonstebo
Post by Andrija Panic
specific template). All VMs have this templates qcow2 as baking
(parent)
Post by Andrija Panic
image.
This template is a qcow2 copy of a file from Secondary Storage -
and is
Post by Andrija Panic
considered a "parent" image, from which all child images (VM
volumes) are
Post by Andrija Panic
created - as you stated baking file (qcow linked clones, in
official
Post by Andrija Panic
Post by Andrija Panic
Post by Dag Sonstebo
Post by Andrija Panic
terminology)
you can have i.e. 100 VMs all linking (having it's backing
file...)
Post by Andrija Panic
Post by Andrija Panic
Post by Dag Sonstebo
to a
Post by Andrija Panic
template qcow2 file.
So in other words, it's not supposed to be removed.
Does this make sense?
Cheers
www.shapeblue.com
Amadeus House, Floral Street, London WC2E 9DPUK
@shapeblue
Post by Andrija Panic
Post by ran huang
Greetings All,
For qcow2 format images, when creating a new VM in KVM, the
template
Post by Andrija Panic
Post by ran huang
image is copied from secondary storage to primary storage, and
the
Post by Andrija Panic
Post by Andrija Panic
Post by Dag Sonstebo
root
Post by Andrija Panic
Post by ran huang
volume image is created with the template image as a backing
file.
Post by Andrija Panic
Post by Andrija Panic
Post by Dag Sonstebo
Post by Andrija Panic
Post by ran huang
But when I break this backing chain on primary(expunge VM or
revert to a
Post by Andrija Panic
Post by ran huang
snapshot previously created on the root volume image), the
template
Post by Andrija Panic
Post by Andrija Panic
Post by Dag Sonstebo
Post by Andrija Panic
Post by ran huang
image is not deleted.
Might I ask how is the template image going to be cleaned from
the
Post by Andrija Panic
Post by Andrija Panic
Post by Dag Sonstebo
Post by Andrija Panic
Post by ran huang
primary storage?
CS ver 4.9.2 on CentOS 7.2
regards,
Ran
--
Andrija Panić
Andrija Panic
2018-11-22 22:25:50 UTC
Permalink
I confirm bug...tmpl not removed...

And I confirm a possible solution:

"volumes" table, field "template_id" should be set to NULL for this
particular volume, after volume restored from snapshot - on next storage
scavenger run it will be marked properly for GC and removed...
(volumes of VM deployed from ISO file, also have NULL for "template_id"
filed"
Post by ran huang
Hi Andrija,
That is precisely the step I went through.
However the template was not cleaned up after expected interval when no
other volume have it as a backing image.
regards,
Ran
Post by Andrija Panic
Hi Run,
not sure what you mean (I did not quite understand your explanation) -
but
Post by Andrija Panic
https://pasteboard.co/HOowNao.png
--- new volume created with UUID/PATH (name on NFS files
system): 021e8602-235b-4e0d-b9e4-04f0ff46399f
/mnt/63a3ae7b-9ea9-3884-a772-1ea939ef6ec3/93682641-e7f6-11e8-8f64-089e01d943be
Post by Andrija Panic
Create snapshots via GUI - there is qcow2 snapshots created, whole
snapshot
Post by Andrija Panic
copied over (converted via qemu-img - "ps aux | grep qemu-img") tool to
Secondary NFS Storage - and snapshot REMOVED from original volume on
Primary NFS Storage (qemu-img snapshot -l
021e8602-235b-4e0d-b9e4-04f0ff46399f shows zero snaps after ACS has
finished creating snapshots)
Volume still points to it's backing file - no changes so far (as
expected)
Post by Andrija Panic
Then I restore volume from snapshots.
CloudStack will (my conclusions from the exercise), remove original
volume
Post by Andrija Panic
on NFS Primary Storage (021e8602-235b-4e0d-b9e4-04f0ff46399f), then it
will
Post by Andrija Panic
copy back (convert via qemu-img) a qcow2 file from Secondary Storage back
to Primary Storage - but it will use SAME NAME, so you again see
021e8602-235b-4e0d-b9e4-04f0ff46399f on your NFS mount point.
This time when you check the image with qemu-img info - it will show it
has
Post by Andrija Panic
NO backing file at all - since it's brand new volume/qcow2 image created
(as a copy fom Secondary Storage)
that is how it works
I assume the template will be again cleaned-up/removed from Primary
Storage
Post by Andrija Panic
if no other VMs/volume use it as it's backing (parent) image.
Makes sense ?
Cheers
Post by ran huang
Thanks Andrija, just tested myself with expunge and works as expected.
However, for KVM, when I revert a qcow disk from snapshot, which removes
the backing chain to template, the template will not be removed.
So it seems like despite the qcow disk is no longer backed by the
template, the template will still consider the disk as its children in
this case(revert from snapshot).
regards,
Ran
Post by Andrija Panic
new template, deployed new VM, destroyed VM (with Exunge option)...
up to 120sec later... (storage.cleanup.interval=120 sec, global config
option)
2018-11-19 19:35:59,525 DEBUGStorage pool garbage collector found 1
templates to clean up in storage pool: Primary-storage - NFS
2018-11-19 19:35:59,525 DEBUG [c.c.s.StorageManagerImpl]
(StorageManager-Scavenger-1:ctx-2c88c8e0) (logid:040f4ad1) Storage pool
garbage collector has marked template with ID: 219 on pool 4 for
garbage
Post by Andrija Panic
Post by ran huang
Post by Andrija Panic
collection
Another 120sec later... (storage.cleanup.delay=120sec)
2018-11-19 19:37:59,598 DEBUG [c.c.s.StorageManagerImpl]
(StorageManager-Scavenger-2:ctx-f9dd338d) (logid:9ae40975) Storage pool
Primary-storage - NFS
...
2018-11-19 19:37:59,638 DEBUG [c.c.t.TemplateManagerImpl]
(StorageManager-Scavenger-2:ctx-f9dd338d) (logid:9ae40975) Evicting
TmplPool[37-219-4-563ea0f5-5164-4ac4-a183-728f418269b7]
2018-11-19 19:37:59,643 DEBUG [c.c.h.o.r.Ovm3HypervisorGuru]
(StorageManager-Scavenger-2:ctx-f9dd338d) (logid:9ae40975)
getCommandHostDelegation: class
com.cloud.agent.api.storage.DestroyCommand
Post by Andrija Panic
...
2018-11-19 19:37:59,665 DEBUG [c.c.t.TemplateManagerImpl]
(StorageManager-Scavenger-2:ctx-f9dd338d) (logid:9ae40975) Successfully
evicted template andrija-test-tmpl from storage pool null
template "andrija-test-tmpl" deleted...
Hope that helps Run.
Cheers
Andrija
Post by Andrija Panic
True (at least I'm sure for SolidFire) - but I believe in general also
(will test this now...)
On Mon, 19 Nov 2018 at 18:51, Dag Sonstebo <
Post by Dag Sonstebo
Developers please correct me... but as far as I remember there is a
garbage collector which does remove the templates from primary
storage
Post by Andrija Panic
Post by ran huang
once
Post by Andrija Panic
Post by Andrija Panic
Post by Dag Sonstebo
they are not needed (i.e. have no more "child VMs"). This is
controlled by
Post by Andrija Panic
Post by Andrija Panic
Post by Dag Sonstebo
the global setting "storage.template.cleanup.enabled".
Regards,
Dag Sonstebo
Cloud Architect
ShapeBlue
Hi Andrija,
Thanks for the clarification and quick response
regards,
Ran
Post by Andrija Panic
Hi Ran,
templates stays on Primary Storage "forever", at least for
NFS
Post by Andrija Panic
Post by ran huang
Post by Andrija Panic
Post by Andrija Panic
Post by Dag Sonstebo
(they are
Post by Andrija Panic
moved from Secondary to Primary when you deploy a very first
VM
Post by Andrija Panic
Post by ran huang
from
Post by Andrija Panic
Post by Andrija Panic
Post by Dag Sonstebo
Post by Andrija Panic
specific template). All VMs have this templates qcow2 as
baking
Post by Andrija Panic
Post by ran huang
Post by Andrija Panic
Post by Andrija Panic
Post by Dag Sonstebo
(parent)
Post by Andrija Panic
image.
This template is a qcow2 copy of a file from Secondary
Storage -
Post by Andrija Panic
Post by ran huang
Post by Andrija Panic
Post by Andrija Panic
Post by Dag Sonstebo
and is
Post by Andrija Panic
considered a "parent" image, from which all child images (VM
volumes) are
Post by Andrija Panic
created - as you stated baking file (qcow linked clones, in
official
Post by Andrija Panic
Post by Andrija Panic
Post by Dag Sonstebo
Post by Andrija Panic
terminology)
you can have i.e. 100 VMs all linking (having it's backing
file...)
Post by Andrija Panic
Post by Andrija Panic
Post by Dag Sonstebo
to a
Post by Andrija Panic
template qcow2 file.
So in other words, it's not supposed to be removed.
Does this make sense?
Cheers
www.shapeblue.com
Amadeus House, Floral Street, London WC2E 9DPUK
@shapeblue
Post by Andrija Panic
Post by ran huang
Greetings All,
For qcow2 format images, when creating a new VM in KVM, the
template
Post by Andrija Panic
Post by ran huang
image is copied from secondary storage to primary storage,
and
Post by Andrija Panic
Post by ran huang
the
Post by Andrija Panic
Post by Andrija Panic
Post by Dag Sonstebo
root
Post by Andrija Panic
Post by ran huang
volume image is created with the template image as a backing
file.
Post by Andrija Panic
Post by Andrija Panic
Post by Dag Sonstebo
Post by Andrija Panic
Post by ran huang
But when I break this backing chain on primary(expunge VM or
revert to a
Post by Andrija Panic
Post by ran huang
snapshot previously created on the root volume image), the
template
Post by Andrija Panic
Post by Andrija Panic
Post by Dag Sonstebo
Post by Andrija Panic
Post by ran huang
image is not deleted.
Might I ask how is the template image going to be cleaned
from
Post by Andrija Panic
Post by ran huang
the
Post by Andrija Panic
Post by Andrija Panic
Post by Dag Sonstebo
Post by Andrija Panic
Post by ran huang
primary storage?
CS ver 4.9.2 on CentOS 7.2
regards,
Ran
--
Andrija Panić
--
Andrija Panić
ran huang
2018-11-22 22:56:52 UTC
Permalink
Thanks Andrija, will try to work with the solution proposed.

Ran
Post by Andrija Panic
I confirm bug...tmpl not removed...
"volumes" table, field "template_id" should be set to NULL for this
particular volume, after volume restored from snapshot - on next storage
scavenger run it will be marked properly for GC and removed...
(volumes of VM deployed from ISO file, also have NULL for "template_id"
filed"
Post by ran huang
Hi Andrija,
That is precisely the step I went through.
However the template was not cleaned up after expected interval when no
other volume have it as a backing image.
regards,
Ran
Post by Andrija Panic
Hi Run,
not sure what you mean (I did not quite understand your explanation) -
but
Post by Andrija Panic
https://pasteboard.co/HOowNao.png
--- new volume created with UUID/PATH (name on NFS files
system): 021e8602-235b-4e0d-b9e4-04f0ff46399f
/mnt/63a3ae7b-9ea9-3884-a772-1ea939ef6ec3/93682641-e7f6-11e8-8f64-089e01d943be
Post by Andrija Panic
Create snapshots via GUI - there is qcow2 snapshots created, whole
snapshot
Post by Andrija Panic
copied over (converted via qemu-img - "ps aux | grep qemu-img") tool to
Secondary NFS Storage - and snapshot REMOVED from original volume on
Primary NFS Storage (qemu-img snapshot -l
021e8602-235b-4e0d-b9e4-04f0ff46399f shows zero snaps after ACS has
finished creating snapshots)
Volume still points to it's backing file - no changes so far (as
expected)
Post by Andrija Panic
Then I restore volume from snapshots.
CloudStack will (my conclusions from the exercise), remove original
volume
Post by Andrija Panic
on NFS Primary Storage (021e8602-235b-4e0d-b9e4-04f0ff46399f), then it
will
Post by Andrija Panic
copy back (convert via qemu-img) a qcow2 file from Secondary Storage back
to Primary Storage - but it will use SAME NAME, so you again see
021e8602-235b-4e0d-b9e4-04f0ff46399f on your NFS mount point.
This time when you check the image with qemu-img info - it will show it
has
Post by Andrija Panic
NO backing file at all - since it's brand new volume/qcow2 image created
(as a copy fom Secondary Storage)
that is how it works
I assume the template will be again cleaned-up/removed from Primary
Storage
Post by Andrija Panic
if no other VMs/volume use it as it's backing (parent) image.
Makes sense ?
Cheers
Post by ran huang
Thanks Andrija, just tested myself with expunge and works as expected.
However, for KVM, when I revert a qcow disk from snapshot, which removes
the backing chain to template, the template will not be removed.
So it seems like despite the qcow disk is no longer backed by the
template, the template will still consider the disk as its children in
this case(revert from snapshot).
regards,
Ran
Post by Andrija Panic
new template, deployed new VM, destroyed VM (with Exunge option)...
up to 120sec later... (storage.cleanup.interval=120 sec, global config
option)
2018-11-19 19:35:59,525 DEBUGStorage pool garbage collector found 1
templates to clean up in storage pool: Primary-storage - NFS
2018-11-19 19:35:59,525 DEBUG [c.c.s.StorageManagerImpl]
(StorageManager-Scavenger-1:ctx-2c88c8e0) (logid:040f4ad1) Storage pool
garbage collector has marked template with ID: 219 on pool 4 for
garbage
Post by Andrija Panic
Post by ran huang
Post by Andrija Panic
collection
Another 120sec later... (storage.cleanup.delay=120sec)
2018-11-19 19:37:59,598 DEBUG [c.c.s.StorageManagerImpl]
(StorageManager-Scavenger-2:ctx-f9dd338d) (logid:9ae40975) Storage pool
Primary-storage - NFS
...
2018-11-19 19:37:59,638 DEBUG [c.c.t.TemplateManagerImpl]
(StorageManager-Scavenger-2:ctx-f9dd338d) (logid:9ae40975) Evicting
TmplPool[37-219-4-563ea0f5-5164-4ac4-a183-728f418269b7]
2018-11-19 19:37:59,643 DEBUG [c.c.h.o.r.Ovm3HypervisorGuru]
(StorageManager-Scavenger-2:ctx-f9dd338d) (logid:9ae40975)
getCommandHostDelegation: class
com.cloud.agent.api.storage.DestroyCommand
Post by Andrija Panic
...
2018-11-19 19:37:59,665 DEBUG [c.c.t.TemplateManagerImpl]
(StorageManager-Scavenger-2:ctx-f9dd338d) (logid:9ae40975) Successfully
evicted template andrija-test-tmpl from storage pool null
template "andrija-test-tmpl" deleted...
Hope that helps Run.
Cheers
Andrija
Post by Andrija Panic
True (at least I'm sure for SolidFire) - but I believe in general also
(will test this now...)
On Mon, 19 Nov 2018 at 18:51, Dag Sonstebo <
Post by Dag Sonstebo
Developers please correct me... but as far as I remember there is a
garbage collector which does remove the templates from primary
storage
Post by Andrija Panic
Post by ran huang
once
Post by Andrija Panic
Post by Andrija Panic
Post by Dag Sonstebo
they are not needed (i.e. have no more "child VMs"). This is
controlled by
Post by Andrija Panic
Post by Andrija Panic
Post by Dag Sonstebo
the global setting "storage.template.cleanup.enabled".
Regards,
Dag Sonstebo
Cloud Architect
ShapeBlue
Hi Andrija,
Thanks for the clarification and quick response
regards,
Ran
Post by Andrija Panic
Hi Ran,
templates stays on Primary Storage "forever", at least for
NFS
Post by Andrija Panic
Post by ran huang
Post by Andrija Panic
Post by Andrija Panic
Post by Dag Sonstebo
(they are
Post by Andrija Panic
moved from Secondary to Primary when you deploy a very first
VM
Post by Andrija Panic
Post by ran huang
from
Post by Andrija Panic
Post by Andrija Panic
Post by Dag Sonstebo
Post by Andrija Panic
specific template). All VMs have this templates qcow2 as
baking
Post by Andrija Panic
Post by ran huang
Post by Andrija Panic
Post by Andrija Panic
Post by Dag Sonstebo
(parent)
Post by Andrija Panic
image.
This template is a qcow2 copy of a file from Secondary
Storage -
Post by Andrija Panic
Post by ran huang
Post by Andrija Panic
Post by Andrija Panic
Post by Dag Sonstebo
and is
Post by Andrija Panic
considered a "parent" image, from which all child images (VM
volumes) are
Post by Andrija Panic
created - as you stated baking file (qcow linked clones, in
official
Post by Andrija Panic
Post by Andrija Panic
Post by Dag Sonstebo
Post by Andrija Panic
terminology)
you can have i.e. 100 VMs all linking (having it's backing
file...)
Post by Andrija Panic
Post by Andrija Panic
Post by Dag Sonstebo
to a
Post by Andrija Panic
template qcow2 file.
So in other words, it's not supposed to be removed.
Does this make sense?
Cheers
www.shapeblue.com
Amadeus House, Floral Street, London WC2E 9DPUK
@shapeblue
Post by Andrija Panic
Post by ran huang
Greetings All,
For qcow2 format images, when creating a new VM in KVM, the
template
Post by Andrija Panic
Post by ran huang
image is copied from secondary storage to primary storage,
and
Post by Andrija Panic
Post by ran huang
the
Post by Andrija Panic
Post by Andrija Panic
Post by Dag Sonstebo
root
Post by Andrija Panic
Post by ran huang
volume image is created with the template image as a backing
file.
Post by Andrija Panic
Post by Andrija Panic
Post by Dag Sonstebo
Post by Andrija Panic
Post by ran huang
But when I break this backing chain on primary(expunge VM or
revert to a
Post by Andrija Panic
Post by ran huang
snapshot previously created on the root volume image), the
template
Post by Andrija Panic
Post by Andrija Panic
Post by Dag Sonstebo
Post by Andrija Panic
Post by ran huang
image is not deleted.
Might I ask how is the template image going to be cleaned
from
Post by Andrija Panic
Post by ran huang
the
Post by Andrija Panic
Post by Andrija Panic
Post by Dag Sonstebo
Post by Andrija Panic
Post by ran huang
primary storage?
CS ver 4.9.2 on CentOS 7.2
regards,
Ran
--
Andrija Panić
Loading...