-
Notifications
You must be signed in to change notification settings - Fork 454
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
Add support to check the power state of r/virtual_machine
#916
Comments
This issue has been open 180 days with no activity. If this issue is reproducible with the latest version of the provider and with Terraform 0.12, please comment. Otherwise this issue will be closed in 30 days. |
As per referenced issue, Terraform doesn't understand the concept of power off versus on. It's either on, or non-existent. Nonetheless, you can use a null resource with the |
Given some recent changes and new use cases, we will actually be supporting power state management in VMs soon. It is high on our backlog. |
@bill-rich |
@bill-rich Any idea by when this enhancement will be taken up or already in progress? |
@uutest74 Have you been able to get around this power state management issue? Also, do you know what all changes will be needed to get this functionality into vsphere provider? Any help here would be really appreciated. Thanks in advance. |
@sumitmaggo, you might be able to use a provisioner in a "null_resource" (https://registry.terraform.io/providers/hashicorp/null/latest/docs/resources/resource) which uses the To determine the vm properties (and check the vm state), you'd combine that "null_resource" provisioner with an "external" provider (https://registry.terraform.io/providers/hashicorp/external/latest/docs/data-sources/data_source) that queries the vm properties using I haven't fiddled with tf v0.13 or v0.14's new lifecycle stuff, though (still on v0.12), so I'm not exactly 100% on this... |
@arizvisa Thanks for the details. Meanwhile I have created a pull request for checking the power state for VM and will wait for any feedback for the same. |
Anything new here? |
+1 to this 🥺 I also have a use-case where I need to keep VMs powered down until required. |
virtual_machine
resource
virtual_machine
resourcer/virtual_machine
This functionality has been released in v2.1.1 of the Terraform Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you! |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
Hi
How to check power state of VM and power on using terraform?
in this issue #327
you say that no plan to add power state of vm to terraform. I dont know why it so difficult to add this property to tfstate, simple option in vsphere_virtual_machine and 2 function from govmomi to power control vm...
But may be we can use null_resource for that? i dont know how to check power sate in triggers
P.S. In infrastructure as code concept if VM crashes and poweroff, how we power on it? Ansible not capable, Terraform aslo say all OK.... only manual...
The text was updated successfully, but these errors were encountered: