*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.*



<https://lh3.googleusercontent.com/-_qHsQttz-EI/We_1TS6oduI/AAAAAAAAAEY/mseBY37GtyQ7dqCfjx6Z1Z4bIZI3UhHDACLcBGAs/s1600/11111.png>



<https://lh3.googleusercontent.com/-SVbT76ElBi8/We_1jbBt1TI/AAAAAAAAAEc/CvztAeyaZ0QUXQjGjPz_5rZ1EpAdopFWwCLcBGAs/s1600/2222.png>





*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!).*




<https://lh3.googleusercontent.com/-Vz-7d6tphSg/We_2gpHuKuI/AAAAAAAAAEo/kcQ4ZCe1iWMnnHeP-A2ITWtRc7VAIrtMwCLcBGAs/s1600/333.png>



*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?*



<https://lh3.googleusercontent.com/-YTW_YuAxApw/We_4bjUw90I/AAAAAAAAAE4/kgRDWLzHq4USg0Pi48OpW4XEInhqtLr9ACLcBGAs/s1600/444.png>




<https://lh3.googleusercontent.com/-NPMvjqApYFU/We_4iDagdnI/AAAAAAAAAE8/yYMZv2lihyAB4gpIA18NC3kYr5XZ2d4EwCLcBGAs/s1600/555.png>



Thanks,

Naren.








-- 
You received this message because you are subscribed to the Google Groups 
"Foreman users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to foreman-users+unsubscr...@googlegroups.com.
To post to this group, send email to foreman-users@googlegroups.com.
Visit this group at https://groups.google.com/group/foreman-users.
For more options, visit https://groups.google.com/d/optout.

Reply via email to