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

r/datastore_cluster_vm_anti_affinity_rule: New resource #520

Merged

Conversation

vancluever
Copy link
Contributor

This contains the full CRUD/tests/docs for the
vsphere_datastore_cluster_vm_anti_affinity_rule resource.

One thing to note here - during testing, it was found that a
virtual_machine_ids length of less than 2 is essentially a no-op on the
cluster, resulting in no rules created. This was causing issues where
the apply was succeeding but no rule was being returned, resulting in
odd errors post-creation. In addition to this, we cannot restrict this
with MinItems, as there currently seems to be an issue calculating the
length of a glob of computed values - ie:
vsphere_virtual_machine.vm.*.id, even when the count in
vsphere_virtual_machine is static.

If I'm assuming correctly, this is because when the computed/unknown
value is seen, the entire field becomes unknown with a length of 1,
regardless of if the final length is known beforehand.

Further reading can be found at:
hashicorp/terraform#14677 (comment)

@vancluever vancluever added enhancement Type: Enhancement new-resource Feature: New Resource labels May 10, 2018
@vancluever vancluever requested a review from a team May 10, 2018 04:05
Copy link
Contributor

@bill-rich bill-rich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One comment to address on the docs. Looks good other than that!


The following arguments are supported:

* `compute_cluster_id` - (Required) The [managed object reference
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be datastore_cluster_id

@vancluever
Copy link
Contributor Author

Updated!

This contains the full CRUD/tests/docs for the
vsphere_datastore_cluster_vm_anti_affinity_rule resource.

One thing to note here - during testing, it was found that a
virtual_machine_ids length of less than 2 is essentially a no-op on the
cluster, resulting in no rules created. This was causing issues where
the apply was succeeding but no rule was being returned, resulting in
odd errors post-creation. In addition to this, we cannot restrict this
with MinItems, as there currently seems to be an issue calculating the
length of a glob of computed values - ie:
vsphere_virtual_machine.vm.*.id, even when the count in
vsphere_virtual_machine is static.

If I'm assuming correctly, this is because when the computed/unknown
value is seen, the entire field becomes unknown with a length of 1,
regardless of if the final length is known beforehand.

Further reading can be found at:
hashicorp/terraform#14677 (comment)
compute_cluster_id should be datastore_cluster_id and explain itself in
the correct context of datastore clusters, not compute clusters.
@vancluever vancluever force-pushed the f-vsphere-datastore-cluster-vm-anti-affinity-rule-resource branch from 1e087d4 to e370f1f Compare May 11, 2018 14:09
@vancluever vancluever merged commit 2fd74c7 into master May 11, 2018
@bill-rich bill-rich deleted the f-vsphere-datastore-cluster-vm-anti-affinity-rule-resource branch November 17, 2018 00:36
@ghost ghost locked and limited conversation to collaborators Apr 18, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement Type: Enhancement new-resource Feature: New Resource
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants