Skip to content
This repository has been archived by the owner on Jun 17, 2024. It is now read-only.

Feature Request: Add Additional Disks to Existing Machine #106

Open
mmn01-sky opened this issue Jan 27, 2021 · 11 comments
Open

Feature Request: Add Additional Disks to Existing Machine #106

mmn01-sky opened this issue Jan 27, 2021 · 11 comments

Comments

@mmn01-sky
Copy link

vRA 7.x version
vRA 7.6
Terraform version
Terraform v0.14.5
terraform-provider-vra7 plugin version
2.0.1

Describe the bug
When adding an additional disk to an existing machine, the terraform plan shows the disks will be created however nothing is actually added to the machine. Team which manage vRA7 platform saw no parameters in our terraform reconfigure request which stated additional disks needed adding.

Raising this feature request as per #99 (comment).

To Reproduce
Steps to reproduce the behavior:

  1. Create machine (terraform plan and apply)
  2. Add disk to existing machine
  3. Terraform plan will show additional disk being created
  4. Terraform apply will apply the disk addition and update tfstate however the machine in the platform has no additional disks added.

Expected behavior
Allow the addition of disks to an existing machine.

@encrom
Copy link

encrom commented Feb 1, 2021

Hello guys,

Just facing the same issue .. there is no way I can add a new disk in time of requesting by using vra7 provider (version 3.0.0).
Here my configuration file:

/***********************************************************/
resource "vra7_deployment" "{{ inventory_hostname }}" {
catalog_item_name = "KAU_W2012R2"
wait_timeout = "30" # In minutes
description = "{{ inventory_hostname }}"
lease_days = "{{ lease_days }}"
businessgroup_name = "{{ business_area }}"

resource_configuration {
component_name = "KAU_W2012R2"
configuration = {
description = "{{ inventory_hostname }}"
cpu = "{{ cpu }}"
memory = "{{ ram }}"
storage = "{{ disk }}"
ReservationPolicyID = "{{ reservation_type }}"
}
}

deployment_configuration = {
_number_of_instances = 1
VirtualMachine.Disk1.Size = "20"
VirtualMachine.Disk1.Letter = "D"
}

/***********************************************************/

ERROR Message

es:\r\n\u001b[31m\n\u001b[1m\u001b[31mError: \u001b[0m\u001b[0m\u001b[1mReference to undeclared resource\u001b[0m\n\n\u001b[0m on enrique_2012R2_with_disk_d.tf line 22, in resource "vra7_deployment" "_2012R2_with_disk_d":\n 22: \u001b[4mVirtualMachine.Disk1\u001b[0m.Size = "20"\n\u001b[0m\nA managed resource "VirtualMachine" "Disk1" has not been declared in the root\nmodule.\n\u001b[0m\u001b[0m\n\u001b[31m\n\u001b[1m\u001b[31mError: \u001b[0m\u001b[0m\u001b[1mReference to undeclared resource\u001b[0m\n\n\u001b[0m on _2012R2_with_disk_d.tf line 23, in resource "vra7_deployment" "enrique_2012R2_with_disk_d":\n 23: \u001b[4mVirtualMachine.Disk1\u001b[0m.Letter = "D"\n\u001b[0m\nA managed resource "VirtualMachine" "Disk1" has not been declared in the root\nmodule.\n\u001b[0m\u001b[0m\n"}

Is there anything I am doing wrong?

Thanks a lot for the anwers

@hobovirtual
Copy link

Hi @encrom

For day0 provisioning you need to provide these virtual machine properties under the virtual machine resource_configuration section like this

resource_configuration {
  component_name = "KAU_W2012R2"
  configuration = {
    description = "{{ inventory_hostname }}"
    cpu = "{{ cpu }}"
    memory = "{{ ram }}"
    storage = "{{ disk }}"
    ReservationPolicyID = "{{ reservation_type }}"
    "VirtualMachine.Disk1.Size" = "20"
    "VirtualMachine.Disk1.Letter" = "D"
  }
}

What is describe in this feature request is different. Today day2 actions are limited in the vra7 provider, like adding disk.

hope this helps a bit!
thanks!

@encrom
Copy link

encrom commented Feb 2, 2021

hey @hobovirtual

Thanks a lot for answering. This is my particular situation always refering about the day0 actions.

I have tested as you said and a new errors shows that I assume is about some kind of configuration on the vRA itself.

[Cannot add 2 disks for Component KAU_W2012R2. Maximum number of volumes is set at 1.]

Should I assume this is something about the vRA configuration or even about the Blueprint configuration?

Thanks a lot for the answers.

bests!

@encrom
Copy link

encrom commented Feb 4, 2021

Just to point that everything works fine now.

Thanks a lot for the quick answer.

Bests,
@encrom

@ankujuniyal
Copy link

ankujuniyal commented Mar 23, 2021

hi @hobovirtual via api my templet look like same as mention https://github.com/vmware/terraform-provider-vra7/blob/master/website/docs/r/BasicSingleMachine.yaml

"disks": [
{
"classId": "Infrastructure.Compute.Machine.MachineDisk",
"componentId": null,
"componentTypeId": "com.vmware.csp.iaas.blueprint.service",
"data": {
"capacity": 100,
"custom_properties": null,
"id": 15442,
"initial_location": "",
"is_clone": true,
"label": "Hard disk 1",
"storage_reservation_policy": "",
"userCreated": false,
"volumeId": 0
},
"typeFilter": null
},
{
"classId": "Infrastructure.Compute.Machine.MachineDisk",
"componentId": null,
"componentTypeId": "com.vmware.csp.iaas.blueprint.service",
"data": {
"capacity": 200,
"custom_properties": null,
"id": 159042,
"initial_location": "/application",
"is_clone": false,
"label": "app_lv",
"storage_reservation_policy": "",
"userCreated": true,
"volumeId": 1
},
"typeFilter": null
}
],

I tried using
"VirtualMachine.Disk1.Size" = "20"
"VirtualMachine.Disk1.Letter" = "D"
but didn't work for me.

@sabhi66
Copy link

sabhi66 commented Mar 30, 2021

@ankujuniyal Even I'm facing the same issue. I need to increase storage for existing mount paths.

@hobovirtual
Copy link

hi @ankujuniyal

i don't work much with vra7 anymore, but couple of things to note here

  1. these properties are only working during the initial deployment, they cannot be added on existing machine, the vra7 provider is still limited in terms of day2 actions
  2. with the latest version, you need to add these properties in the configuration section of the resource_configuration as mentioned above.
  3. tested this with vra 7.6 and provider 3.0.2 and it works as expected

If you share your manifest we could maybe point out what should be modified to make it work for you :)

thanks!

@sabhi66
Copy link

sabhi66 commented Mar 31, 2021

Hi @hobovirtual I'm trying to increase storage for the existing
mount paths here's my VRA storage pic

How can I increase mounted paths storage for a new deployment

@hobovirtual
Copy link

Hi @sabhi66

This is currently not supported in the current provider, i just revised this issue and this is the feature request for disk “day2” actions ;)

I will let @Prativa20 or @markpeek discuss if this is coming....

Thanks!

@sabhi66
Copy link

sabhi66 commented Mar 31, 2021

Hi @hobovirtual

Thanks for the update

@ankujuniyal
Copy link

@sabhi66 @hobovirtual I even try with Day1 action but didn't find storage on request at VRA side.
here is main.tf file

resource "vra7_deployment" "vm" {
count = var.no_of_vm
catalog_item_name = var.vm_image
description = var.vm_request_description
reasons = var.vm_request_description
lease_days = var.lease_days
wait_timeout = 30

deployment_configuration = {
"VirtualMachine.Disk2.Size" = 100
}
resource_configuration {
component_name = var.vm_image_json_root
cluster = 1
configuration = {
"Form.App" = var.lob
"Form.BU" = var.bu
"Form.Environment" = var.zone
"Form.Function" = "App"
"Vrm.DataCenter.Location" = var.datacenter
cpu = var.cpu
memory = var.ram
}
}
}

Is there any way i can see catalog schema requested to VRA on terrafrom side as i don't have vra admin access so cant see logs on other side.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants