You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cloudstack.apache.org by Hongtu Zang <ho...@tcloudcomputing.com> on 2013/02/01 09:56:40 UTC

Review Request: CLOUDSTACK-644 add vmware resizeVolume support

-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/9241/
-----------------------------------------------------------

Review request for cloudstack, mice xia and Marcus Sorensen.


Description
-------

add vmware resizeVolume support


This addresses bug CLOUDSTACK-644.


Diffs
-----

  plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java dd917f7 
  server/src/com/cloud/storage/StorageManagerImpl.java 07f4d8a 

Diff: https://reviews.apache.org/r/9241/diff/


Testing
-------

Start a vm using builtin template [CentOS 5.3(64-bit) no GUI (vSphere)].
Attach two data volumes, one made by disk_offering "Small", another made by "Custom".
Try to resize the two volumes when vm in running or stopped state.
After the api finished resize the volume, we found the size changed in the vSphere Client while the size in system is not changed. Reboot the vm and use fdisk to check the disk size, we found the size is changed.

If we try to shrink the volume, the vsphere will throw an exception, I add a check in the code before resize volume. If the newSize is smaller, it will return false.


Thanks,

Hongtu Zang


Re: Review Request: CLOUDSTACK-644 add vmware resizeVolume support

Posted by Hongtu Zang <ho...@tcloudcomputing.com>.

> On Feb. 1, 2013, 9:41 a.m., Sateesh Chodapuneedi wrote:
> >

Thanks for your advice. I did some changes.


> On Feb. 1, 2013, 9:41 a.m., Sateesh Chodapuneedi wrote:
> > plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java, line 517
> > <https://reviews.apache.org/r/9241/diff/1/?file=254592#file254592line517>
> >
> >     Better to do is null check for disk object

I checked the other code using the same function. They didn't check null also. It seems it won't be null if vmMo.getDiskDevice(path, false) doesn't returned null.


- Hongtu


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/9241/#review15998
-----------------------------------------------------------


On Feb. 2, 2013, 12:59 a.m., Hongtu Zang wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/9241/
> -----------------------------------------------------------
> 
> (Updated Feb. 2, 2013, 12:59 a.m.)
> 
> 
> Review request for cloudstack, mice xia and Marcus Sorensen.
> 
> 
> Description
> -------
> 
> add vmware resizeVolume support
> 
> 
> This addresses bug CLOUDSTACK-644.
> 
> 
> Diffs
> -----
> 
>   plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java dd917f7 
>   server/src/com/cloud/storage/StorageManagerImpl.java 07f4d8a 
> 
> Diff: https://reviews.apache.org/r/9241/diff/
> 
> 
> Testing
> -------
> 
> Start a vm using builtin template [CentOS 5.3(64-bit) no GUI (vSphere)].
> Attach two data volumes, one made by disk_offering "Small", another made by "Custom".
> Try to resize the two volumes when vm in running or stopped state.
> After the api finished resize the volume, we found the size changed in the vSphere Client while the size in system is not changed. Reboot the vm and use fdisk to check the disk size, we found the size is changed.
> 
> If we try to shrink the volume, the vsphere will throw an exception, I add a check in the code before resize volume. If the newSize is smaller, it will return false.
> 
> 
> Thanks,
> 
> Hongtu Zang
> 
>


Re: Review Request: CLOUDSTACK-644 add vmware resizeVolume support

Posted by Marcus Sorensen <sh...@gmail.com>.

> On Feb. 1, 2013, 9:41 a.m., Sateesh Chodapuneedi wrote:
> > plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java, line 518
> > <https://reviews.apache.org/r/9241/diff/1/?file=254592#file254592line518>
> >
> >     Are we checking for newSize equal to oldSize before arriving at this code? If not we can do the check here and return ResizeVolumeAnswer(cmd, true, "success")

We aren't checking it in the StorageManagerImpl.java. On some level it might make sense to, but if we don't then people could use this to do something like migrate to a custom disk offering without actually changing the disk size, then resize later by simply providing a size rather than a new disk offering.

He could also check if shrinkOk is true, since he wouldn't get here if newSize < oldSize and shrinkOk is false.


- Marcus


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/9241/#review15998
-----------------------------------------------------------


On Feb. 2, 2013, 12:59 a.m., Hongtu Zang wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/9241/
> -----------------------------------------------------------
> 
> (Updated Feb. 2, 2013, 12:59 a.m.)
> 
> 
> Review request for cloudstack, mice xia and Marcus Sorensen.
> 
> 
> Description
> -------
> 
> add vmware resizeVolume support
> 
> 
> This addresses bug CLOUDSTACK-644.
> 
> 
> Diffs
> -----
> 
>   plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java dd917f7 
>   server/src/com/cloud/storage/StorageManagerImpl.java 07f4d8a 
> 
> Diff: https://reviews.apache.org/r/9241/diff/
> 
> 
> Testing
> -------
> 
> Start a vm using builtin template [CentOS 5.3(64-bit) no GUI (vSphere)].
> Attach two data volumes, one made by disk_offering "Small", another made by "Custom".
> Try to resize the two volumes when vm in running or stopped state.
> After the api finished resize the volume, we found the size changed in the vSphere Client while the size in system is not changed. Reboot the vm and use fdisk to check the disk size, we found the size is changed.
> 
> If we try to shrink the volume, the vsphere will throw an exception, I add a check in the code before resize volume. If the newSize is smaller, it will return false.
> 
> 
> Thanks,
> 
> Hongtu Zang
> 
>


Re: Review Request: CLOUDSTACK-644 add vmware resizeVolume support

Posted by Sateesh Chodapuneedi <sa...@citrix.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/9241/#review15998
-----------------------------------------------------------



plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java
<https://reviews.apache.org/r/9241/#comment34298>

    Need to cleanup tabs and extraneous white spaces.



plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java
<https://reviews.apache.org/r/9241/#comment34300>

    Better to do is null check for disk object 



plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java
<https://reviews.apache.org/r/9241/#comment34301>

    Are we checking for newSize equal to oldSize before arriving at this code? If not we can do the check here and return ResizeVolumeAnswer(cmd, true, "success")



plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java
<https://reviews.apache.org/r/9241/#comment34299>

    Because we got an exception better log level of this message be 'error'



server/src/com/cloud/storage/StorageManagerImpl.java
<https://reviews.apache.org/r/9241/#comment34297>

    Need to update the comment here as support is being added to VMware as well.


- Sateesh Chodapuneedi


On Feb. 1, 2013, 9:23 a.m., Hongtu Zang wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/9241/
> -----------------------------------------------------------
> 
> (Updated Feb. 1, 2013, 9:23 a.m.)
> 
> 
> Review request for cloudstack, mice xia and Marcus Sorensen.
> 
> 
> Description
> -------
> 
> add vmware resizeVolume support
> 
> 
> This addresses bug CLOUDSTACK-644.
> 
> 
> Diffs
> -----
> 
>   plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java dd917f7 
>   server/src/com/cloud/storage/StorageManagerImpl.java 07f4d8a 
> 
> Diff: https://reviews.apache.org/r/9241/diff/
> 
> 
> Testing
> -------
> 
> Start a vm using builtin template [CentOS 5.3(64-bit) no GUI (vSphere)].
> Attach two data volumes, one made by disk_offering "Small", another made by "Custom".
> Try to resize the two volumes when vm in running or stopped state.
> After the api finished resize the volume, we found the size changed in the vSphere Client while the size in system is not changed. Reboot the vm and use fdisk to check the disk size, we found the size is changed.
> 
> If we try to shrink the volume, the vsphere will throw an exception, I add a check in the code before resize volume. If the newSize is smaller, it will return false.
> 
> 
> Thanks,
> 
> Hongtu Zang
> 
>


Re: Review Request: CLOUDSTACK-644 add vmware resizeVolume support

Posted by Hongtu Zang <ho...@tcloudcomputing.com>.

> On Feb. 5, 2013, 5:36 a.m., Marcus Sorensen wrote:
> > Thanks for the update. Two things:
> > 
> > 1) Did you decide what to do regarding the online resize? It sounded like maybe that didn't work out. If that's the case, you can disable online resize by adding to StorageManagerImpl.java at "/*Xen only works offline, SR does not support VDI.resizeOnline*/" to include check for VMware as well. Or at the very least we need to update the functional spec stating that vmware requires a reboot (or full power cycle?) for the guest to see the change so there is no confusion.
> > 
> > 2) It looks like this is the case from the code, but I'm wondering if you've tested and verified that if you try to shrink with VMware that the async query result replies with your "unable to resize volume from a larger size...", and actually I'd prefer that this say something along the lines of "VMware doesn't support shrinking volume from size...", since it indicates a permanent failure and why, rather than a generic failure.

1) I tried in windows 7 which has vmtools installed. After api returns success, refresh in windows disk management, the disk size will be changed. I think the volume online resize relies on vmtools and its operating system.
2) I tried to shrink the volume, it returns "Invalid Configuration for device 0", it is the same with what shows on vSphere Client. The vSphere Client doesn't allowd to shrink volume capacity also. I changed the error message to "VMware doesn't support shrinking volume from size..."


- Hongtu


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/9241/#review16082
-----------------------------------------------------------


On Feb. 6, 2013, 1:57 a.m., Hongtu Zang wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/9241/
> -----------------------------------------------------------
> 
> (Updated Feb. 6, 2013, 1:57 a.m.)
> 
> 
> Review request for cloudstack, mice xia and Marcus Sorensen.
> 
> 
> Description
> -------
> 
> add vmware resizeVolume support
> 
> 
> This addresses bug CLOUDSTACK-644.
> 
> 
> Diffs
> -----
> 
>   plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java dd917f7 
>   server/src/com/cloud/storage/StorageManagerImpl.java 07f4d8a 
> 
> Diff: https://reviews.apache.org/r/9241/diff/
> 
> 
> Testing
> -------
> 
> Start a vm using builtin template [CentOS 5.3(64-bit) no GUI (vSphere)].
> Attach two data volumes, one made by disk_offering "Small", another made by "Custom".
> Try to resize the two volumes when vm in running or stopped state.
> After the api finished resize the volume, we found the size changed in the vSphere Client while the size in system is not changed. Reboot the vm and use fdisk to check the disk size, we found the size is changed.
> 
> If we try to shrink the volume, the vsphere will throw an exception, I add a check in the code before resize volume. If the newSize is smaller, it will return false.
> 
> 
> Thanks,
> 
> Hongtu Zang
> 
>


Re: Review Request: CLOUDSTACK-644 add vmware resizeVolume support

Posted by Marcus Sorensen <sh...@gmail.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/9241/#review16082
-----------------------------------------------------------


Thanks for the update. Two things:

1) Did you decide what to do regarding the online resize? It sounded like maybe that didn't work out. If that's the case, you can disable online resize by adding to StorageManagerImpl.java at "/*Xen only works offline, SR does not support VDI.resizeOnline*/" to include check for VMware as well. Or at the very least we need to update the functional spec stating that vmware requires a reboot (or full power cycle?) for the guest to see the change so there is no confusion.

2) It looks like this is the case from the code, but I'm wondering if you've tested and verified that if you try to shrink with VMware that the async query result replies with your "unable to resize volume from a larger size...", and actually I'd prefer that this say something along the lines of "VMware doesn't support shrinking volume from size...", since it indicates a permanent failure and why, rather than a generic failure.

- Marcus Sorensen


On Feb. 2, 2013, 12:59 a.m., Hongtu Zang wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/9241/
> -----------------------------------------------------------
> 
> (Updated Feb. 2, 2013, 12:59 a.m.)
> 
> 
> Review request for cloudstack, mice xia and Marcus Sorensen.
> 
> 
> Description
> -------
> 
> add vmware resizeVolume support
> 
> 
> This addresses bug CLOUDSTACK-644.
> 
> 
> Diffs
> -----
> 
>   plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java dd917f7 
>   server/src/com/cloud/storage/StorageManagerImpl.java 07f4d8a 
> 
> Diff: https://reviews.apache.org/r/9241/diff/
> 
> 
> Testing
> -------
> 
> Start a vm using builtin template [CentOS 5.3(64-bit) no GUI (vSphere)].
> Attach two data volumes, one made by disk_offering "Small", another made by "Custom".
> Try to resize the two volumes when vm in running or stopped state.
> After the api finished resize the volume, we found the size changed in the vSphere Client while the size in system is not changed. Reboot the vm and use fdisk to check the disk size, we found the size is changed.
> 
> If we try to shrink the volume, the vsphere will throw an exception, I add a check in the code before resize volume. If the newSize is smaller, it will return false.
> 
> 
> Thanks,
> 
> Hongtu Zang
> 
>


Re: Review Request: CLOUDSTACK-644 add vmware resizeVolume support

Posted by Marcus Sorensen <sh...@gmail.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/9241/#review16181
-----------------------------------------------------------

Ship it!


Ship It!

- Marcus Sorensen


On Feb. 6, 2013, 9:02 a.m., Hongtu Zang wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/9241/
> -----------------------------------------------------------
> 
> (Updated Feb. 6, 2013, 9:02 a.m.)
> 
> 
> Review request for cloudstack, mice xia and Marcus Sorensen.
> 
> 
> Description
> -------
> 
> add vmware resizeVolume support
> 
> 
> This addresses bug CLOUDSTACK-644.
> 
> 
> Diffs
> -----
> 
>   plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java a1b1336 
>   server/src/com/cloud/storage/StorageManagerImpl.java 45e3a7f 
> 
> Diff: https://reviews.apache.org/r/9241/diff/
> 
> 
> Testing
> -------
> 
> Start a vm using builtin template [CentOS 5.3(64-bit) no GUI (vSphere)].
> Attach two data volumes, one made by disk_offering "Small", another made by "Custom".
> Try to resize the two volumes when vm in running or stopped state.
> After the api finished resize the volume, we found the size changed in the vSphere Client while the size in system is not changed. Reboot the vm and use fdisk to check the disk size, we found the size is changed.
> 
> If we try to shrink the volume, the vsphere will throw an exception, I add a check in the code before resize volume. If the newSize is smaller, it will return false.
> 
> 
> Thanks,
> 
> Hongtu Zang
> 
>


Re: Review Request: CLOUDSTACK-644 add vmware resizeVolume support

Posted by Hongtu Zang <ho...@tcloudcomputing.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/9241/
-----------------------------------------------------------

(Updated Feb. 6, 2013, 9:02 a.m.)


Review request for cloudstack, mice xia and Marcus Sorensen.


Changes
-------

rebased and you can apply it cleanly.


Description
-------

add vmware resizeVolume support


This addresses bug CLOUDSTACK-644.


Diffs (updated)
-----

  plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java a1b1336 
  server/src/com/cloud/storage/StorageManagerImpl.java 45e3a7f 

Diff: https://reviews.apache.org/r/9241/diff/


Testing
-------

Start a vm using builtin template [CentOS 5.3(64-bit) no GUI (vSphere)].
Attach two data volumes, one made by disk_offering "Small", another made by "Custom".
Try to resize the two volumes when vm in running or stopped state.
After the api finished resize the volume, we found the size changed in the vSphere Client while the size in system is not changed. Reboot the vm and use fdisk to check the disk size, we found the size is changed.

If we try to shrink the volume, the vsphere will throw an exception, I add a check in the code before resize volume. If the newSize is smaller, it will return false.


Thanks,

Hongtu Zang


Re: Review Request: CLOUDSTACK-644 add vmware resizeVolume support

Posted by Marcus Sorensen <sh...@gmail.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/9241/#review16165
-----------------------------------------------------------


