Preventing Updates to a vApp During Backup or Restore
Last Updated December 16, 2024

While you are backing up or restoring a vApp, you need to prevent updates to the vApp configuration and metadata so that the vApp remains internally consistent. To prevent updates during the backup/restore process, the vCloud API allows the vApp to be placed in maintenance mode, which rejects any new updates to the configuration and metadata.
The backup software must select maintenance mode for the vApp before starting backup or restore operations, and deselect maintenance mode for the vApp after the operations are completed. The following example shows how to protect a vApp by selecting and deselecting maintenance mode.
using com.vmware.vcloud.sdk;
using com.vmware.vcloud.api.rest.schema;
...
VApp vapp; // VApp utility class from vCloud SDK
// Identify vApp 
vapp.EnableMaintenance(); // Enter maintenance mode
// Perform backup/restore here
...
vapp.DisableMaintenance(); // Exit maintenance mode
The following lines show corresponding REST API calls to select and deselect maintenance mode for a vApp.
POST https://vCloud/api/vapp/id/action/enterMaintenancemode
POST https://vCloud/api/vapp/id/action/exitMaintenanceMode
Selecting maintenance mode does not affect current or pending tasks associated with the vApp. Current or pending tasks will run to completion concurrent with the backup or restore operation. If these tasks involve configuration changes, they could result in an inconsistent vApp configuration. The backup system must ensure that such tasks are complete before storing the vApp properties and metadata.