Sailaja Mada created CLOUDSTACK-1445:
----------------------------------------

             Summary: Resize volume[Data Disk] failed when shrink volume is set 
to true [20 GB to 10 GB]
                 Key: CLOUDSTACK-1445
                 URL: https://issues.apache.org/jira/browse/CLOUDSTACK-1445
             Project: CloudStack
          Issue Type: Bug
      Security Level: Public (Anyone can view this level - this is the default.)
          Components: Volumes
    Affects Versions: 4.1.0
            Reporter: Sailaja Mada


Steps:  

1. Create Data volume with 20 GB
2. Attach the volume to instance 
2. Tied 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.  

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&response=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-703567eda58f","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":10737418240,"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&_=1361964740184
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&_=1361964740184


====================================

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




--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to