Thanks, all problems resolved. It doesn't apply cleanly, however. Could you rebase it and I'll get it committed?

- Marcus Sorensen


On Feb. 6, 2013, 1:57 a.m., Hongtu Zang wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/9241/
> -----------------------------------------------------------
> 
> (Updated Feb. 6, 2013, 1:57 a.m.)
> 
> 
> Review request for cloudstack, mice xia and Marcus Sorensen.
> 
> 
> Description
> -------
> 
> add vmware resizeVolume support
> 
> 
> This addresses bug CLOUDSTACK-644.
> 
> 
> Diffs
> -----
> 
>   plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java dd917f7 
>   server/src/com/cloud/storage/StorageManagerImpl.java 07f4d8a 
> 
> Diff: https://reviews.apache.org/r/9241/diff/
> 
> 
> Testing
> -------
> 
> Start a vm using builtin template [CentOS 5.3(64-bit) no GUI (vSphere)].
> Attach two data volumes, one made by disk_offering "Small", another made by "Custom".
> Try to resize the two volumes when vm in running or stopped state.
> After the api finished resize the volume, we found the size changed in the vSphere Client while the size in system is not changed. Reboot the vm and use fdisk to check the disk size, we found the size is changed.
> 
> If we try to shrink the volume, the vsphere will throw an exception, I add a check in the code before resize volume. If the newSize is smaller, it will return false.
> 
> 
> Thanks,
> 
> Hongtu Zang
> 
>


Re: Review Request: CLOUDSTACK-644 add vmware resizeVolume support

Posted by Hongtu Zang <ho...@tcloudcomputing.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/9241/
-----------------------------------------------------------

(Updated Feb. 6, 2013, 1:57 a.m.)


Review request for cloudstack, mice xia and Marcus Sorensen.


Changes
-------

changed the error message to "VMware doesn't support shrinking volume from size..."


Description
-------

add vmware resizeVolume support


This addresses bug CLOUDSTACK-644.


Diffs (updated)
-----

  plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java dd917f7 
  server/src/com/cloud/storage/StorageManagerImpl.java 07f4d8a 

Diff: https://reviews.apache.org/r/9241/diff/


Testing
-------

Start a vm using builtin template [CentOS 5.3(64-bit) no GUI (vSphere)].
Attach two data volumes, one made by disk_offering "Small", another made by "Custom".
Try to resize the two volumes when vm in running or stopped state.
After the api finished resize the volume, we found the size changed in the vSphere Client while the size in system is not changed. Reboot the vm and use fdisk to check the disk size, we found the size is changed.

If we try to shrink the volume, the vsphere will throw an exception, I add a check in the code before resize volume. If the newSize is smaller, it will return false.


Thanks,

Hongtu Zang


Re: Review Request: CLOUDSTACK-644 add vmware resizeVolume support

Posted by Hongtu Zang <ho...@tcloudcomputing.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/9241/
-----------------------------------------------------------

(Updated Feb. 2, 2013, 12:59 a.m.)


Review request for cloudstack, mice xia and Marcus Sorensen.


Changes
-------

cleanup tabs and extraneous white spaces.
check if newSize equals with oldSize.
change exception log level to error.
update comment in StorageManagerImpl.java


Description
-------

add vmware resizeVolume support


This addresses bug CLOUDSTACK-644.


Diffs (updated)
-----

  plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java dd917f7 
  server/src/com/cloud/storage/StorageManagerImpl.java 07f4d8a 

Diff: https://reviews.apache.org/r/9241/diff/


Testing
-------

Start a vm using builtin template [CentOS 5.3(64-bit) no GUI (vSphere)].
Attach two data volumes, one made by disk_offering "Small", another made by "Custom".
Try to resize the two volumes when vm in running or stopped state.
After the api finished resize the volume, we found the size changed in the vSphere Client while the size in system is not changed. Reboot the vm and use fdisk to check the disk size, we found the size is changed.

If we try to shrink the volume, the vsphere will throw an exception, I add a check in the code before resize volume. If the newSize is smaller, it will return false.


Thanks,

Hongtu Zang


Re: Review Request: CLOUDSTACK-644 add vmware resizeVolume support

Posted by Marcus Sorensen <sh...@gmail.com>.
Its fine if you can't fix getting cm to see online resize. Just add to the
check next to Xen that makes sure the VM is off or the disk is detached.
On Feb 1, 2013 5:40 PM, "Hongtu Zang" <ho...@tcloudcomputing.com>
wrote:

>
>
> > On Feb. 1, 2013, 3:03 p.m., Marcus Sorensen wrote:
> > > Can you perhaps find out if there's something you can do to tell the
> VM that the disk size has changed? For instance with KVM/qemu we have to
> send libvirt a volBlockResize command so that it actually changes the live
> system. Or perhaps you just have to rescan the scsi controller inside the
> vm. If online resize doesn't work at all, there's code in resizeVolume you
> can use to only support offline resize (checks that the VM is stopped, used
> by Xen).
>
> I didn't find the function in vim25 now. I'll try to find a way to fix it.
>
>
> - Hongtu
>
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/9241/#review16009
> -----------------------------------------------------------
>
>
> On Feb. 1, 2013, 9:23 a.m., Hongtu Zang wrote:
> >
> > -----------------------------------------------------------
> > This is an automatically generated e-mail. To reply, visit:
> > https://reviews.apache.org/r/9241/
> > -----------------------------------------------------------
> >
> > (Updated Feb. 1, 2013, 9:23 a.m.)
> >
> >
> > Review request for cloudstack, mice xia and Marcus Sorensen.
> >
> >
> > Description
> > -------
> >
> > add vmware resizeVolume support
> >
> >
> > This addresses bug CLOUDSTACK-644.
> >
> >
> > Diffs
> > -----
> >
> >
> plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java
> dd917f7
> >   server/src/com/cloud/storage/StorageManagerImpl.java 07f4d8a
> >
> > Diff: https://reviews.apache.org/r/9241/diff/
> >
> >
> > Testing
> > -------
> >
> > Start a vm using builtin template [CentOS 5.3(64-bit) no GUI (vSphere)].
> > Attach two data volumes, one made by disk_offering "Small", another made
> by "Custom".
> > Try to resize the two volumes when vm in running or stopped state.
> > After the api finished resize the volume, we found the size changed in
> the vSphere Client while the size in system is not changed. Reboot the vm
> and use fdisk to check the disk size, we found the size is changed.
> >
> > If we try to shrink the volume, the vsphere will throw an exception, I
> add a check in the code before resize volume. If the newSize is smaller, it
> will return false.
> >
> >
> > Thanks,
> >
> > Hongtu Zang
> >
> >
>
>

Re: Review Request: CLOUDSTACK-644 add vmware resizeVolume support

Posted by Hongtu Zang <ho...@tcloudcomputing.com>.

> On Feb. 1, 2013, 3:03 p.m., Marcus Sorensen wrote:
> > Can you perhaps find out if there's something you can do to tell the VM that the disk size has changed? For instance with KVM/qemu we have to send libvirt a volBlockResize command so that it actually changes the live system. Or perhaps you just have to rescan the scsi controller inside the vm. If online resize doesn't work at all, there's code in resizeVolume you can use to only support offline resize (checks that the VM is stopped, used by Xen).

I didn't find the function in vim25 now. I'll try to find a way to fix it.


- Hongtu


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/9241/#review16009
-----------------------------------------------------------


On Feb. 1, 2013, 9:23 a.m., Hongtu Zang wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/9241/
> -----------------------------------------------------------
> 
> (Updated Feb. 1, 2013, 9:23 a.m.)
> 
> 
> Review request for cloudstack, mice xia and Marcus Sorensen.
> 
> 
> Description
> -------
> 
> add vmware resizeVolume support
> 
> 
> This addresses bug CLOUDSTACK-644.
> 
> 
> Diffs
> -----
> 
>   plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java dd917f7 
>   server/src/com/cloud/storage/StorageManagerImpl.java 07f4d8a 
> 
> Diff: https://reviews.apache.org/r/9241/diff/
> 
> 
> Testing
> -------
> 
> Start a vm using builtin template [CentOS 5.3(64-bit) no GUI (vSphere)].
> Attach two data volumes, one made by disk_offering "Small", another made by "Custom".
> Try to resize the two volumes when vm in running or stopped state.
> After the api finished resize the volume, we found the size changed in the vSphere Client while the size in system is not changed. Reboot the vm and use fdisk to check the disk size, we found the size is changed.
> 
> If we try to shrink the volume, the vsphere will throw an exception, I add a check in the code before resize volume. If the newSize is smaller, it will return false.
> 
> 
> Thanks,
> 
> Hongtu Zang
> 
>


Re: Review Request: CLOUDSTACK-644 add vmware resizeVolume support

Posted by Marcus Sorensen <sh...@gmail.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/9241/#review16009
-----------------------------------------------------------


Can you perhaps find out if there's something you can do to tell the VM that the disk size has changed? For instance with KVM/qemu we have to send libvirt a volBlockResize command so that it actually changes the live system. Or perhaps you just have to rescan the scsi controller inside the vm. If online resize doesn't work at all, there's code in resizeVolume you can use to only support offline resize (checks that the VM is stopped, used by Xen).

- Marcus Sorensen


On Feb. 1, 2013, 9:23 a.m., Hongtu Zang wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/9241/
> -----------------------------------------------------------
> 
> (Updated Feb. 1, 2013, 9:23 a.m.)
> 
> 
> Review request for cloudstack, mice xia and Marcus Sorensen.
> 
> 
> Description
> -------
> 
> add vmware resizeVolume support
> 
> 
> This addresses bug CLOUDSTACK-644.
> 
> 
> Diffs
> -----
> 
>   plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java dd917f7 
>   server/src/com/cloud/storage/StorageManagerImpl.java 07f4d8a 
> 
> Diff: https://reviews.apache.org/r/9241/diff/
> 
> 
> Testing
> -------
> 
> Start a vm using builtin template [CentOS 5.3(64-bit) no GUI (vSphere)].
> Attach two data volumes, one made by disk_offering "Small", another made by "Custom".
> Try to resize the two volumes when vm in running or stopped state.
> After the api finished resize the volume, we found the size changed in the vSphere Client while the size in system is not changed. Reboot the vm and use fdisk to check the disk size, we found the size is changed.
> 
> If we try to shrink the volume, the vsphere will throw an exception, I add a check in the code before resize volume. If the newSize is smaller, it will return false.
> 
> 
> Thanks,
> 
> Hongtu Zang
> 
>


Re: Review Request: CLOUDSTACK-644 add vmware resizeVolume support

Posted by Hongtu Zang <ho...@tcloudcomputing.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/9241/
-----------------------------------------------------------

(Updated Feb. 1, 2013, 9:23 a.m.)


Review request for cloudstack, mice xia and Marcus Sorensen.


Changes
-------

tab alignment, correct some log


Description
-------

add vmware resizeVolume support


This addresses bug CLOUDSTACK-644.


Diffs (updated)
-----

  plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java dd917f7 
  server/src/com/cloud/storage/StorageManagerImpl.java 07f4d8a 

Diff: https://reviews.apache.org/r/9241/diff/


Testing
-------

Start a vm using builtin template [CentOS 5.3(64-bit) no GUI (vSphere)].
Attach two data volumes, one made by disk_offering "Small", another made by "Custom".
Try to resize the two volumes when vm in running or stopped state.
After the api finished resize the volume, we found the size changed in the vSphere Client while the size in system is not changed. Reboot the vm and use fdisk to check the disk size, we found the size is changed.

If we try to shrink the volume, the vsphere will throw an exception, I add a check in the code before resize volume. If the newSize is smaller, it will return false.


Thanks,

Hongtu Zang