Description of the bug
There was a request at #13583 to add a "simulate-eviction" command. However, as it is implemented, the command not only issues the eviction notification event but also evicts the virtual machine. Therefore, the eviction is not simulated, but forced. The eviction can happen in two cases:
- Azure has insufficient resources and evicts spot instances, provided to certain conditions, such as maximum price, however, if maximum price is over the price of a normal instance, the VM will never be evicted.
- A user run the "simulate-eviction" command.
In the first case, the eviction is optional - it can happen or can not happen, depending on the availability of resources, on the price cap set, etc.;
In the second case, the VM is always (forcefully) evicted, even if the price is as high as the normal price.
Therefore, the command name "simulate-eviction" is misleading, as the VM is not "simulated" to be evicted but is actually evicted, i.e., if a VM has the eviction policy to delete, the VM will be actually deleted, not a "simulatedly" deleted. A better command name would have been "force-eviction".
Command to reproduce
Here is a command to reproduce the issue:
az vm simulate-eviction --resource-group YourResourceGroupName --name YourVMName
Expected behaviour
The eviction will be simulated but not actually done, the event will arrive but the VM will not be actually evicted.
Current behaviour
The eviction takes place, optionally deleting the VM based on the eviction policy.
Proposed solution
Deprecate the "simulate-eviction" command and call the command "force-eviction".
Essence of the bug
I consider this behavior bug because the "simulate" is not the same as "force", i.e. the command means one thing as can be implied from the command name while does a different thing. It can even delete data then the user has set spot price as high as the normal price, which, according to the documentation, should never lead to eviction.
The word "simulate" in the dictionary means ": to give or assume the appearance or effect of often with the intent to deceive :" -- see https://www.merriam-webster.com/dictionary/simulate
However, when using the command, the eviction is real, the data is deleted really (even with price cap set high), there is no "assume the appearance" as set in the dictionary.
Description of the bug
There was a request at #13583 to add a "simulate-eviction" command. However, as it is implemented, the command not only issues the eviction notification event but also evicts the virtual machine. Therefore, the eviction is not simulated, but forced. The eviction can happen in two cases:
In the first case, the eviction is optional - it can happen or can not happen, depending on the availability of resources, on the price cap set, etc.;
In the second case, the VM is always (forcefully) evicted, even if the price is as high as the normal price.
Therefore, the command name "simulate-eviction" is misleading, as the VM is not "simulated" to be evicted but is actually evicted, i.e., if a VM has the eviction policy to delete, the VM will be actually deleted, not a "simulatedly" deleted. A better command name would have been "force-eviction".
Command to reproduce
Here is a command to reproduce the issue:
Expected behaviour
The eviction will be simulated but not actually done, the event will arrive but the VM will not be actually evicted.
Current behaviour
The eviction takes place, optionally deleting the VM based on the eviction policy.
Proposed solution
Deprecate the "simulate-eviction" command and call the command "force-eviction".
Essence of the bug
I consider this behavior bug because the "simulate" is not the same as "force", i.e. the command means one thing as can be implied from the command name while does a different thing. It can even delete data then the user has set spot price as high as the normal price, which, according to the documentation, should never lead to eviction.
The word "simulate" in the dictionary means ": to give or assume the appearance or effect of often with the intent to deceive :" -- see https://www.merriam-webster.com/dictionary/simulate
However, when using the command, the eviction is real, the data is deleted really (even with price cap set high), there is no "assume the appearance" as set in the dictionary.