terraform-provider-opennebula
terraform-provider-opennebula copied to clipboard
Add resource for managing VM state
Description
While opennebula_virtual_machine
can create and destroy the VM, it would be nice to have a resource to handle the VM state.
New or affected resources and data sources
new: opennebula_virtual_machine_state
Potential terraform configuration
resource "opennebula_virtual_machine_state" "vm_state" {
opennebula_virtual_machine_state = var.vm_id
state = "undeployed"
}
References
Hello @xorel,
I am not sure to understand why we would need a dedicated state resource. What do you mean by 'handle the VM state'? Do you have some use cases?
I am not 100% sure it fits well into Terraform design but my intention is to be able to undeploy VM.
I think it might be similar to aws_ec2_instance_state
If I understand the AWS issue regarding the state resource, they did this because they need it to be usable with AWS STS.
In our case I'm quite sure we can integrate it as an attribute of opennebula_virtual_machine
.
So I am thinking about something like this:
resource "opennebula_virtual_machine" "example" {
# ...
state = "Stopped" # or "Running" (default) or "Undeployed" or "Suspended" or "PowerOff"
hard = true # or false (default)
}
Looks good to me
This issue is stale because it has been open for 30 days with no activity and it has not the 'status: confirmed' label or it is not in a milestone. Remove the 'status: stale' label or comment, or this will be closed in 5 days.