cloudstack-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gian Paolo Buono <>
Subject Re: [Where are the snapshot file]
Date Sat, 19 Mar 2016 17:17:14 GMT

how can i rebuild a chain snaphot (xenserver) in other xenserver hypervisor ? try to explain
with below example.

On secondary storage have two file:

xxxxxxxxxxxxxxx.vhd       18 GB   - (18 March) Full Snap
yyyyyyyyyyyyyyy.vhd       300MB   - (19 March) Incremental Snap

If I copy the above file on another xenserver installation, how can merge both files for attach
to other virtual machine ?
Is there a command to merge like vhd-util ?


On 03/18/2016 11:35 AM, Stavros Konstantaras wrote:

It seems that CS 4.6 does not have enough logic to handle correctly the snapshots. In my case,
it was an expunged volume that used to create the problem as snapshots of this volume still
existed (both in DB and in secondary storage). So I created a manual workaround to bypass
this problem by making our hands dirty in MySQL:

- Stop CS service

- In MySQL find the expunged volume in “volumes" table and keep the volume_id

- In “snapshot_store_ref" table get the location of the snapshots by using the mentioned
volume_id. Then go to the secondary storage and delete all the relevant files (since now we
know the exact location)

- Now it’s time to update the tables by running the following SQL commands:  <update
snapshot_store_ref set state="Destroyed" where id=XXX;>  <update snapshots set status="Destroyed"
where id=XXX;> where XXX is the volume id of the second step.

- Start CS service and check the snapshots output. The problem should be gone.

Hope that helps some fellows.


Stavros Konstantaras
Science faculty Research IT support (FEIOG)
University of Amsterdam, Science Park 904, 1098 XH

Fingerprint: E5E5 9B19 D1CD 88CD 4763  3465 A8DC 7C92 330F D59A

On 16 Mar 2016, at 11:05, Stavros Konstantaras <><>

Hi Adrian,

Firstly, thanks for your extensive answer and the trick. My problem is similar to the CLOUDSTACK-8845
issue. In our case we just try to view the snapshots from cloudstack UI instead of listing
them in cloud monkey. My first thoughts are that probably  some inconsistencies exist in the
database but unfortunately after running the following mysql commands I don’t get any results.

< select volume_id,name,status from cloud.snapshots where volume_id not in (select id from
cloud.volumes); >
< select * from cloud.snapshot_store_ref where volume_id not in (select id from cloud.volumes);

Any other ideas to find out the inconsistencies and get rid of them? In addition, I checked
the log file of cloudstack-management server and I don’t see the error you mentioned. I
use CS 4.6 and XenServer 6.5

Thanks again.


Stavros Konstantaras
Science faculty Research IT support (FEIOG)
University of Amsterdam, Science Park 904, 1098 XH

Fingerprint: E5E5 9B19 D1CD 88CD 4763  3465 A8DC 7C92 330F D59A

On 16 Mar 2016, at 07:43, Adrian Sender <><>

Hi Stravos,

A bit more info with ongoing snapshot issues with Xenserver.. your snapshots
may also be failing if your chain depth exceeds 30.

Assuming your using LVMoHBA (hardware hba), easiest way to check this is as

If the xenserver snapshot chain depth exceeds 30, you will not be able to take
any new snapshots.

