Preventing Updates to a vApp During Backup or Restore
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