Comments (7)
Hi @denizcandas
Thank you for this really complete explanation.
This is really interesting. I add this into the 0.3.0 release. It should be tested very well and it represents a huge work on the VM resource.
I cannot give an ETA yet.
from terraform-provider-opennebula.
What would the desired behavior be, if the user uses this flag and the pending flag at the same time? Should the pending flag be overridden? I have also noticed that if we create a VM with pending=true, the VM is still in HOLD even if the resource is applied with pending=false. It has an effect only during creation. However, desired_state attribute would be applied during create and update operations. For now, I'll add a default ignore option for the user, which does not attempt to do anything.
from terraform-provider-opennebula.
If the user enables pending and a state except ignore, the VM will be on HOLD during creation. If the user sets the desired_state to any value except ignore and updates the VM, then the VM will be first released, and then the desired_state will be satisfied. As HOLD is not a state which can be resumed from with onevm's resume command, and not a state which can be attained after the vm has been activated, it is not a possible value for desired_state.
from terraform-provider-opennebula.
Hi @denizcandas
If I understand your need you want to manage VM state via Terraform ?
This feature is really interesting, however there are some point to be taken into account:
- The VM is currently running, you update the VM to set
desired_state
tostopped
: you stop the VM: OK - The VM is currently stopped, you update the VM to set
running
: do you expect to restart the VM ? - The VM is currently running, you update the VM to set
desired_state
toundeploy
: you undeploy the VM: OK - The VM is currently undeployed, you update the VM to set
desired_state
torunning
: Do you expect to deploy it ? - The VM is currently "on hold": some desired state are not available: you are locked.
- ... (there are lots of combinations)
I think you should clarify all possible states with the one currently manage directly by OpenNebula:
http://docs.opennebula.io/5.10/operation/references/vm_states.html?highlight=state#diagram
Keep in mind too that Terraform is not designed to host another state machine: it is only here to deploy and manage infrastructure ;).
The more you add possible values for desired_state
, the more complex it is to manage the code.
To ease the review of #33, can you prepare a diagram of what to you expect ? This is to avoid long exchanges
Thanks
from terraform-provider-opennebula.
Hello @jaypif
I have created an example state machine diagram for the plugin and also took out all the relevant states from the opennebula diagram.
The relevant states that might have to be handled, the desired states are the four states which can be transformed using a onevm command:
Edit: Between hold and inactive states, it should be "desired_state = inactive"
Edit2: Fixed and improved the state transitions. One transition should happen when terraform apply is called, except the dashed one which should be immediately applied if its requirements are met.
Thank you :)
from terraform-provider-opennebula.
Hi I will change the milestone to 0.4.0.
The PR #33 should be rebased too
from terraform-provider-opennebula.
This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 5 days
from terraform-provider-opennebula.
Related Issues (20)
- How to set the owner of a virtual network? HOT 3
- ```cpumodel``` Crash report HOT 1
- virtual machine (ID: 14): unexpected state 'POWEROFF', wanted target 'RUNNING'. last error: %!s(<nil>) HOT 2
- Impossible to update context of Virtual Router instances
- Add memory, CPU and disk costs in the template resource HOT 2
- It is not possible to add more than a PCI device (passthrough) to a VM HOT 1
- Error creating Ceph Datastore: "SYSTEM datastores cannot have DS_MAD defined"
- Trailing space in `CEPH_HOST` when creating a Ceph datastore
- Missing Data Source for opennebula_virtual_network_address_range
- `opennebula_service` does not honor idempotence (OneKE) HOT 2
- `opennebula_virtual_router_nic`: Add floating_only argument
- Extend `nic` section, add missing arguments like METHOD, GATEWAY or DNS..
- When attempting to create a Ceph datastore of type "IMAGE", the following error occurs: HOT 4
- `opennebula_service` should support role scale operation HOT 1
- VNet address reservation on VNet (inside cluster) looses cluster_ids information on subsequent terraform apply runs HOT 1
- Terraform loses disk in state after resize HOT 2
- Extend "os" section, adding other OS sub-attributes in opennebula_template HOT 1
- Manually Deleted VMs are not recreated HOT 2
- Add `IP` to `opennebula_virtual_router_nic`
- image owner changing
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from terraform-provider-opennebula.