Right, done some more testing and indeed, the vms created from templates that 
were created from snapshots are not working. I get the following error in the 
management server logs: 


2013-12-23 15:54:11,088 DEBUG [agent.transport.Request] 
(AgentManager-Handler-11:null) Seq 1-2082880489: Processing: { Ans: , MgmtId: 
238402986947284, via: 1, Ver: v1, Flags: 110, 
[{"org.apache.cloudstack.storage.command.CopyCmdAnswer":{"result":false,"details":"com.cloud.utils.exception.CloudRuntimeException:
 Failed to copy 
/mnt/08452456-d626-307b-9cbe-c028ae633435/59dfab5d-832e-4160-8f8e-47efb2d23d3e.raw
 to 0756278c-5abc-4e6c-b9ae-37033194d31a","wait":0}}] } 
2013-12-23 15:54:11,088 DEBUG [agent.manager.AgentAttache] 
(AgentManager-Handler-11:null) Seq 1-2082880489: No more commands found 
2013-12-23 15:54:11,088 DEBUG [agent.transport.Request] 
(Job-Executor-113:job-548 = [ dc47c0ce-eb8b-4230-b58a-047ab55950fb ]) Seq 
1-2082880489: Received: { Ans: , MgmtId: 238402986947284, via: 1, Ver: v1, 
Flags: 110, { CopyCmdAnswer } } 
2013-12-23 15:54:11,093 INFO [storage.volume.VolumeServiceImpl] 
(Job-Executor-113:job-548 = [ dc47c0ce-eb8b-4230-b58a-047ab55950fb ]) releasing 
lock for VMTemplateStoragePool 12 
2013-12-23 15:54:11,093 WARN [utils.db.Merovingian2] (Job-Executor-113:job-548 
= [ dc47c0ce-eb8b-4230-b58a-047ab55950fb ]) Was unable to find lock for the key 
template_spool_ref12 and thread id 291724899 
2013-12-23 15:54:11,093 DEBUG [cloud.storage.VolumeManagerImpl] 
(Job-Executor-113:job-548 = [ dc47c0ce-eb8b-4230-b58a-047ab55950fb ]) Unable to 
create Vol[504|vm=508|ROOT]:com.cloud.utils.exception.CloudRuntimeException: 
Failed to copy 
/mnt/08452456-d626-307b-9cbe-c028ae633435/59dfab5d-832e-4160-8f8e-47efb2d23d3e.raw
 to 0756278c-5abc-4e6c-b9ae-37033194d31a 
2013-12-23 15:54:11,093 INFO [cloud.vm.VirtualMachineManagerImpl] 
(Job-Executor-113:job-548 = [ dc47c0ce-eb8b-4230-b58a-047ab55950fb ]) Unable to 
contact resource. 
com.cloud.exception.StorageUnavailableException: Resource [StoragePool:2] is 
unreachable: Unable to create 
Vol[504|vm=508|ROOT]:com.cloud.utils.exception.CloudRuntimeException: Failed to 
copy 
/mnt/08452456-d626-307b-9cbe-c028ae633435/59dfab5d-832e-4160-8f8e-47efb2d23d3e.raw
 to 0756278c-5abc-4e6c-b9ae-37033194d31a 
at 
com.cloud.storage.VolumeManagerImpl.recreateVolume(VolumeManagerImpl.java:2544) 
at com.cloud.storage.VolumeManagerImpl.prepare(VolumeManagerImpl.java:2592) 
at 
com.cloud.vm.VirtualMachineManagerImpl.advanceStart(VirtualMachineManagerImpl.java:889)
 
at 
com.cloud.vm.VirtualMachineManagerImpl.start(VirtualMachineManagerImpl.java:578)
 
at 
org.apache.cloudstack.engine.cloud.entity.api.VMEntityManagerImpl.deployVirtualMachine(VMEntityManagerImpl.java:227)
 
at 
org.apache.cloudstack.engine.cloud.entity.api.VirtualMachineEntityImpl.deploy(VirtualMachineEntityImpl.java:209)
 
at 
com.cloud.vm.UserVmManagerImpl.startVirtualMachine(UserVmManagerImpl.java:3406) 
at 
com.cloud.vm.UserVmManagerImpl.startVirtualMachine(UserVmManagerImpl.java:2966) 
at 
com.cloud.vm.UserVmManagerImpl.startVirtualMachine(UserVmManagerImpl.java:2952) 
at 
com.cloud.utils.component.ComponentInstantiationPostProcessor$InterceptorDispatcher.intercept(ComponentInstantiationPostProcessor.java:125)
 
at 
org.apache.cloudstack.api.command.user.vm.DeployVMCmd.execute(DeployVMCmd.java:420)
 
at com.cloud.api.ApiDispatcher.dispatch(ApiDispatcher.java:158) 
at com.cloud.async.AsyncJobManagerImpl$1.run(AsyncJobManagerImpl.java:531) 
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) 
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334) 
at java.util.concurrent.FutureTask.run(FutureTask.java:166) 
at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1146) 
at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) 
at java.lang.Thread.run(Thread.java:701) 


The template file is there: 

# find ./ |grep 59dfab5d-832e-4160-8f8e-47efb2d23d3e.raw 
./template/tmpl/5/217/59dfab5d-832e-4160-8f8e-47efb2d23d3e.raw 


As i've mentioned earlier, there is no problem when doing: root_disk > template 
> vm. The problem seems to be when I perform: root_disk > snapshot > template > 
vm. 

There seems to be a difference in the saved format types. A template created 
directly from a root volume is saved as QCOW2 whereas a template created from a 
snapshot is created as RAW according to the database: 


mysql> select * from vm_template where id=216 or id=217; 
+-----+---------------------------------------+---------------------------+--------------------------------------+--------+----------+------+-----+------+------+--------+---------------------+---------------------+------------+----------+---------------------------+-----------------+---------------+-------------+----------+-------------+-------------+-------------+-----------------+--------------------+--------------+----------+-------------+-------+--------------+---------+----------------------+
 
| id | unique_name | name | uuid | public | featured | type | hvm | bits | url 
| format | created | removed | account_id | checksum | display_text | 
enable_password | enable_sshkey | guest_os_id | bootable | prepopulate | 
cross_zones | extractable | hypervisor_type | source_template_id | template_tag 
| sort_key | size | state | update_count | updated | dynamically_scalable | 
+-----+---------------------------------------+---------------------------+--------------------------------------+--------+----------+------+-----+------+------+--------+---------------------+---------------------+------------+----------+---------------------------+-----------------+---------------+-------------+----------+-------------+-------------+-------------+-----------------+--------------------+--------------+----------+-------------+-------+--------------+---------+----------------------+
 
| 216 | 36d0799f-cf61-4252-ac15-e9b8ec5b9d3b | ubuntu-template-to-remove | 
700026eb-06a4-4e0c-9a0a-1512ee1d4ffe | 0 | 0 | USER | 1 | 64 | NULL | QCOW2 | 
2013-12-22 23:48:04 | 2013-12-23 13:50:10 | 2 | NULL | 
ubuntu-template-to-remove | 0 | 0 | 164 | 1 | 0 | 0 | 0 | KVM | 203 | NULL | 0 
| 10737418240 | NULL | 0 | NULL | 0 | 
| 217 | 33345b965-eab0-3a63-a54a-205e6474c724 | ubuntu-syslog-tmpl-remove | 
ca6d40a4-54b7-463a-bb31-6e40be1abdc0 | 1 | 0 | USER | 1 | 64 | NULL | RAW | 
2013-12-23 15:43:53 | NULL | 5 | NULL | ubuntu-syslog-tmpl-remove | 0 | 0 | 164 
| 1 | 0 | 0 | 0 | KVM | 203 | NULL | 0 | 8589901824 | NULL | 0 | NULL | 0 | 
+-----+---------------------------------------+---------------------------+--------------------------------------+--------+----------+------+-----+------+------+--------+---------------------+---------------------+------------+----------+---------------------------+-----------------+---------------+-------------+----------+-------------+-------------+-------------+-----------------+--------------------+--------------+----------+-------------+-------+--------------+---------+----------------------+
 
2 rows in set (0.00 sec) 

>From the database above, the template with id=216 is fully working and I can 
>create vms from it. The broken template is with id=217. 

As far as I can see, this is a major blocker issue. I can't find any other way 
of rolling back a snapshot apart from doing snapshot > template > vm. 
Therefore, as far as I can see, the whole point of snapshots is broken as there 
is no use for the snapshots if you can not create / roll back vms from them. 

Thanks 

Andrei 


----- Original Message -----

From: "Andrei Mikhailovsky" <and...@arhont.com> 
To: dev@cloudstack.apache.org 
Sent: Monday, 23 December, 2013 2:52:37 PM 
Subject: Re: [VOTE] 3rd round of voting for ASF 4.2.1 RC 


There is definitely an issue with snapshotting for kvm. 


I've been done some tests, but not finished yet. What i've discovered is that 
if you take a snapshot of a live server, the snapshot creation works perfectly 
well for me. The snapshot is created and saved without an error. However, i've 
tried to convert the snapshot into a template and create a new vm using this 
template. The snapshot to template works fine. However, creating a vm from that 
template did not work. 


If I try to create a template from a stopped server directly without using the 
snapshot, the vm creation from the template works perfectly well. 


I've not done much investigation, however, i've noticed that when I am doing vm 
creation using snapshot and template process the database shows QCOW2 as the 
file format. Doing directly via the template is showing RAW file format. I will 
do some more testing to verify and post management server logs. 


Andrei 


----- Original Message ----- 

From: "Nux!" <n...@li.nux.ro> 
To: dev@cloudstack.apache.org 
Sent: Monday, 23 December, 2013 2:34:31 PM 
Subject: Re: [VOTE] 3rd round of voting for ASF 4.2.1 RC 

On 23.12.2013 05:42, Abhinandan Prateek wrote: 
> It gives me immense pleasure to inform that the vote to label this ASF 
> 4.2.1 RC as the GA release has been passed with following stats: 

Can someone check KVM volume snapshots before declaring this GA? It's 
been consistently broken for me in 4.2.1-SNAPSHOT with NFS as well as 
GlusterFS shared mount point. 
It was working in 4.2.0 afaicr. 

I've sent several emails about this as well as bothering people in 
CLOUDSTACK-5393. 
http://www.mail-archive.com/dev@cloudstack.apache.org/msg20123.html 

HTH 
Lucian 

-- 
Sent from the Delta quadrant using Borg technology! 

Nux! 
www.nux.ro 


Reply via email to