Show / Hide Table of Contents

Class VirtualMachineSnapshot

The vsphere..VirtualMachineSnapshot 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.

NOTE: A snapshot in VMware differs from traditional disk snapshots, and can contain the actual running state of the virtual machine, data for all disks that have not been set to be independent from the snapshot (including ones that have been attached via the attach parameter to the vsphere..VirtualMachine disk block), and even the configuration of the virtual machine at the time of the snapshot. Virtual machine, disk activity, and configuration changes post-snapshot are not included in the original state. Use this resource with care! Neither VMware nor HashiCorp recommends retaining snapshots for a extended period of time and does NOT recommend using them as as backup feature. For more information on the limitation of virtual machine snapshots, see here.

Example Usage

using Pulumi;
using VSphere = Pulumi.VSphere;

class MyStack : Stack
{
public MyStack()
{
    var demo1 = new VSphere.VirtualMachineSnapshot("demo1", new VSphere.VirtualMachineSnapshotArgs
    {
        Consolidate = "true",
        Description = "This is Demo Snapshot",
        Memory = "true",
        Quiesce = "true",
        RemoveChildren = "false",
        SnapshotName = "Snapshot Name",
        VirtualMachineUuid = "9aac5551-a351-4158-8c5c-15a71e8ec5c9",
    });
}

}
Inheritance
System.Object
Resource
CustomResource
VirtualMachineSnapshot
Inherited Members
CustomResource.Id
Resource.GetResourceType()
Resource.GetResourceName()
Resource.Urn
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Pulumi.VSphere
Assembly: Pulumi.VSphere.dll
Syntax
public class VirtualMachineSnapshot : CustomResource

Constructors

View Source

VirtualMachineSnapshot(String, VirtualMachineSnapshotArgs, CustomResourceOptions)

Create a VirtualMachineSnapshot resource with the given unique name, arguments, and options.

Declaration
public VirtualMachineSnapshot(string name, VirtualMachineSnapshotArgs args, CustomResourceOptions options = null)
Parameters
Type Name Description
System.String name

The unique name of the resource

VirtualMachineSnapshotArgs args

The arguments used to populate this resource's properties

CustomResourceOptions options

A bag of options that control this resource's behavior

Properties

View Source

Consolidate

If set to true, the delta disks involved in this snapshot will be consolidated into the parent when this resource is destroyed.

Declaration
public Output<bool?> Consolidate { get; }
Property Value
Type Description
Output<System.Nullable<System.Boolean>>
View Source

Description

A description for the snapshot.

Declaration
public Output<string> Description { get; }
Property Value
Type Description
Output<System.String>
View Source

Memory

If set to true, a dump of the internal state of the virtual machine is included in the snapshot.

Declaration
public Output<bool> Memory { get; }
Property Value
Type Description
Output<System.Boolean>
View Source

Quiesce

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.

Declaration
public Output<bool> Quiesce { get; }
Property Value
Type Description
Output<System.Boolean>
View Source

RemoveChildren

If set to true, the entire snapshot subtree is removed when this resource is destroyed.

Declaration
public Output<bool?> RemoveChildren { get; }
Property Value
Type Description
Output<System.Nullable<System.Boolean>>
View Source

SnapshotName

The name of the snapshot.

Declaration
public Output<string> SnapshotName { get; }
Property Value
Type Description
Output<System.String>
View Source

VirtualMachineUuid

The virtual machine UUID.

Declaration
public Output<string> VirtualMachineUuid { get; }
Property Value
Type Description
Output<System.String>

Methods

View Source

Get(String, Input<String>, VirtualMachineSnapshotState, CustomResourceOptions)

Get an existing VirtualMachineSnapshot resource's state with the given name, ID, and optional extra properties used to qualify the lookup.

Declaration
public static VirtualMachineSnapshot Get(string name, Input<string> id, VirtualMachineSnapshotState state = null, CustomResourceOptions options = null)
Parameters
Type Name Description
System.String name

The unique name of the resulting resource.

Input<System.String> id

The unique provider ID of the resource to lookup.

VirtualMachineSnapshotState state

Any extra arguments used during the lookup.

CustomResourceOptions options

A bag of options that control this resource's behavior

Returns
Type Description
VirtualMachineSnapshot
  • View Source
Back to top Copyright 2016-2020, Pulumi Corporation.