Red Hat Bugzilla – Bug 1468182
User is able to attempt to start VM before VM lease is created
Last modified: 2018-03-05 12:16:44 EST
Description of problem:
When updating a VM to use a VM lease, the update command ends while the async operation of creating the lease is still being executed. Therefore, the lock of the VM that was acquired by UpdateVm may be released before the lease was actually created.
Setting severity to high and not to urgent because if the user tries to start the VM at this stage, it is expected to fail since the lease cannot be acquired. However, this is yet important because we should prevent the user from trying to start the VM in this state with a proper message (conceptually the UpdateVm operation was not ended yet) and more importantly, it prevents us from saving the lease properties in the engine and to send the complete device as part of the engine xml.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. Update a VM that was not set with a VM lease to use one.
2. Start the VM
The RunVm command is executed before the end action of AddVmLease is called.
Well, ideally if there is no need to extend the lease volume then the call to add lease should be synchronous and that way we won't badly affect the system's responsiveness. But in case the operation is asynchronous, the UpdateVm command should be ended (and then release the VM's lock) only when that operation is ended, even at the expense of the system's responsiveness.
Added a validation that prevents one from starting the VM during the creation of the lease, so reducing the severity.