Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Address differences between iso and clone regarding disk creation. #147

Merged
merged 2 commits into from
Jan 27, 2023

Conversation

sebastian-de
Copy link
Contributor

The new efi_config brought differences between iso and clone to light.
The first difference is that iso will create the EFI disk in the first run and the additional call of SetVmConfig is not needed.
The second one is that clone will replace disks that are already present on the cloned VM with the ones specified in the builder configuration.

I addressed both differences in separate commits.

Closes #145

@sebastian-de sebastian-de requested a review from a team as a code owner January 25, 2023 08:36
When using proxmox-iso, calling SetVmConfig() for the EFI disk creates it
twice, with the second disk being unused:
unused0: local-zfs:vm-110-disk-1

Fix this by limiting the call to proxmox-clone.
Copy link
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.

Hi @sebastian-de,

Just left a small suggestion regarding the regexp you defined to figure out which disks are unused, but aside from that LGTM!

@@ -105,6 +99,17 @@ func (s *stepFinalizeTemplateConfig) Run(ctx context.Context, state multistep.St
}
}

// Disks that get replaced by the builder end up as unused disks -
// find and remove them.
rxUnused := regexp.MustCompile(`^(unused)\d+`)
Copy link
Contributor

Choose a reason for hiding this comment

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

Unless you're using the regexp to extract things, I'd think the parentheses are not useful here

Handle disks that got replaced by the clone builder and end up unused.
@sebastian-de
Copy link
Contributor Author

Hey @lbajolet-hashicorp,
I included your suggestion regarding the regex.
As always many thanks for the review!

@lbajolet-hashicorp
Copy link
Contributor

My pleasure, thanks again for the effort you're pushing towards improving this plugin @sebastian-de, we really appreciate the involvement here, kudos to you!

@lbajolet-hashicorp lbajolet-hashicorp merged commit f8367c2 into hashicorp:main Jan 27, 2023
@sebastian-de sebastian-de deleted the fix-efi branch January 27, 2023 23:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unused raw disk
2 participants