Wednesday, March 5, 2014

VMware ESXi unattended installation AKA kickstart or KS script.

Again a post related to VCP curriculum.

I know most of the cases we are not looking at these unattended options because ESXi installation is quite simple and fast.

But if you are installing large number of hosts this can be handy.

In this case first thing is to prepare the script with all the required settings. Since im doing it in a lab environment here is the sample script that i will be using for this.

+++++++++++++++

 #
 # Sample scripted installation file
 #
 # Accept EULA
 vmaccepteula
 # Set root password
 rootpw password
 #Install on local disk overwriting any existing VMFS datastore
 install --firstdisk --overwritevmfs
 # Network configuration
 network --bootproto=static --device=vmnic0 --ip=20.198.49.236 --netmask=255.255.255.0 --gateway=20.198.49.1 --nameserver=20.198.49.230 --hostname=esxi2.vcp.net --vlanid=100 --addvmportgroup=1
 #Reboot after installation completed
 reboot  

++++++++++++++++

You can find more details about all the available options from vmware website. copy it to a notepad file and save it as ks.cfg. Name can be anything as long as it has CFG file extension.

Once you are done with the script. you will need to boot from the CD. then press shift + o to execute the script you created.

Once you press shift+o you will notice its shows a prompt with runweasel. delete the runweasel and type
 
ks=http://20.198.49.230/ks/ks.cfg ip=20.198.49.189 netmask=255.255.255.0 gateway=20.198.49.1
ESXi installer will use those ip parameters to access the http file path. If you are using nested environment please change the port group for the first interface which support specific VLAN. This supports many protocol options such as ftp and nfs. Since i used HTTP for this example it will try to download the configuration from the HTTP server by using HTTP get. 
Here is a extra tip incase if you are trying this on IIS make sure you configure MIME Types to support CFG file extensions. Other wise you will notice ESXi is struggling to download the configuration from IIS server. 

Cheers.   




Nested ESXi 5.1.

Yes i know there are many resources on this topic. Since i started working on vmware certifications (again) i decided to write about this topic. im trying for VCP510 thats why im focusing on ESXi 5.1 on this post.

As of now im having four vmware ESXi instances and one Hyper-V instance in my home lab. Im using them everyday for my office related tasks. Because of that i didnt wanted to continue my vmware tests on those machines. instead of that i decided to use nested ESXi for my testings. Its pretty straight forward. Here i have two different ESXi flavors in my lab. ESXi 5 and ESXi 5.1 (dont ask why its complicated).

First thing is you need to is edit /etc/vmware/config to support nested ESXi or else you will have to enable this for each and every VM. Well im lazy so i edit above file. There is trick here if you are using vmware ESXi 5 in your physical host you will need to add below line

vhv.allow = "true"

But if you are using ESXi 5.1 you will have to use 

vhv.enable = "true"

Once you are done with that you are good start with the virtual machine creation for your nested ESXi instance. These steps are on how to do it using the vSphere GUI client not based on the web client. There will be some differences when you use web based client.

1. Start the new virtual machine wizard and select custom configuration.  

2. Specify a name for your virtual machine.

3. Select a storage path for your virtual machine.

4. Select the virtual machine version as 8. Since im using ESXi 5.1 i dont have the luxury of using virtual machine version 9.

5. As the guest operating system select other 64 bit. At the time of creating a new virtual machine you don't have the luxury of selecting vmware esxi 5 as the guest operating system. But once you create your vm you will have to select vmware esxi 5 as the guess operating system.

6. Select multiple CPU's and multiple Cores for your vm. Otherwise ESXi installation wizard will complain about it.

7. Allocate required amount of memory for your nested instance. I always select 16 GB :D

8. Next step it will give you an option to select amount of network interfaces. if you are studying for VCP its very important that you select multiple interfaces since you will be utilizing them for different tasks. But virtual machine creating wizard will allow you to select maximum of 4 network interfaces. You can change it later once you are done with the creating of your virtual machine.

Its very important that you create a separate port group to support all the vlans. if you are wondering how to do that. Go to your vSwitch0 properties and add new port group. assign a suitable name (my case it will be ESXi) and for the VLAN id select ALL from the drop down menu.

9.  For the SCSI controller wizard will suggest you to use LSI logic Parallel. Just go with it.

10. Create a new virtual disk and assign a capacity for that. Since i ll be depending a lot on shared datastores i ll just create 5 GB virtual disk. Select thick provision or Thin provisioning format. im always going ahead with thin provision. i really dont want to waste my SSD drive for this. (Can you believe the pricing for SSD disks these days. When this will be cheap ? )

11. Complete the wizard.

12. Edit the virtual machine settings again. Change the CPU/MMU virtualization setting to INTEL EPT / AMD RVI. its important to select this option because otherwise you wont be able to run 64 bit clients inside your nested environment. Just make sure your processor support this. Specially if you are planning to buy hardware for a nested lab its very important that you do some research before buying the actual hardware.

13. Then change the operating system as vmware ESXi 5.X. its listed under other operating system list.

You are pretty much done here. Mount the ISO and start the installation. If you are just lazy to follow the procedure, just download the OVA from the below link and install ESXi directly. :D

http://www.4shared.com/file/XbYVt0_ace/esxi-1.html

Enjoy :)


Well i had to start again

Topic says all :)

i removed this blog due to some issues. Here im online again talking crap about technical things. 

Cheers.