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

VDC VM placement policies #898

Closed
cbotha opened this issue Aug 9, 2022 · 17 comments
Closed

VDC VM placement policies #898

cbotha opened this issue Aug 9, 2022 · 17 comments
Assignees

Comments

@cbotha
Copy link

cbotha commented Aug 9, 2022

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
@adambarreiro
Copy link
Collaborator

Hi @cbotha, thanks for the suggestion. We will be implementing this new feature in PR #904.

Best regards.

@Piedro1
Copy link

Piedro1 commented Sep 12, 2022

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.

@adambarreiro
Copy link
Collaborator

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.

@adambarreiro
Copy link
Collaborator

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.

@cbotha
Copy link
Author

cbotha commented Dec 1, 2022 via email

@adambarreiro
Copy link
Collaborator

Thanks for the feedback, @cbotha, really appreciated.
Will check that one.

@adambarreiro
Copy link
Collaborator

@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?

@cbotha
Copy link
Author

cbotha commented Dec 6, 2022

@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)?

@cbotha
Copy link
Author

cbotha commented Dec 6, 2022

Regarding PR#948. Would love to try it out indeed. Do you guide handy of how to make use of this branch?

@Didainius
Copy link
Collaborator

@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

@cbotha
Copy link
Author

cbotha commented Dec 6, 2022

@Didainius No complier unfortunately. I'm using an intel based Mac

@Didainius
Copy link
Collaborator

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

@cbotha
Copy link
Author

cbotha commented Dec 6, 2022

#898 (comment).
@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?

@Didainius
Copy link
Collaborator

@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

@cbotha
Copy link
Author

cbotha commented Dec 7, 2022

@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
Copy link
Collaborator

@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.

@Didainius
Copy link
Collaborator

@cbotha , v3.8.1 is now released

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

No branches or pull requests

4 participants