Previous page

Next page

Locate page in Contents

Print this page

Vm.begin_edit and Vm.commit Methods

All virtual machine configuration changes must begin with the Vm.begin_edit and end with the Vm.commit call. These two methods are used to detect collisions with other clients trying to modify the configuration settings of the same virtual machine.

The Vm.begin_edit method timestamps the beginning of the editing operation. It does not lock the machine, so other clients can make changes to the same virtual machine at the same time. The method will also automatically update your local virtual machine object with the current virtual machine configuration information. This is done in order to ensure that the local object contains the changes that might have have happened since you obtained the virtual machine object.

When you are done making the changes, you must invoke the Vm.commit method. The first thing that the function will do is verify that the virtual machine configuration has not been modified by other client(s) since you began making your changes. If a collision is detected, your changes will be rejected and Vm.commit will return an error. In such a case, you will have to reapply the changes. In order to do that, you will have to get the latest configuration using the Vm.refresh_config method, compare your changes with the latest data, and make a decision about merging them. Please note that Vm.refresh_config method will update the configuration data in your current virtual machine object and will overwrite all existing data, including the changes that you've made to it. Furthermore, the Vm.begin_edit method will also overwrite all existing data (see above). If you don't want to loose your data, save it locally before calling Vm.refresh_config or Vm.begin_edit.

Please send us your feedback on this help page