-
Notifications
You must be signed in to change notification settings - Fork 452
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support to resize r/vsphere_virtual_disk
#851
Comments
#150 mentions resizing 10 comments deep, but it is phrased as a question. I don't think it qualifies as a duplicate since the original message itself doesn't address resizing nor does its proposed solution. I believe resizing doesn't necessarily require stopping the VM, but I have not figured out how to do that in the vcenter UI yet. |
I just wanted to clarify that it doesn't need to be 'lazy' to resize, both 'lazy' and 'eagerZeroedThick' are confirmed resizable but I have not tested 'thin'. Resizing works while it is mounted to a running vsphere_virtual_machine, but the volume still needs to be manually expanded (this is normal and expected). It doesn't seem to work at all when it is mounted to a vsphere_virtual_machine with the disk_sharing='sharingMultiWriter' option. |
This issue has been open 180 days with no activity. If this issue is reproducible with the latest version of the provider and with Terraform 0.12, please comment. Otherwise this issue will be closed in 30 days. |
Adding comment to keep this alive. It is very much an issue still. |
Issue is happening in 0.12.23 |
Hello Colleagues, we are still facing this issue We need to use the disk for logsearch and cassandra for which resizing will be regularly required.. |
@bill-rich: Could you please help in taking forward this enhancement request |
I notice there's no |
Also interested in having the ability to resize vsphere_virtual_disks. |
@dcardellino, please +1 the first comment in this issue so your request reaches hashicorp's analytics (or whatever they're doing). |
@dcardellino very much a issue we need addressing as well. Any timeline for this ? Thanks |
+1 here |
Any Update here? |
Any update ? |
Any Update |
Struggling to find a way to resize disk partition with terraform for VM created from packer template. |
@rihenperry, you can script the govc client using the vm.disk.change parameter until you or someone else submits a PR to get the implementation of this feature jumpstarted. |
any updates on resizing disks, we really want need this feature. |
Has anyone got any suggestions, we clone from a template VM with a 30GB didk to a 50GB disk, the VM shows as having a 50 GB disk but cant see the free space anywhere in the rhel VM to extend logical volumes ? |
+1 |
1 similar comment
+1 |
Ugh. As a reminder, please do not put "+1" as an additional comment. nobody will _ever_ see that shit unless they're already part of the issue in question... you need to +1 the original post. |
Please be mindful of language and the code of conduct. |
Isnt this always a problem to be solved by a provisioner with access to the os running/using the disks ? In linux you would rescan the scsi bus and resize the disks via something like echo 1 > /sys/class/scsi_disk/2\:0\:0\:0/device/rescan # adjust device number
growpart /dev/sda 2
# then for lvm
pvresize /dev/sda2
lvextend -l+100%FREE /dev/srv-git-vg/root
resize2fs /dev/mapper/srv--git--vg-root
# or for normal partitions
resize2fs /dev/sda2 I think you can even do this via cloud-init on boot ? In Windows this can be done by powershell as well if i remember correctly... TLDR
The first is working with terraform at least with thin prov disks for me. If this issue is only about the third variant, the subject of the issue should be adjusted to reflect that |
The OS maps the device to a physical volume and then to a logical volume so it is true that it must get involved to make the actual volume increase in size, but the prerequisite is the device has been resized first and that is done by VSphere by modifying the virtual disk. We are not asking to solve the OS side of the problem, but we want to be able to increase the virtual disk size via terraform. Right now the workaround is to manually increase the disk size in the VCenter UI then update the terraform resource to match the manual change. We want to just be able to update the terraform resource to increase disk (not decrease). Decreasing size is outside of scope since it would destroy the volume if the OS had already claimed the new space. |
@jsmilani Yeah, i misread something here... can i downvote my own comment ? :) |
Votes are only counted on the original |
vsphere_virtual_disk
resource
vsphere_virtual_disk
resourcevsphere_virtual_disk
resource
vsphere_virtual_disk
resourcer/vsphere_virtual_disk
Somewhat related, when doing a terraform destroy after updating a template that has a different sized vmdk, terraform fails with error. Is it possible to have the delete action ignore this specific error?
|
It’s been 3 years now. 28 votes so far. How many does it need to get this going? I know this is voluntarily work and I wish I could PR this (don’t get it to work) … |
I'm unable to contribute to this software anymore as it was originally for a one-off thing and I don't use it anymore, but as per my question 2y ago (#851 (comment)), it "seems" like one would just need to add an "Update" field to terraform-provider-vsphere/vsphere/resource_vsphere_virtual_disk.go Lines 32 to 42 in bc3f8d5
Which appears pretty similar to the following snippet...
However you'd probably want to add some abstractions for resizing to https://github.com/hashicorp/terraform-provider-vsphere/blob/main/vsphere/internal/helper/virtualdisk/virtual_disk_helper.go that's similar to this disk sizing code from govc (https://github.com/vmware/govmomi/blob/b505edbbb3b58ced3c2ea6cf8fb2fb2860302721/govc/vm/disk/change.go#L155). That'd likely get some of govc's Anyways, feel free to correct me if my assumptions are incorrect. |
Hi all, The ExtendVirtualDisk method of VirtualDiskManager is missing from the govmomi: However, the method is present in the vim API. We'll need to:
Regards, |
Awesome. |
This functionality has been released in v2.8.3 of the Terraform Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you! |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
Right now the vsphere_virtual_disk resource does not permit any changes, but we need to increase disk size on occasion. It is unreasonable to expect us to find a manual workaround to copy data from an old disk to a new larger disk. I would understand requiring a new disk when decreasing the size since that is generally not possible on most systems. During our tests we found the 'eagerZeroedThick' type does not allow resizing by vSphere but 'lazy' should permit increases in size.
Terraform Version
0.12.x
vSphere Provider Version
1.12.0
Affected Resource(s)
Please list the resources as a list, for example:
vsphere_virtual_disk
Expected Behavior
We expect to be able to increase the size of a type='lazy' vsphere_virtual_disk.
Actual Behavior
Disk wants to be recreated and we will lose all data.
The text was updated successfully, but these errors were encountered: