You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Please list the steps required to reproduce the issue, for example:
terraform import vm path
terraform plan
Work Around
I've managed to correct the issues by manually mangling the state and setting disk.1.attach: true and applying these diffs which is probably not the right way to do it.
diff --git a/vsphere/internal/virtualdevice/virtual_machine_disk_subresource.go b/vsphere/internal/virtualdevice/virtual_machine_disk_subresource.go
index 4197a50..4a326e3 100644
--- a/vsphere/internal/virtualdevice/virtual_machine_disk_subresource.go
+++ b/vsphere/internal/virtualdevice/virtual_machine_disk_subresource.go
@@ -612,6 +612,7 @@ func DiskDiffOperation(d *schema.ResourceDiff, c *govmomi.Client) error {
nds := n.([]interface{})
normalized := make([]interface{}, len(ods))
+ log.Printf("What is nds: %#v", nds)
nextNew:
for _, ne := range nds {
nm := ne.(map[string]interface{})
@@ -628,6 +629,8 @@ nextNew:
// We extrapolate using the label as a "primary key" of sorts.
if nname == oname {
r := NewDiskSubresource(c, d, nm, om, oi)
+ log.Printf("Super messed up NM: %#v", nm)
+ log.Printf("Super messed up OM: %#v", om)
if err := r.DiffExisting(); err != nil {
return fmt.Errorf("%s: %s", r.Addr(), err)
}
@@ -1397,10 +1400,11 @@ func (r *DiskSubresource) DiffExisting() error {
// we might want to change the name of this method, but we want to check this
// here as CustomizeDiff is meant for vetoing.
osize, nsize := r.GetChange("size")
- if osize.(int) > nsize.(int) {
- return fmt.Errorf("virtual disk %q: virtual disks cannot be shrunk (old: %d new: %d)", name, osize.(int), nsize.(int))
+ if !r.Get("attach").(bool) {
+ if osize.(int) > nsize.(int) {
+ return fmt.Errorf("virtual disk %q: virtual disks cannot be shrunk (old: %d new: %d)", name, osize.(int), nsize.(int))
+ }
}
-
// Ensure that there is no change in either eagerly_scrub or thin_provisioned
// - these values cannot be changed once set.
if _, err = r.GetWithVeto("eagerly_scrub"); err != nil {
The text was updated successfully, but these errors were encountered:
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.
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 feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 hashibot-feedback@hashicorp.com. Thanks!
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 feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 hashibot-feedback@hashicorp.com. Thanks!
Terraform Version
0.11.13
vSphere Provider Version
Master (with local patches for work around)
Affected Resource(s)
Please list the resources as a list, for example:
vsphere_virtual_machine
vsphere_virtual_disk
Terraform Configuration Files
Debug Output
Can't add debug but i will add any lines that are requested.
Panic Output
NA
Expected Behavior
Import disk correctly and use size from attached disk.
Actual Behavior
Steps to Reproduce
Please list the steps required to reproduce the issue, for example:
terraform import vm path
terraform plan
Work Around
I've managed to correct the issues by manually mangling the state and setting disk.1.attach: true and applying these diffs which is probably not the right way to do it.
The text was updated successfully, but these errors were encountered: