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

Add resource for managing VM state #492

Open
xorel opened this issue Oct 9, 2023 · 5 comments
Open

Add resource for managing VM state #492

xorel opened this issue Oct 9, 2023 · 5 comments

Comments

@xorel
Copy link
Member

xorel commented Oct 9, 2023

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

OpenNebula documentation

@frousselet
Copy link
Collaborator

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?

@xorel
Copy link
Member Author

xorel commented Oct 16, 2023

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

@frousselet
Copy link
Collaborator

frousselet commented Oct 16, 2023

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)
}

@xorel
Copy link
Member Author

xorel commented Oct 16, 2023

Looks good to me

Copy link

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.

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

3 participants