Skip to content

fix: remote hypervisor snapshot creation#228

Merged
lbajolet-hashicorp merged 1 commit intomainfrom
fix/snapshot-creation
Jul 29, 2024
Merged

fix: remote hypervisor snapshot creation#228
lbajolet-hashicorp merged 1 commit intomainfrom
fix/snapshot-creation

Conversation

@tenthirtyam
Copy link
Copy Markdown
Collaborator

Description

Moves the snapshot creation step after the upload of the .vmx file to the remote hypervisor. When not set in this order, the virtual machine will not be set to run on the created snapshot.

Testing

General

packer-plugin-vmware on  fix/snapshot-creation [$!] via 🐹 v1.22.5 took 3.4s go fmt ./...

packer-plugin-vmware on  fix/snapshot-creation [$!] via 🐹 v1.22.5 make generate
2024/07/15 22:04:53 Copying "docs" to ".docs/"
2024/07/15 22:04:53 Replacing @include '...' calls in .docs/
Compiling MDX docs in '.docs' to Markdown in '.web-docs'...

packer-plugin-vmware on  fix/snapshot-creation [$!] via 🐹 v1.22.5 took 2.9s make build

packer-plugin-vmware on  fix/snapshot-creation [$!] via 🐹 v1.22.5 make test
?       github.com/hashicorp/packer-plugin-vmware       [no test files]
?       github.com/hashicorp/packer-plugin-vmware/version       [no test files]
ok      github.com/hashicorp/packer-plugin-vmware/builder/vmware/common 6.714s
ok      github.com/hashicorp/packer-plugin-vmware/builder/vmware/iso    2.550s
ok      github.com/hashicorp/packer-plugin-vmware/builder/vmware/vmx    2.020s

packer-plugin-vmware on  fix/snapshot-creation [$!] via 🐹 v1.22.5 took 10.4s make dev 
packer plugins install --path packer-plugin-vmware "github.com/hashicorp/vmware"
Successfully installed plugin github.com/hashicorp/vmware from /Users/ryan/Library/Mobile Documents/com~apple~CloudDocs/Code/Personal/packer-plugin-vmware/packer-plugin-vmware to /Users/ryan/.packer.d/plugins/github.com/hashicorp/vmware/packer-plugin-vmware_v1.0.12-dev_x5.0_darwin_arm64

Run

==> vmware-iso.appliance: Deleting unnecessary VMware files...
    vmware-iso.appliance: Deleting: /vmfs/volumes/local/appliance/appliance.scoreboard
    vmware-iso.appliance: Deleting: /vmfs/volumes/local/appliance/vmware.log
==> vmware-iso.appliance: Cleaning VMX prior to finishing up...
    vmware-iso.appliance: Detaching ISO from CD-ROM device ide0:0...
    vmware-iso.appliance: Detaching ISO from CD-ROM device ide1:0...
    vmware-iso.appliance: Disabling VNC server...
==> vmware-iso.appliance: Creating snapshot of the virtual machine...
==> vmware-iso.appliance: Skipping export of virtual machine...
Build 'vmware-iso.appliance' finished after 2 minutes 29 seconds.

==> Wait completed after 2 minutes 29 seconds

==> Builds finished. The artifacts of successful builds are:
--> vmware-iso.appliance: VM files in directory: /vmfs/volumes/local/appliance
sata0.present = "FALSE"
scsi0.pcislotnumber = "16"
scsi0.present = "TRUE"
scsi0.virtualdev = "pvscsi"
scsi0:0.filename = "disk-000001.vmdk" <--- expected result.
scsi0:0.present = "TRUE"
scsi0:0.redo = ""

Reference

Closes #68

@tenthirtyam tenthirtyam added the bug Bug label Jul 16, 2024
@tenthirtyam tenthirtyam added this to the v1.1.0 milestone Jul 16, 2024
@tenthirtyam tenthirtyam self-assigned this Jul 16, 2024
@tenthirtyam tenthirtyam requested a review from a team as a code owner July 16, 2024 02:09
Moves the snapshot creation step after the upload of the `.vmx` file to the remote hypervisor. When not set in this order, the virtual machine will not be set to run on the created snapshot.

Signed-off-by: Ryan Johnson <ryan@tenthirtyam.org>
@tenthirtyam tenthirtyam force-pushed the fix/snapshot-creation branch from bebc6a5 to d56a5e3 Compare July 24, 2024 15:18
Copy link
Copy Markdown
Contributor

@lbajolet-hashicorp lbajolet-hashicorp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@lbajolet-hashicorp lbajolet-hashicorp merged commit c080728 into main Jul 29, 2024
@lbajolet-hashicorp lbajolet-hashicorp deleted the fix/snapshot-creation branch July 29, 2024 14:07
@github-actions
Copy link
Copy Markdown

github-actions bot commented Feb 1, 2026

I'm going to lock this pull request because it has been closed for 30 days. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 1, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

bug Bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

vmware-iso: Using the snapshot_name option with ESXi, the VMX file does not refer the correct snapshot

2 participants