Skip to content
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

Increasing a hard disk's size is resulting in VM shutdown #728

Closed
GeorgiosGoniotakis opened this issue Oct 15, 2021 · 9 comments · Fixed by #758
Closed

Increasing a hard disk's size is resulting in VM shutdown #728

GeorgiosGoniotakis opened this issue Oct 15, 2021 · 9 comments · Fixed by #758
Assignees
Labels

Comments

@GeorgiosGoniotakis
Copy link

Hello friends 😃

I am facing an issue when trying to extend the disk size of an existing hard disk. The hard disk has been created using Terraform. When trying to increase the size of the disk via Terraform and deploy the changes, it causes the server to shutdown. However, the disk's size is successfully updated.

When trying to manually extend a hard disk on the VMWare cloud platform, no reboot is required. So, I thought that it would be the same case when using the Terraform provider. Lastly, I experimented with the allow_vm_reboot parameter which did not improve the situation. The bus_type of the disk is paravirtual. Any feedback would be much appreciated.

Terraform v1.0.7

Affected Resource(s)

Please list the resources as a list, for example:

  • vcd_vm_internal_disk

Terraform Configuration Files

resource "vcd_vm_internal_disk" "vm_disk" {
  for_each = var.disks_map

  vapp_name       = each.value.vapp_name
  vm_name         = each.value.vm_name
  bus_number      = each.value.bus_number
  unit_number     = each.value.unit_number
  bus_type        = each.value.bus_type
  size_in_mb      = each.value.size_in_mb
  allow_vm_reboot = true
}

Expected Behavior

Hard disk's size should have increased without causing a VM shutdown.

Actual Behavior

Hard disk's size was increased but VM was shut down and was not turned on back automatically again.

@GeorgiosGoniotakis
Copy link
Author

Hello @vbauzysvmware I hope my message finds you well. Is there any update on this please?

@vbauzys
Copy link
Contributor

vbauzys commented Nov 24, 2021

Hi @GeorgiosGoniotakis I will look into this when I finish the current feature I am working on. I hope this happens soon.

@GeorgiosGoniotakis
Copy link
Author

Thank you for letting me know @vbauzysvmware Much appreciated.

@vbauzys
Copy link
Contributor

vbauzys commented Dec 15, 2021

Hi @GeorgiosGoniotakis

I checked the code and seems to be ok and tried to reproduce the case, but in the examples I used, VM wasn't restarted.
For e.g.

resource "vcd_vapp_vm" "TestAccVcdVAppVmWithVmSizingVM" {
  vapp_name     = vcd_vapp.TestAccVcdVAppVmWithVmSizing.name
  name          = "TestAccVcdVAppVmWithVmSizingVM"

  computer_name = "TestInternalDiskVmUnique"
  catalog_name  = "cat-vb"
  template_name = "photon-hw11"
  memory        = 1024
  cpus          = 1
  cpu_cores     = 1
}

resource "vcd_vm_internal_disk" "disk1" {
  vapp_name       = vcd_vapp.TestAccVcdVAppVmWithVmSizing.name
  vm_name         = vcd_vapp_vm.TestAccVcdVAppVmWithVmSizingVM.name
  bus_type        = "paravirtual"
  size_in_mb      = "14333"
  bus_number      = "1"
  unit_number     = "0"
  storage_profile = "*"
  allow_vm_reboot = "true"
}

could you provide more information? like HCL which makes VM restart, share also what terraform plan shows and logs.

@GeorgiosGoniotakis
Copy link
Author

Hello @vbauzysvmware After extending the disk size we noticed that the server is shutting down, not rebooting. May I ask which version of the Terraform provider you used to reproduce this please?

@vbauzys
Copy link
Contributor

vbauzys commented Dec 15, 2021

I was checking with Terraform v1.0.11

Shutting down is even more mistic as this resource only power off, change the size, power on, and only for IDE type. So the culprit could be somewhere else.

@vbauzys
Copy link
Contributor

vbauzys commented Dec 16, 2021

I found one issue and made a change. I hope it was you faced.

@GeorgiosGoniotakis
Copy link
Author

Hello @vbauzysvmware Happy New Year! Sorry for the late reply. I tested the latest version of the provider last night and I can confirm that this has indeed been fixed. Thank you for having a look into that.

@vbauzys
Copy link
Contributor

vbauzys commented Jan 5, 2022

Great, thank you for testing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
3 participants