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

[FEATURE REQUEST] Determine idempotence requirements #11

Open
mthibaut opened this issue May 11, 2023 · 2 comments
Open

[FEATURE REQUEST] Determine idempotence requirements #11

mthibaut opened this issue May 11, 2023 · 2 comments
Labels
enhancement New feature or request

Comments

@mthibaut
Copy link
Contributor

** Decide on semantics **
- Is salt-cloud (meant to be) idempotent? It currently is not in proxmox.py
- Should salt-cloud fail if a machine exists? It currently does.
- Should salt-cloud fail if the VM ID exists? In proxmox.py it currently does (once we implement this feature, see )

Describe the solution you'd like
Unsure.

Additional context
Calling salt-cloud -p myprofile myguest fails if myguest exists. Is this expected behavior?

@I3urny
Copy link
Contributor

I3urny commented Jun 30, 2023

I don't think that salt-cloud in general or rather cloud providers should be idempotent. What should be idempotent is the use of the Cloud Map File in salt-cloud.

Cloud maps let you define a map of your infrastructure and quickly provision any number of VMs. On subsequent runs, any VMs that do not exist are created, and VMs that are already configured are left unmodified.

I did not find such a definition anywhere for the creation of VMs via salt-cloud -p.

So my answers to your questions are:

  1. No, proxmox.py should not be idempotent. Idempotence is handled through Cloud map files.
  2. Yes, trying to create a new machine that already exists via salt-cloud -p should fail.
  3. Yes, trying to create a new machine with an already existing VM ID via salt-cloud -p should fail.

@nicholasmhughes
Copy link
Member

True idempotence likely won't be achieved in the cloud module without changes to the underlying salt-cloud code. Currently, salt-cloud will create any instances where the name is not found in the cloud. If the name is found, it will not be created. If the configuration is changed for a given instance, the instance will need to be destroyed and created again for the change to take effect. Instance configuration cannot be enforced with salt-cloud.

That said, there's no reason that we can't create execution and state modules for idempotent creation and maintenance of cloud instances. There was a push toward this in a recent release of the Azure Extension.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants