Hi,
I am using Foreman-Discovery Image to discover the server initially over a
PXE network (ex: my network is on 10.7.19.0/24). I have no issues in
discovering the host into Foreman over the PXE network.
Now, I created a host group to deploy an operating system under a
different management subnet (10.7.29.0/24) network which is different from
the PXE network (of course!). I am planning to install ESXi on the
discovered hosts. And I expect the host to be deployed using the subnet
that I provided in the HostGroup (which is not true. Maybe I am assuming in
a wrong way!).
ESXi kick start installation supports a command line parameter to provide
the –vlanid (for the same physical NIC interface.)
And a snippet from my template is as follows:
> <% mgmt_ip = ["10.7.29",
> @host.facts['ipmi_1_ipaddress'].split(".").last].join('.') %>
> <% esxi_hostname = [
> @host.facts['lldp_neighbor_sysname_enp65s0f1'].split("202").first, "c",
> @host.facts['lldp_neighbor_portid_enp65s0f1'].split("/").last].join() %>
> <% mgmt_vlan = "104" %>
> <% def_gateway = "10.7.29.1" %>
> vmaccepteula
>
> # Set the root password
> rootpw --iscrypted <%= root_pass %>
>
> # Install ESX
> <%= @host.diskLayout %>
> <% subnet = @host.subnet -%>
> network --bootproto=static --ip=<%= mgmt_ip -%> --gateway=<%= def_gateway
> -%> --nameserver=<%= subnet.dns_primary -%> --netmask=<%= subnet.mask -%>
> --hostname=<%= esxi_hostname -%> --device=vmnic2 --vlanid=<%= mgmt_vlan
> -%> --addvmportgroup=0
So, when I click on the Auto Provision (under discovered hosts), it will
install the Operating system without any issues, I mean ESXi will have all
the hostnames and Management IP address from the template (as I am not
picking them from the GUI parameters).
However, after the installation, my host on the foreman still have the PXE
network showing as assigned IP? How can I update the IP address? [Actual
host will have the management IP as I am hard-coding that value through
provisioning template because I don’t know How to change that using auto
provision?]
I am wondering, how does auto provision picks IP address from the PXE even
after I assigned the subnet for my host group as a different subnet
(logically, it should pick the subnet from the host group isn’t?). If
that’s not possible, how do I update the host details once the installation
is finished?
Thanks,
Naren.