You may see a similar error: (note exact error will depend on CCP / CS version..

2015-11-18 10:57:42,133 WARN  [c.c.h.x.r.XenServerStorageProcessor]
(DirectAgent-243:ctx-341ac146) (logid:65b51cbd) create snapshot operation
Failed for snapshotId: 36709, reason: SR_BACKEND_FAILURE_109The snapshot chain
is too long
SR_BACKEND_FAILURE_109The snapshot chain is too long

[root@qh2-nsp04 ~]# vhd-util query -vsfd -n
hidden: 0
chain depth: 30

The best way to get the LVM path is as follows:

mysql> select * from volumes where name='ROOT-3230' \G

We are looking for the path, in this case "7bf051ee-7762-4902-84be-4962e70a4e3e"

Login to Xenserver console and do "lvscan | grep
7bf051ee-7762-4902-84be-4962e70a4e3e" This will give us VG and LV.

Then you can execute vhd-util query -vsfd -n

Delete the broken snapshots from the primary storage in XenCenter.

Adrian Sender

Testlabs Australia
Research Platform Services
M: +61. 487-440-732

---------- Original Message -----------
From: "Adrian Sender" <><>
Sent: Wed, 16 Mar 2016 09:59:34 +1000
Subject: Re: [Where are the snapshot file]

Hi Stravos,

Jumping in a bit late on this thread...Can you share the exact
management log error.

We have ran CCP 4.3 with Xenserver, everything is generally ok; most
common snapshot issues are as follows:

Snapshot failing

The snapshotting on data volume DATA-3230 Failing. UI shows "Error"

2014-08-26 10:51:32,884 DEBUG [o.a.c.s.m.AncientDataMotionStrategy]

(Work-Job-Executor-6:ctx-274b0a29 job-31179/job-31180 ctx-8511b016) copyAsync
inspecting src type SNAPSHOT copyAsync inspecting dest type  SNAPSHOT
2014-08-26 10:51:33,055 DEBUG [o.a.c.s.m.AncientDataMotionStrategy]

(Work-Job-Executor-6:ctx-274b0a29 job-31179/job-31180 ctx-8511b016) copy
snasphot failed: java.lang.NullPointerException
2014-08-26 10:51:33,056 DEBUG [o.a.c.s.m.AncientDataMotionStrategy]

(Work-Job-Executor-6:ctx-274b0a29 job-31179/job-31180 ctx-8511b016)
copy failed


1. Show the details of the failing snapshot volume

mysql> select * from volumes where name=DATA-3230 \G

2. get the id of the volume from the above query and delete
snapshots in the 'Ready' state.

delete from snapshot_store_ref where volume_id=3934 and state='Ready'

3. Snapshots will now succeed for volume DATA-3230.

Snapshot Failing

You may see the following in the logs:

2015-11-17 15:22:16,586 DEBUG [c.c.h.x.r.XenServerStorageProcessor]
(DirectAgent-339:ctx-6465ce91) (logid:9224bc6d) Failed to destroy pbd
SR_BACKEND_FAILURE_40The SR scan failed  [opterr=['INTERNAL_ERROR',
'Db_exn.Uniqueness_constraint_violation("VDI", "uuid",

Note in this example DATA-3701 snapshot is failing, but the
screenshot shows the NFS secondary storage mount for account 29,
DATA-3701 belongs to account 113. So you can go through the tabs
until you find /var/cloud_mount/xxxx/snapshots/113/3701 and unplug
just that volume.

In this example you will see many attached NFS secondary storage
volumes on the physical xenserver host.

1. Get the uuid of the SR from the "General" tab on the NFS storage mount.

xe sr-list uuid=84142bd7-c19c-4a39-850b-ddd30539d8ed

[root@qh2-nsp01 ~]# xe sr-list uuid=84142bd7-c19c-4a39-850b-ddd30539d8ed
uuid ( RO)                : 84142bd7-c19c-4a39-850b-ddd30539d8ed
       name-label ( RW):
31fe-a496-6943e9dfca63/snapshots/29/4469   name-description ( RW):
31fe-a496-6943e9dfca63/snapshots/29/4469               host ( RO):               type ( RO): file
content-type ( RO): file

2. Get the PBD UUID by using the sr-uuid from above

[root@qh2-nsp01 ~]# xe pbd-list sr-uuid=84142bd7-c19c-4a39-850b-ddd30539d8ed
uuid ( RO)                  : c15627c7-a968-ac1f-9794-2e3d66c0cec4
          host-uuid ( RO): 14a68eb4-62aa-4beb-91d5-e5070ecd46a9
            sr-uuid ( RO): 84142bd7-c19c-4a39-850b-ddd30539d8ed
      device-config (MRO): location:
 currently-attached ( RO): true

3. Unplug the pdb using the uuid from above

xe pbd-unplug uuid=c15627c7-a968-ac1f-9794-2e3d66c0cec4

4. At this point you should notice the state change to broken and a
red cross through the secondary mount point in Xencenter.

5. Finally remove the sr from the host completely using the original
sr uuid.

xe sr-forget uuid=84142bd7-c19c-4a39-850b-ddd30539d8ed

6 Repeat this procedure for any other attached NFS snapshot mounts,
check all xenservers.

Adrian Sender

---------- Original Message -----------
From: Prashant Mishra <><>
To: ""<> <><>
Sent: Tue, 15 Mar 2016 12:48:10 +0000
Subject: Re: [Where are the snapshot file]

There are some discussion related to this please check

On 3/15/16, 5:49 PM, "Stavros Konstantaras" <><>

Yes indeed. Currently I am fighting with the very well known "Unable to
determine the storage pool of the snapshot² after deleting some snapshots
and creating new ones.

Is there any workaround for this issue?


Stavros Konstantaras
Science faculty Research IT support (FEIOG)
University of Amsterdam, Science Park 904, 1098 XH

Fingerprint: E5E5 9B19 D1CD 88CD 4763  3465 A8DC 7C92 330F D59A

On 15 Mar 2016, at 13:01, Simon Weller <><>

Can you post some logs from both the management server and the agent
(on the host) when you try and delete a snapshot?

I just looked through Jira and there are quite a few issues related to

- Si

From: Gian Paolo Buono <><>
Sent: Tuesday, March 15, 2016 6:52 AM
Subject: Re: [Where are the snapshot file]

Hi Simon,

we run Citrix CloudPlatfor 4.3 but we want to migrate to CloudStack

there is a fix ?

Best regards

This communication may contain information that is proprietary,
confidential, or exempt from disclosure. If you are not the intended
recipient, please note that any other dissemination, distribution, use
or copying of this communication is strictly prohibited. Anyone who
receives this message in error should notify the sender immediately by
telephone or by return e-mail and delete it from his or her computer.

On 03/15/2016 12:46 PM, Simon Weller wrote:


What version of CloudStack are you running?

I recall (quite a long time ago), there was a bug where volumes and
snapshots weren't getting cleaned up correctly.
If I recall correctly, that was somewhere around 4.2.

- Si

From: Gian Paolo Buono
Sent: Tuesday, March 15, 2016 6:10 AM
Subject: Re: [Where are the snapshot file]

Thank you it's correct :) , but now I have another question..

>From console of CloudStack I have deleted a snapshot, on the database
the status is changed in Destroyed but the file it's stil on secondary

ls -ltr d8736bdb-22c6-46fe-a27e-0ee5dc99a867.vhd
-rw-r--r-- 1 root root 1271296512 Mar 11 04:02

Also in snapshots view sometimes the status is allocated...but what
does it mean ?

Best Regards

On 03/15/2016 11:15 AM, Stavros Konstantaras wrote:

Hi Gian,

If you run the following query in MySQL and check the column
³install_path² you will find the location of snapshot file in secondary
<select * from cloud.snapshot_store_ref;>

I hope that it helps you.

Best Regards

Stavros Konstantaras
Science faculty Research IT support (FEIOG)
University of Amsterdam, Science Park 904, 1098 XH

Fingerprint: E5E5 9B19 D1CD 88CD 4763  3465 A8DC 7C92 330F D59A

On 15 Mar 2016, at 11:11, Gian Paolo Buono

Hi all, how can I know where are the snapshot file (vhd) on the
secondary storage ? Is there a mysql query ?

Kind regards

This e-mail may contain privileged and confidential information
which is the property of Accelerite, a Persistent Systems business.
It is intended only for the use of the individual or entity to which
it is addressed. If you are not the intended recipient, you are not
authorized to read, retain, copy, print, distribute or use this
message. If you have received this communication in error, please
notify the sender and delete all copies of this message. Accelerite,
a Persistent Systems business does not accept any liability for
virus infected mails.

------- End of Original Message -------

------- End of Original Message -------

View raw message