Skip to content

Commit a534f39

Browse files
committed
api: Add object.VirtualMachine.CreateSnapshotEx method
Signed-off-by: Sreyas Natarajan <sreyas.natarajan@broadcom.com>
1 parent 49947e5 commit a534f39

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

object/virtual_machine.go

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -648,6 +648,24 @@ func (v VirtualMachine) CreateSnapshot(ctx context.Context, name string, descrip
648648
return NewTask(v.c, res.Returnval), nil
649649
}
650650

651+
// CreateSnapshotEx creates a new snapshot of a virtual machine.
652+
func (v VirtualMachine) CreateSnapshotEx(ctx context.Context, name string, description string, memory bool, quiesceSpec *types.VirtualMachineGuestQuiesceSpec) (*Task, error) {
653+
req := types.CreateSnapshotEx_Task{
654+
This: v.Reference(),
655+
Name: name,
656+
Description: description,
657+
Memory: memory,
658+
QuiesceSpec: quiesceSpec,
659+
}
660+
661+
res, err := methods.CreateSnapshotEx_Task(ctx, v.c, &req)
662+
if err != nil {
663+
return nil, err
664+
}
665+
666+
return NewTask(v.c, res.Returnval), nil
667+
}
668+
651669
// RemoveAllSnapshot removes all snapshots of a virtual machine
652670
func (v VirtualMachine) RemoveAllSnapshot(ctx context.Context, consolidate *bool) (*Task, error) {
653671
req := types.RemoveAllSnapshots_Task{

0 commit comments

Comments
 (0)