terraform-provider-vcd
terraform-provider-vcd copied to clipboard
VDC VM placement policies
Community Note
- Please vote on this issue by adding a π reaction to the original issue to help the community and maintainers prioritize this request
- Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
- If you are interested in working on this issue or have submitted a pull request, please leave a comment
Description
New or Affected Resource(s)
- vcd_org_vdc
Desperately need the capability to add pre-created VM placement policies to VDCs. UI flow = Resources > Organisation VDCs > Select VDC Name > Policies > VM Placement > ADD policy
### References
<!---
Information about referencing Github Issues: https://help.github.com/articles/basic-writing-and-formatting-syntax/#referencing-issues-and-pull-requests
Are there any other GitHub issues (open or closed) or pull requests that should be linked here? Vendor blog posts or documentation? For example:
--->
* Issue #0000
Hi @cbotha, thanks for the suggestion. We will be implementing this new feature in PR #904.
Best regards.
Hi, glad this feature is also made available. Will it be possible to list and choose a placement policy as a tenant administrator? I would like to test this feature if possible.
Hi @cbotha @Piedro1, the request suggested here has been merged to the main branch. It is still not officially released, but you can build the Provider from the source code and try it out. We can help with that if required.
Please note that the complete journey for VM Placement Policies is not 100% complete though, we still need to onboard them to the VM resource/data source to be able to use them. What we merged so far enables users to assign VM Placement Policies to VDCs, creating VM Placement Policies and fetching them.
Hello,
Since v3.8.0, released a few days ago, both vcd_vapp_vm and vcd_vm support assigning and reading VM Placement Policies (also they can be assigned to VDCs for that purpose, and created with the new vcd_vm_placement_policy resource)
Please have a look at the changelog here for the list with all the new features and improvements on this regard.
Thanks for the feature request and best regards.
Hi
Thanks for the update.
I tried the new provider this morning, but I canβt seem to get it working. In my case I would like to add an existing placement policy to a new VDC upon creation.
I added the following to my plan:
data "vcd_provider_vdc" "pvdc" { name = local.tenant.vdc_pvdc_name }
data "vcd_vm_group" "vmgroup-windows" { name = "WindowsVMgroup" provider_vdc_id = data.vcd_provider_vdc.pvdc.id }
data "vcd_vm_placement_policy" "Existing-policy-1" { name = "Windows" provider_vdc_id = data.vcd_provider_vdc.pvdc.id }
However, it seems like it doesn't like the fact that our PVDC has numerous resource pools backing it
Error: could not find any VM Group with name WindowsVMgroup and pVDC urn:vcloud:providervdc:8cad2615-b37c-4d64-8e1c-2a324be2f8e2: could not get VM Group: more than one Resource Pool found for the pVDC: urn:vcloud:providervdc:8cad2615-b37c-4d64-8e1c-2a324be2f8e2
Thanks for the feedback, @cbotha, really appreciated. Will check that one.
@cbotha I can confirm you that this is indeed a bug present in v3.8.0. PR #948 should fix it, as well as adding an improved way to retrieve VM Placement Policies for tenants (who can't see Provider VDC details).
Would it be possible to try out that branch?
@adambarreiro On another note but still placement policy related. I've also been trying to add placement policies to VMs and vAPPS as a tenant. However I noticed that I required a PVDC data point which I can only obtain as a System admin. Is there a way to make use of "placement_policy_id" as an org admin (tenant perspective)?
Regarding PR#948. Would love to try it out indeed. Do you guide handy of how to make use of this branch?
@cbotha ,
Do you have Go compiler?
If yes - then you could checkout that PR branch and do make install
in the root directory of provider
If not - I can help and build you a provider binary from that branch. I just need to know what architecture you are on
@Didainius No complier unfortunately. I'm using an intel based Mac
Ok. I have built the plugin with code of PR #948 for you and put it into one drive. This is a link to macOS Intel binary -> https://onevmw-my.sharepoint.com/:u:/g/personal/dserplis_vmware_com/ERSOH4aEbJFIo5aogoLwLlIBez2L-9rTlsI1OflHlTVjzQ?e=1lRWFI
It should be placed in the path as per my below example path (replace _YOUR_USERNAME_ with your name). Name of the file must be kept as it is.
Doing a terraform init
with the version directive being bound to 3.8.1 should pick it up.
$ tree ~/.terraform.d
/Users/_YOUR_USERNAME_/.terraform.d
βββ checkpoint_cache
βββ checkpoint_signature
βββ plugins
βββ registry.terraform.io
βββ vmware
βββ vcd
βββ 3.8.1
βββ darwin_amd64
βββ terraform-provider-vcd_v3.8.1
https://github.com/vmware/terraform-provider-vcd/issues/898#issuecomment-1335408057. @Didainius and @adambarreiro Provider 3.8.1 indeed addresses my issue with adding placement policies to a VDC. Thanks!
I'm also interested in testing below. @adambarreiro mentioned "as well as adding an improved way to retrieve VM Placement Policies for tenants (who can't see Provider VDC details)." Where can I find some docs or guidance on how to retrieve and use placement polices as a tenant with 3.8.1?
@cbotha , The updated docs are in the pull request with code (not very convenient to read) -> https://github.com/vmware/terraform-provider-vcd/pull/948/files#diff-27a45d60496303f9879e488d3001850c476b43fffe9e2c6ae934b8e6d68db6a4R43-R64
@Didainius and @adambarreiro Thanks! this indeed also solved this issue. Any idea when these changes will be available in the official provider? Will there be a version bump to 3.8.1?
@Didainius and @adambarreiro Thanks! this indeed also solved this issue. Any idea when these changes will be available in the official provider? Will there be a version bump to 3.8.1?
Yep. We will release 3.8.1 with these fixes. We still have to do some more testing, but it should be out in 1-2 weeks.
@cbotha , v3.8.1 is now released