The vsphere_virtual_machine_snapshot resource can be used to manage snapshots for a virtual machine.

For more information on managing snapshots and how they work in VMware, see here.

Example Usage

resource "vsphere_virtual_machine_snapshot" "demo1" {
  virtual_machine_uuid = "9aac5551-a351-4158-8c5c-15a71e8ec5c9"
  snapshot_name        = "Snapshot Name"
  description          = "This is Demo Snapshot"
  memory               = "true"
  quiesce              = "true"
  remove_children      = "false"
  consolidate          = "true"

Argument Reference

The following arguments are supported:

  • virtual_machine_uuid - (Required) The virtual machine UUID.
  • snapshot_name - (Required) The name of the snapshot.
  • description - (Required) A description for the snapshot.
  • memory - (Required) If set to true, a dump of the internal state of the virtual machine is included in the snapshot.
  • quiesce - (Required) If set to true, and the virtual machine is powered on when the snapshot is taken, VMware Tools is used to quiesce the file system in the virtual machine.
  • remove_children - (Optional) If set to true, the entire snapshot subtree is removed when this resource is destroyed.
  • consolidate - (Optional) If set to true, the delta disks involved in this snapshot will be consolidated into the parent when this resource is destroyed.

Attribute Reference

The only attribute this resource exports is the resource id, which is set to the managed object reference ID of the snapshot.

© 2018 HashiCorpLicensed under the MPL 2.0 License.