Skip to content

Create initial snapshot after cleanup #20

@0xFaul

Description

@0xFaul

Description

Create an initial snapshot of the newly created VM after the clean-up step.

Use Case(s)

  • if you need to return frequently to a clean state of the VM (right after the initial setup) e.g. to clear files / malware / misconfigurations, the initial snapshot to return to can be shipped right with the VM so the user doesn't have to create it on its own and potentially forget it.

Potential configuration

  1. add a create snapshot step after the StepCleanVMX for the respective builder
&vmwcommon.StepCreateSnapshot{
	SnapshotName: &b.config.SnapshotName,
},
  1. add SnapshotName string mapstructure:"snapshot_name" required:"false"`` to the builders config to be able to specify the snapshots name in the config
  2. add a builder/vmware/common/step_create_snapshot.go which creates a snapshot if the name is provided in the config
type StepCreateSnapshot struct {
	SnapshotName *string
}
  1. add a CreateSnapshot method inside the drivers which calls vmrun.exe or equivalent tool on linux / macos to create a snapshot
  2. add Tests

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions