Closed zaibon closed 6 years ago
@zaibon, now we raise an error if machine already exists, what should be done instead? Delete the machine?
well since you know the VM is in a undefined state, this is probably the most sane thing to do.
@zaibon , what if the machine was created and being used by another robot? If action:install
is not ok
it might be that this machine was installed before by another user. Is this situation possible? Then we might be deleting machine used by someone/something else.
Is it an option to add a flag to schema, something like createNew=False
, so only if we explicitly set it to createNew=False
, old machine gets removed. And otherwise will just throw an error.
I don't like how the install logic is: https://github.com/openvcloud/0-templates/blob/1e98b285c32474a5621e145b6a8563e10c1d5440/templates/node/node.py#L119-L128
Now is means if the state
actions:install
is notok
, but the machine exists, we stop. But this is wrong cause if we don't have the stateinstall:ok
that means that the installation didn't went all the way so having a machine that is already created means this machine is in a bad state and should probably be recreated from scratch