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

Add support to enable migrateEncryption option #467

Open
jlouisfoster opened this issue Sep 19, 2024 · 17 comments
Open

Add support to enable migrateEncryption option #467

jlouisfoster opened this issue Sep 19, 2024 · 17 comments
Milestone

Comments

@jlouisfoster
Copy link

jlouisfoster commented Sep 19, 2024

Summary

When attempting to add "migrate.encryptionMode" = "required" via configuration_parameters option in .pkr.hcl - this setting does not get added to the .vmx file; thus the change does not occur on the template/vm.

Reproduction Steps

Update configuration_parameters with "migrate.encryptionMode" = "required" and validate if Encrypted vMotion is set to required.

Plugin and Packer version

Packer v1.10.2

Simplified Packer Buildfile

  network_adapters {
    network      = var.vm_network
    network_card = var.network_card
  }

  configuration_parameters = {
    "tools.guest.desktop.autolock" = "FALSE"
    "log.keepOld" = "15"
    "migrate.encryptionMode" = "required"
  }

Operating system and Environment details

Windows Server 2022

Log Fragments and crash.log files

No error in logs

@tenthirtyam tenthirtyam self-assigned this Sep 19, 2024
@tenthirtyam tenthirtyam added this to the Backlog milestone Sep 19, 2024
@tenthirtyam tenthirtyam changed the title configuration_parameters does not apply "migrate.encryptionMode" = "required" configuration_parameters does not apply "migrate.encryptionMode" = "required" Sep 19, 2024
@tenthirtyam
Copy link
Collaborator

I believe that this was meant for hashicorp/packer-plugin-vsphere for VMware vSphere where the configuration_parameters is an option.

I'll transfer the issue.

@tenthirtyam tenthirtyam transferred this issue from hashicorp/packer-plugin-vmware Sep 19, 2024
@tenthirtyam
Copy link
Collaborator

Try "migrateEncryption" = "required".

@jlouisfoster
Copy link
Author

Hi,

Thank you for the quick reply :)

I tried with that option but still no luck...

@tenthirtyam
Copy link
Collaborator

No worries. I took a look at the code last night and have an idea why this is not working and a possible fix I plan on testing in my available time next week.

@jlouisfoster
Copy link
Author

Thank you!

I really appreciate the support

@tenthirtyam tenthirtyam modified the milestones: Backlog, v1.4.1 Sep 22, 2024
@tenthirtyam
Copy link
Collaborator

Seems that it's one that is ignored by extraConfig.

Similar issue in the sdk.

Ryan

@jlouisfoster
Copy link
Author

Hmm so I’m guessing - this is a fix that is needed at the VMware level?

@tenthirtyam
Copy link
Collaborator

No, actually if would need to be an enhancement request for this plugin to allow migrateEncryption to be set.

Since migrateEncryption is explicitly configurable through in the ConfigSpec object it is silently ignored when sent in the extraConfig.

Ryan Johnson
Distinguished Engineer, VMware by Broadcom

@tenthirtyam tenthirtyam modified the milestones: v1.4.1, Backlog Sep 25, 2024
@tenthirtyam tenthirtyam removed their assignment Sep 25, 2024
@tenthirtyam tenthirtyam changed the title configuration_parameters does not apply "migrate.encryptionMode" = "required" Add support to enable migrateEncryption option Sep 25, 2024
@tenthirtyam
Copy link
Collaborator

Converted to an enhancement.

@jlouisfoster
Copy link
Author

Is it possible we can modify the extraconfig via packer?

@tenthirtyam
Copy link
Collaborator

Is it possible we can modify the extraconfig via packer?

That's what configuration_parameters allows for but if there is a conflict, it will be ignored.

I submitted the following pull request to add some additional logging and update the docs in that regard.

Take a look at the log output.

#468

@jlouisfoster
Copy link
Author

Really appreciate it tenthiryam - sorry for all the questions; it's one of my first enhancement requests.
Will that PR (#468) fix that issue once approved or just provide more logs on how it could be fixed?

@tenthirtyam
Copy link
Collaborator

Will that PR fix that issue once approved or just provide more logs on how it could be fixed?

It will just log that the item was ignored and include an update in the docs.

@jlouisfoster
Copy link
Author

So the only method is to manually make this change - automating it with packer is not a possibility?

@tenthirtyam
Copy link
Collaborator

tenthirtyam commented Sep 26, 2024

So the only method is to manually make this change - automating it with packer is not a possibility?

Correct.

Or you could use a provisioner to do this with PowerCLI post build.

@jlouisfoster
Copy link
Author

Will look into that, thank you!

@jlouisfoster
Copy link
Author

Would you happen to have an example in the docs of setting up a provisioner with powercli for packer?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants