Skip to content

vshpere-iso: Implement ssh_keypair_name from vsphere-clone #743

Description

@jpbuecken

Code of Conduct

  • I have read and agree to the project's Code of Conduct.
  • Vote on this issue by adding a 👍 reaction to the original issue description to help the maintainers prioritize.
  • Do not leave "+1" or other comments that do not add relevant information or questions.
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment.

Description

Feature #44 has been merged and released with 2.2.0.
I am very thankful for it and we are one step further. One of our original use cases was

You can add a public-keys property.
To do this with packer, the vsphere-iso provider is missing the ssh_keypair_name feature set from vpshere-clone.
From the vsphere-clone documentation:

ssh_keypair_name (string) - If specified, this is the key that will be used for SSH with the machine. The key must match a key pair name loaded up into the remote. By default, this is blank, and Packer will generate a temporary keypair unless [ssh_password] is used.

More precisely, generating the temporary_key_pair_name feature is missing, such that it generates the key pair and adds it as vapp property.
At least it is not documented if this is already possible.

Use Case(s)

You can use the key during your iso based installation like this

  1. vsphere-iso creates the vapp property public-keys
  2. Configure Suse Agama / Autoyast / Redhat kickstart / Ubuntu preseed to make use of the public-keys value during boot/installation (write your own script or make use of cloud-init).
  3. vsphere-iso is able to generate temporary key pairs and add them as value to the public-keys (this is the new feature, same logic as vsphere-clone)
  4. The automatic installation process (point 2) make use of the value in public-keys and add them to your connect user (e.g. root)
  5. vsphere-iso can connect with the temporary key pair

So to get 3) and 5) to work, the vsphere-iso provider is lacking the ssh_keypair_name feature from vpshere-clone.

Potential Configuration

See vsphere-clone documentation

References

https://developer.hashicorp.com/packer/integrations/vmware/vsphere/latest/components/builder/vsphere-clone#ssh

Metadata

Metadata

Assignees

Fields

No fields configured for Feature.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions