Backing up and restoring virtual machine templates using VMware APIs
search cancel

Backing up and restoring virtual machine templates using VMware APIs

book

Article ID: 344509

calendar_today

Updated On:

Products

VMware vSphere ESXi

Issue/Introduction

This article provides information about backing up and restoring virtual machine templates via VMware APIs.

Environment

Virtual Disk Development Kit 1.1.1
VMware Virtual Disk Development 1.2
Virtual Disk Development Kit 1.1.0
Virtual Disk Development Kit 1.2
Virtual Disk Development Kit 1.0.1

Resolution

To perform a backup, templates must be converted into virtual machines. To perform a restore, virtual machines must be converted into templates.
To perform a backup:
  1. Convert the virtual machine template to a virtual machine. For more information, see
    Converting a Template to a Virtual Machine in the vSphere Web Services SDK Programming Guide.
  2. Take snapshot of the virtual machine. For more information, see Taking Snapshots in the vSphere Web Services SDK Programming Guide.
  3. Back up the virtual machine using vSphere APIs and VDDK APIs. For more information, see:
  4. Convert the virtual machine back to a virtual machine template. For more information, see Creating Virtual Machine Templates in the vSphere Web Services SDK Programming Guide.

    Note: When the operation completes, the virtual machine no longer exists.

To perform a restore:
  1. Restore the virtual machine using vSphere APIs and VDDK APIs. For more information, see:
  2. Convert the restored virtual machine back to a virtual machine template. For more information, see Creating Virtual Machine Templates in the vSphere Web Services SDK Programming Guide.

    Note: When the operation completes, the virtual machine no longer exists.