Thanks Wido. I have crated the bug for the same @ https://issues.apache.org/jira/browse/CLOUDSTACK-1445
Regards, Sailaja.M -----Original Message----- From: Wido den Hollander [mailto:w...@widodh.nl] Sent: Wednesday, February 27, 2013 7:29 PM To: cloudstack-dev@incubator.apache.org Subject: Re: [ACS41]Unable to shrink volumes of type QCOW2 On 02/27/2013 12:45 PM, Sailaja Mada wrote: > Hi, > > Out of my curiosity , I tried to resize the volume with shrink option set to > true . It failed to resize volume from 20 GB to 10 GB . This is with KVM 6.3 > hypervisor. Do we have support this feature with KVM ? > > 2013-02-27 17:01:55,052 DEBUG [cloud.api.ApiServlet] > (catalina-exec-1:null) ===END=== 10.144.7.13 -- GET > command=resizeVolume&id=ff94b87c-973c-4698-9fd2-4a1375f5a7c0&shrinkok= > true&diskofferingid=8c61068f-f997-48f5-a8ee-dfe8fd3571f2&size=10&respo > nse=json&sessionkey=Ijl3uimE7kcZYn0P%2FK4AEvh%2B3fw%3D&_=1361964737075 > 2013-02-27 17:01:55,054 DEBUG [cloud.async.AsyncJobManagerImpl] > (Job-Executor-66:job-128) Executing > org.apache.cloudstack.api.command.user.volume.ResizeVolumeCmd for > job-128 > 2013-02-27 17:01:55,078 DEBUG [agent.transport.Request] > (Job-Executor-66:job-128) Seq 1-648544436: Sending { Cmd , MgmtId: > 55487956346259, via: 1, Ver: v1, Flags: 100011, > [{"storage.ResizeVolumeCommand":{"path":"d6a5ce3c-ca40-426d-b0bd-70356 > 7eda58f","pool":{"id":200,"uuid":"17700ab0-df5a-3047-a631-588d93dd749a > ","host":"10.102.192.100","path":"/cpg_vol/sailaja/asf41kvmps","port": > 2049,"type":"NetworkFilesystem"},"vmInstance":"none","newSize":1073741 > 8240,"currentSize":21474836480,"shrinkOk":true,"wait":0}}] } > 2013-02-27 17:01:55,192 DEBUG [agent.transport.Request] > (AgentManager-Handler-10:null) Seq 1-648544436: Processing: { Ans: , > MgmtId: 55487956346259, via: 1, Ver: v1, Flags: 10, > [{"storage.ResizeVolumeAnswer":{"newSize":0,"result":false,"details":" > Unable to shrink volumes of type QCOW2","wait":0}}] } > 2013-02-27 17:01:55,192 DEBUG [agent.transport.Request] > (Job-Executor-66:job-128) Seq 1-648544436: Received: { Ans: , MgmtId: > 55487956346259, via: 1, Ver: v1, Flags: 10, { ResizeVolumeAnswer } } > 2013-02-27 17:01:55,192 DEBUG [cloud.storage.StorageManagerImpl] > (Job-Executor-66:job-128) Resize: returned 'Unable to shrink volumes of type > QCOW2' > 2013-02-27 17:01:55,201 DEBUG [cloud.async.AsyncJobManagerImpl] > (Job-Executor-66:job-128) Complete async job-128, jobStatus: 2, > resultCode: 530, result: Error Code: 530 Error text: Failed to resize > volume > 2013-02-27 17:01:58,073 DEBUG [cloud.api.ApiServlet] > (catalina-exec-17:null) ===START=== 10.144.7.13 -- GET > command=queryAsyncJobResult&jobId=68fdb060-343c-4a64-8ccd-ce738da07a9b > &response=json&sessionkey=Ijl3uimE7kcZYn0P%2FK4AEvh%2B3fw%3D&_=1361964 > 740184 > 2013-02-27 17:01:58,081 DEBUG [cloud.async.AsyncJobManagerImpl] > (catalina-exec-17:null) Async job-128 completed > 2013-02-27 17:01:58,085 DEBUG [cloud.api.ApiServlet] > (catalina-exec-17:null) ===END=== 10.144.7.13 -- GET > command=queryAsyncJobResult&jobId=68fdb060-343c-4a64-8ccd-ce738da07a9b > &response=json&sessionkey=Ijl3uimE7kcZYn0P%2FK4AEvh%2B3fw%3D&_=1361964 > 740184 > > Checking the code I found this in LibvirtComputingResource: boolean shrinkOk = cmd.getShrinkOk(); } else if (type.equals("QCOW2") && shrinkOk) { return new ResizeVolumeAnswer(cmd, false, "Unable to shrink volumes of type " + type); } Seems like a logical mistake? Shouldn't that be !shrinkOk? Wido > Thanks, > Sailaja.M >