VMware Cloud Community
ccnasaurabh1
Enthusiast
Enthusiast
Jump to solution

Install ESXi Hosts Using VRO

Hi

I got a requirement to new build and rebuild ESXi host using VRO and iLO.

Please share any solution to automate the ESXi rebuilding and configure the same network and storage in the same host.

After rebuild ESXi we need to configure same network and storage.

Thanks

Saurabh

2 Solutions

Accepted Solutions
David788
Contributor
Contributor
Jump to solution

So if via iLO and mounting ISO to install ESXi host, then you have to find the way for where to store the ISO (some SMB, FTP, SFTP, HTTP share), from which iLO will be able to mount it.

Depends on your decision, if kickstart will be stored locally on the ISO, or remotely on some http server, where "future" VMkernel have access.

If you will go for locally stored kickstart on ISO, then you would need to develop vRO workflow, which will create bootable ISO on demand, or create all possible ISOs at front, which is mostly not possible, as you might not know all future hostnames and IPs.

Therefore I would suggest to use remotelly stored kickstart and publish it via HTTP.

The procedure of preparing ISO using remote kickstart is to edit files:

/BOOT.CFG for BIOS boot

/EFI/BOOT.CFG for UEFI boot

line: kernelopt=runweasel ks=http://00.00.00.00/kickstart/ks-osdc-pdp101.cfg nameserver=00.00.0.0 ip=00.00.00.000 netmask=255.255.255.0 gateway=00.00.00.000

More options here: https://docs.vmware.com/en/VMware-vSphere/6.5/vsphere-esxi-vcenter-server-65-installation-setup-guid...

Workflow procedure:

1. SSH to iLO and issue command to mount ISO to virtual CDROM from HTTP or any other file supported file share

2. Setup BIOS order to boot from virtual CDROM

3. reboot the server

4. Server will boot from ISO

5. ESXi installer will download Kickstart from pre-defined location

6. ESXi installer will install ESXi host based on Kickstart script (Setup hostname, networking, etc...)

Once ESXi is installed, you have to decide how you will inform Workflow run, that installation is finished.

There ale again multiple options, if you have SSH access from vRO to ESXi hosts, I will go with way: SSH every few minutes to newly installed ESXi host and look for custom file and value inside.

This custom tile could be created as very last step in kickstart run.

So once this file exist with desired value, you can say, that ESXi host is installed and Kickstart run already finished.

Then you might continue with attaching ESXi host to vCenter and perform remaining steps.

View solution in original post

David788
Contributor
Contributor
Jump to solution

Hi,

1. SSH to iLO and issue command to mount ISO to virtual CDROM from HTTP or any other file supported file share  >>>>>> Could you please more elaborate this step and share the commands to mount a iSO into iLO using SSH or how i can create a workflow for that.

--This might be helpfull for you: https://unixhealthcheck.com/blog?id=270

5. ESXi installer will download Kickstart from pre-defined location>>>>>>>>>>Could you please more elaborate this step, How i can download script run into the esxi which just rebooted,

6. ESXi installer will install ESXi host based on Kickstart script (Setup hostname, networking, etc...) Could you please more elaborate this step.

-- To answer both question at once I would say it would be good to at first get familiar with Kickstart it self.

In principal kickstart is the same for ESXi hosts or  for Linux servers, just for ESXi hosts might be way more simple in terms of content, so you probably do not need any tool, which will create ks.cfg for you, and you may write it by your self.

https://docs.vmware.com/en/VMware-vSphere/6.5/vsphere-esxi-vcenter-server-65-installation-setup-guid... -- Section: Options for Installing ESXi / Scripted ESXi Installation

About the Default ks.cfg Installation Script  -- Just be carefull with using --firstdisk --overwritevmfs if you are having SAN or local disks with usefull data.

https://be-virtual.net/automated-installation-with-vmware-esxi-5-56-06-5/

https://rudimartinsen.com/2018/06/09/customizing-esxi-installation-with-kickstart-files-and-pxe-boot...

https://blog.comdivision.com/blog/2018/05/esxi-autoinstall-with-kickstart-and-pxe

---------------------------------------------------------------------------------------------------------

Was it helpful? Let us know by completing this short survey here.

View solution in original post

16 Replies
daphnissov
Immortal
Immortal
Jump to solution

That is a very large ask and people are probably not coming forward to simply hand over extensive automation to you on a silver platter. Helping you build it when you already have something started is one thing; giving you work that has taken dozens of hours for free is another.

ccnasaurabh1
Enthusiast
Enthusiast
Jump to solution

How I can extend silver plates ? Can i use vSphere auto deploy feature to automate esxi build?

Reply
0 Kudos
David788
Contributor
Contributor
Jump to solution

First of all, you should decide if you want to install ESXi hosts with PXE boot, with attaching customized ISO to iLO/iDRAC (or any other remote management which your servers have).

Each option have his own prerequisities.

1. PXE boot is maybe prefered option and requiring correct native VLAN tag on physical switchport where your ESXi is connected.

then you would need DHCP server preferably controlled by vRO workflow run, to get IP which you like to have on the ESXi host while booting.

HTTP/FTP/TFTP server is also required, to by able to transfer the data.  Or in general you may use VMware AutoDeploy, to substitute DHCP and fileshare, but physical switch config have to be the same.

2. attaching bootable ISO via iLO requiring you to talk from vRO workflow run to iLO via awailable API from iLO (I'm using racadm commandline for Dell servers),

Mount the ISO to virtual CDROM, set next boot to Virtual CDROM, if not set already, and boot the host. Preparation of ISO files is up to your possibilities.

AutoDeoloy is not something with automagically install ESXi, technical process on backgroung is the same which you can nuild by your own in your infrastructure.

Once you decide one or other way, than you can start diging deeper to the point what you actually have to develop.

ccnasaurabh1
Enthusiast
Enthusiast
Jump to solution

I have decided to go with iLO to mount iso and install esxi then pull out a health report from the vrops for newly created esxi.

Thanks

Saurabh

Reply
0 Kudos
David788
Contributor
Contributor
Jump to solution

So if via iLO and mounting ISO to install ESXi host, then you have to find the way for where to store the ISO (some SMB, FTP, SFTP, HTTP share), from which iLO will be able to mount it.

Depends on your decision, if kickstart will be stored locally on the ISO, or remotely on some http server, where "future" VMkernel have access.

If you will go for locally stored kickstart on ISO, then you would need to develop vRO workflow, which will create bootable ISO on demand, or create all possible ISOs at front, which is mostly not possible, as you might not know all future hostnames and IPs.

Therefore I would suggest to use remotelly stored kickstart and publish it via HTTP.

The procedure of preparing ISO using remote kickstart is to edit files:

/BOOT.CFG for BIOS boot

/EFI/BOOT.CFG for UEFI boot

line: kernelopt=runweasel ks=http://00.00.00.00/kickstart/ks-osdc-pdp101.cfg nameserver=00.00.0.0 ip=00.00.00.000 netmask=255.255.255.0 gateway=00.00.00.000

More options here: https://docs.vmware.com/en/VMware-vSphere/6.5/vsphere-esxi-vcenter-server-65-installation-setup-guid...

Workflow procedure:

1. SSH to iLO and issue command to mount ISO to virtual CDROM from HTTP or any other file supported file share

2. Setup BIOS order to boot from virtual CDROM

3. reboot the server

4. Server will boot from ISO

5. ESXi installer will download Kickstart from pre-defined location

6. ESXi installer will install ESXi host based on Kickstart script (Setup hostname, networking, etc...)

Once ESXi is installed, you have to decide how you will inform Workflow run, that installation is finished.

There ale again multiple options, if you have SSH access from vRO to ESXi hosts, I will go with way: SSH every few minutes to newly installed ESXi host and look for custom file and value inside.

This custom tile could be created as very last step in kickstart run.

So once this file exist with desired value, you can say, that ESXi host is installed and Kickstart run already finished.

Then you might continue with attaching ESXi host to vCenter and perform remaining steps.

ccnasaurabh1
Enthusiast
Enthusiast
Jump to solution

Thanks mate for your last response !

It's very useful but still I need some more clarification on below workflow procedures.

Workflow procedure:

1. SSH to iLO and issue command to mount ISO to virtual CDROM from HTTP or any other file supported file share  >>>>>> Could you please more elaborate this step and share the commands to mount a iSO into iLO using SSH or how i can create a workflow for that.

5. ESXi installer will download Kickstart from pre-defined location>>>>>>>>>>Could you please more elaborate this step, How i can download script run into the esxi which just rebooted,

6. ESXi installer will install ESXi host based on Kickstart script (Setup hostname, networking, etc...) Could you please more elaborate this step.

I have planning to install ESXI through ilo.

Thanks

Saurabh   

Reply
0 Kudos
David788
Contributor
Contributor
Jump to solution

Hi,

1. SSH to iLO and issue command to mount ISO to virtual CDROM from HTTP or any other file supported file share  >>>>>> Could you please more elaborate this step and share the commands to mount a iSO into iLO using SSH or how i can create a workflow for that.

--This might be helpfull for you: https://unixhealthcheck.com/blog?id=270

5. ESXi installer will download Kickstart from pre-defined location>>>>>>>>>>Could you please more elaborate this step, How i can download script run into the esxi which just rebooted,

6. ESXi installer will install ESXi host based on Kickstart script (Setup hostname, networking, etc...) Could you please more elaborate this step.

-- To answer both question at once I would say it would be good to at first get familiar with Kickstart it self.

In principal kickstart is the same for ESXi hosts or  for Linux servers, just for ESXi hosts might be way more simple in terms of content, so you probably do not need any tool, which will create ks.cfg for you, and you may write it by your self.

https://docs.vmware.com/en/VMware-vSphere/6.5/vsphere-esxi-vcenter-server-65-installation-setup-guid... -- Section: Options for Installing ESXi / Scripted ESXi Installation

About the Default ks.cfg Installation Script  -- Just be carefull with using --firstdisk --overwritevmfs if you are having SAN or local disks with usefull data.

https://be-virtual.net/automated-installation-with-vmware-esxi-5-56-06-5/

https://rudimartinsen.com/2018/06/09/customizing-esxi-installation-with-kickstart-files-and-pxe-boot...

https://blog.comdivision.com/blog/2018/05/esxi-autoinstall-with-kickstart-and-pxe

---------------------------------------------------------------------------------------------------------

Was it helpful? Let us know by completing this short survey here.

ccnasaurabh1
Enthusiast
Enthusiast
Jump to solution

Thanks a lot David788 !!

I Did that, Only one last question - How i can apply host profile into on newly created host through VRO or PowerShell.

Please share any command or best way to apply host profile. Rest of the work i have done.

Thanks

Saurabh

Reply
0 Kudos
ccnasaurabh1
Enthusiast
Enthusiast
Jump to solution

Hi David

I have created a VRO Workflow for building & Rebuilding esxi host on demand but I am trying to save all required inputs in VRO Attribute so that vro can auto populate all required values for rebulding the host.

Because I f i am trying to rebuild any ESXi host so the same Inputs for storage and networking ,DV switch e.t.c needs to fill out manually on the VRA form.

So could you please share any idea to save all required inputs into attribute so that while rebuilding the ESXi all required inputs will be auto populate on the VRA form.

or any script can pull out allesxi & vCenter info.

Thanks!

Reply
0 Kudos
David788
Contributor
Contributor
Jump to solution

There are multiple options how to read existing parameters from your environment.

I would suggest to build dedicated workflow, which will get All ESXi hosts and then one by one store all your necessary data to configuration file / files as you decide the structure of those files.

Once you have decided ConfigurationElement structure, you may use it in your Workflow/Attributes to read and write data from them.

Just keep in mind, that it is handy to "lock" configuration element before writing anything to it, to prevent writing in parallel and having corrupted data.

I've got inspiration for my application from following links, when I was dealing with this topic:

vRealize Orchestrator Forum - VMware {code}

https://www.virtualiseme.net.au/index.php/learning-vro-part-7-configurations/

https://cstan.io/?p=8968&lang=en

Reply
0 Kudos
ccnasaurabh1
Enthusiast
Enthusiast
Jump to solution

Thanks For Responding Devid!

I did that using vro attribute.

Thanks again.

Reply
0 Kudos
aslk5
Enthusiast
Enthusiast
Jump to solution

Hi ccnasaurabh1,

I'm working on a similar project for building and rebuilding hosts and have a similar issue with trying to figure out how to save/repopulate any and all values and it's proving to be harder than I thought. Are there any workflows for your esxi build or pieces of code you would be willing to share?

Reply
0 Kudos
ccnasaurabh1
Enthusiast
Enthusiast
Jump to solution

I am unable to share my workflow due to VPN security issue but I can help for all steps. Sorry about that.

1) We have generated required info in JSON format as a output of PS scripts

2) converted all data using jsone.parse .  ( useful URL- JSON.parse()  )

3) Saved required all info of ESXI in the VRO Attributes

4) I have reused all attributes as a input in next workflow after completing the ESXi installation.

Reply
0 Kudos
aslk5
Enthusiast
Enthusiast
Jump to solution

Did you write large custom scripts to read the data and then write it back to the host?

I'm not a programmer so i'm finding it tricky to work with all the objects. I think I have two ideas I can use:

1) Save the minimal set of info (basically vmks/vmnic stuff) and then scripting trying to re-add to a distributed switch. None of this seems that simple

2) Use a host profile to do the heavy lifting but using vRO to fill in the data for the customization (which seems a little complicated)

In your case how did you handle setting up the host?

Reply
0 Kudos
ccnasaurabh1
Enthusiast
Enthusiast
Jump to solution

I am still Straggling for Host Profile but for HOSt profile, Remove networking from host , Remove host from cluster , add networking ,add storage ,remove storege all stuff taken  by PS Script And I called All PS script using VRO. That's it!

Reply
0 Kudos
aslk5
Enthusiast
Enthusiast
Jump to solution

Is mounting an ISO and virtual floppy/usb at the same time also an option? I was thinking of trying the same thing with a ISO+kickstart pointing to the virtual floppy. The kickstart would be hard coded location and I would have to find a way to write out the kickstart file i want and create a .img from it.

The floppy would be named the same as the host I'm building so I wouldn't have any issues running multiple concurrent workflows.

Seems like it would work but I'm a long way off from that point for now.

Reply
0 Kudos