vsphere-clone: can't set static IP when using cloud-init image #637
Replies: 4 comments
-
|
Ping. Any thoughts on this? Thanks! |
Beta Was this translation helpful? Give feedback.
-
|
It's been a few months. Any thoughts on this issue? |
Beta Was this translation helpful? Give feedback.
-
|
Hi there! Based on the details provided it's unknown...:
Ryan Johnson |
Beta Was this translation helpful? Give feedback.
-
|
Hello! 👋 This issue has not received any update from the OP in the last 7 days. Please feel free to comment and/or reopen this issue if the issue persists. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Overview of the Issue
I am using
vsphere-cloneto clone an OVA of Alma 9 that was just uploaded to my vsphere. I cannot figure out how to set a static IP address in the resulting packer-instantiated VM:vapp-->properties-->user-datato specify cloud init data, it seems to execute (mostly) properly, but somehow thenetworkcloud init stanza gets wholly ignored and the VM tries to DHCP (in my environment, the DHCP will fail, and the VM will come up without networking setup).customizeand try to set a fixed IP address vianetwork_interfaces, the VM comes up with the network device present but disconnected in vsphere. Since the device is disconnected, no networking gets setup in the VM.Reproduction Steps
There's 2 cases I'm unable to make work properly:
Using vapp --> properties --> user-data (i.e., clout init)
vapp-->properties-->user-datawith base64-encoded cloud init dataruncmdstanza inuser-data(echo hello world)networkstanza inuser-datathat assigns a static IPvsphere-clone, cloning a freshly-created Alma 9 OVAecho hello worldrun from cloud initUsing customize
customizethat sets a fixed IP address (vianetwork_interface)vsphere-clone, cloning a freshly-created Alma 9 OVAPacker Version
Plugin Version and Builders
Please provide the plugin version.
1.2.3
Please select the builder.
vsphere-isovsphere-cloneVMware vSphere Version
Please provide the VMware vSphere version.
7.0.3.01700
Guest Operating System
Alma 9 (latest).
Simplified Packer Buildfile
There's 2 cases I'm unable to make work properly:
Using vapp --> properties --> user-data (i.e., clout init)
This case executes all the cloud init stuff in my Alma 9 VM properly, except that my
networkstanza is wholly skipped. Instead, I can see in the cloud-init logs that it tried to DHCP. Does thevmware-cloneplugin somehow substitute in its ownnetworkstanza to cloud init that overrides mynetworkstanza (and tells cloud init to DHCP)?{ "builders": [ { "type": "vsphere-clone", ... "vapp": { "properties": { "user-data": "...the b64 of my cloud init user-data", } } } ] }My cloud init user-data is quite bare bones:
The user is created properly (and I can login on the console), and the "hello world" is emitted in the logs. So all that ran correctly.
But per above, my
networkstanza is ignored and somehow cloud init tries toDHCP, instead.Using customize
{ "builders": [ { "type": "vsphere-clone", ... "customize" : { "linux_options": { "host_name": "alma9-test", "domain": "example.com" }, "network_interface": { "ipv4_address": "10.10.10.10", "ipv4_netmask": "24" }, "ipv4_gateway": "10.10.10.1" } } ] }In this case, the VM boots up with a network device present, but disconnected. Hence, whatever networking is setup in the VM initialization doesn't occur. If I go into vsphere and click the "Connected" checkbox next to the network device, it connects to the VM properly, but whatever network setup is present (if any?) doesn't fire, and no fixed IP address is set.
Operating System and Environment Details
I am using an OVA that we created from the latest Alma 9 distribution ISO. We actually use packer to launch the latest Alma 9 distribution ISO with a minimal kickstart file, and then have packer generate an OVA from that. It is this OVA that I am attempting to use in a separate execution of packer with
vsphere-clone.Log Fragments and
crash.logFilesBeta Was this translation helpful? Give feedback.
All reactions