Adding drivers to the ESXi installer and create custom images
(2011-06-29 04:57:12)
标签:
it |
分类: 工作 |
This method is enable you to
use drivers that are not part of the standard ISO is to inject them
into the ISO. This is a bit more complex and a less flexible
solution as every update to the drivers will require the ISO to be
repackaged. Also note that VMware currently does not support the
injection of drivers into the ISO and this procedure is provided
"as is" without warranty/guarantee.
The following tools are used to alter the ISO:
1.
2.
The first step is to import the Auto Deploy appliance into VMware
Workstation or VC.
Deploying and Configuring the Appliance
You can deploy the Auto Deploy appliance on an ESX/ESXi system of
your choice. The system can be managed by a different vCenter
Server system than the one you want to add hosts to. The system
must be able to connect to vCenter Server system you want to add
hosts to.
To deploy Auto Deploy
1 Log in to a vSphere Client connected to vCenter Server 4.1
system.
2 In the inventory pane, select the ESX/ESXi host to which you want
to deploy Auto Deploy.
3 Select File > Deploy OVF Template. The Deploy OVF
Template wizard appears.
4 Click Browse and select the location of the OVA file.
5 Click Next when the download details are displayed, and accept
the license agreement.
6 When prompted, specify a name and select a location and a folder
(optional) for the virtual appliance.
7 Select the resource pool for the virtual appliance. You can leave
the default, which is the top‐level root resource pool.
8 If prompted, select the datastore to store the virtual appliance
on and click Next.
9 Select the network mapping and click Next.
10 Review the information and click Finish.
The wizard deploys the Auto Deploy appliance to the host that you
selected. The deploy process can take several minutes.
Next you configure your Auto Deploy appliance. When you start Auto
Deploy the first time, it prompts you for the following
configuration information:
Host name for the appliance.
Network configuration for the virtual appliance: IP address,
subnet mask, DNS Server, and gateway.
Password for the vi‐admin user. No root user exists on Auto
Deploy, but the vi‐admin user has root user privileges.
To configure Auto Deploy
1 In the vSphere Client, right‐click the virtual appliance, and
click Power On.
2 Select the Console tab.
3 Answer the network configuration prompts. If multiple network
adapters are on the host, you can later use the vSphere Client to
add a second network adapter to Auto Deploy.
4 When prompted, specify a host name for Auto Deploy.
The name can include alphanumeric characters and cannot be longer
than 80 characters.
You can later change the Auto Deploy host name by modifying the
/etc/sysconfig/network file, as you would for any Linux
system.
5 When prompted, specify a password for the vi‐admin user on this
system. This user has root privileges;
no root user is
defined.
The prompt uses the Linux passwd utility.
If you specify a password considered insecure, for example, a
dictionary word or a word with less than six characters, a Bad
Password message is displayed. Choose a different password.
For
information about requirements for secure passwords, search the
Internet for “Linux secure
password.”
You can use special characters directly at the prompt. You do not
need to precede special characters with escape characters or
surround words that contain special characters in quotes.
You can later change the password for the vi‐admin user using the
Linux passwd command.
Auto Deploy is now configured and prompts you to log in as
vi‐admin. As vi‐admin, you can add servers to Auto Deploy and run
commands from the Auto Deploy console.
IMPORTANT Make sure Auto Deploy is connected to the management
network on which the vCenter Server and ESXi systems that Auto
Deploy will interact with are located.
IMPORTANT VMware recommends setting up Auto Deploy with a static IP
address.
VMware Tools is automatically available for images that are on the
Auto Deploy appliance and referenced by a relative path. If you
create a boot profile that uses a URL to point to the repository,
you cannot access VMware Tools directly.
For example, of the boot profile was created by running deploy-cmd
createprofile -n test -r
http://localhost/vmw/vSphere/test,
you cannot access VMware Tools directly, but must install them
explicitly from vmware.com.
When it has been imported you will need to power it on and make the
ESXi ISO available. (If the power-on fails with a kernel panic you
will need to change the SCSI device to "lsilogic" and the OS to
"Redhat 5 - 64Bit".) When the ISO is available the following steps
will need to be taken to inject a driver:
1.
sudo mount -o loop
VMware-VMvisor-Installer-4.1.0.update1-348481.x86_64.iso
/mnt/iso/
2.
mkdir /tmp/custom-iso
3.
cp -R /mnt/iso/* /tmp/custom-iso/
4.
cd /tmp
5.
sudo bunzip2 -c /tmp/custom-iso/imagedd.bz2 >
imagedd
6.
sudo vibddi -i imagedd -v
<filename.vib> -n
7.
sudo vibddi -i imagedd -q
8.
bzip2 imagedd
9.
md5sum imagedd.bz2
10.
/tmp/custom-iso/imagedd.md5
11.
cp imagedd.bz2 /tmp/custom-iso/
12.
cd /tmp/custom-iso
13.
mkisofs -l -J -R -r -T -input-charset UTF-8 -o
/tmp/VMware-Custom-VMvisor-Installer-4.1.0.update1-348481.x86_64.iso
-b isolinux.bin -c boot.cat -no-emul-boot -boot-load-size 4
-boot-info-table /tmp/custom-iso
Now the ISO should be ready for use! Again, please note that VMware
does not support the "vibddi" injection mechanism. However, I
decided to document this procedure as in some cases it is very
difficult to install ESXi without having the drivers packaged
inside the ISO and I wanted to show that it is possible.
Example (Screen Copy) add EMC
powerpath driver to the HP Bundled ISO.
Last login: Mon Jun 27
11:22:58 2011 from 10.42.15.115
Welcome to VMware Auto Deploy
run 'deploy-cmd' or see http://www.vmware.com/go/deploy
for more details.
run 'vma-help' or see http://www.vmware.com/go/vma
for more details.
[vi-admin@autodploy ~]$ cd
/
[vi-admin@autodploy /]$ cd home/vi-admin/
[vi-admin@autodploy ~]$ ls
VMWare_ADD
[vi-admin@autodploy ~]$ cd VMWare_ADD/
[vi-admin@autodploy VMWare_ADD]$ ls
4.1_U1_Apr_2011_ESXi_HD_USB_SDImgeInstlr_Z7550_00096.iso
EMCPower.VMWARE.5.4.SP2.b298.zip
[vi-admin@autodploy VMWare_ADD]$ sudo cp
EMCPower.VMWARE.5.4.SP2.b298.zip \opt\vm
ware\share\iso
Password:
[vi-admin@autodploy VMWare_ADD]$ cd /opt/vmware/share/iso
[vi-admin@autodploy iso]$ ls
4.1_U1_Apr_2011_ESXi_HD_USB_SDImgeInstlr_Z7550_00096.iso
PowerPath_VE_5.4.SP2_for_VMWARE_vSphere_Install_SW_Bundle.zip
VMware-VMvisor-Installer-4.1.0-260247.x86_64.iso
EMCPower.VMWARE.5.4.SP2.b298.zip
[vi-admin@autodploy /]$ sudo mount -o loop
/opt/vmware/share/iso/4.1_U1_Apr_2011
_ESXi_HD_USB_SDImgeInstlr_Z7550_00096.iso /mnt/iso/
[vi-admin@autodploy /]$ sudo cp -R /mnt/iso/*
/tmp/custom-iso/
[vi-admin@autodploy /]$ cd /tmp
[vi-admin@autodploy tmp]$ sudo bunzip2 -c
/tmp/custom-iso/imagedd.bz2 > imagedd
[vi-admin@autodploy tmp]$ sudo vibddi -i imagedd -o
/opt/vmware/share/iso/EMCPow
er.VMWARE.5.4.SP2.b298.zip -n
Setting up configuration for esxupdate
This may take a few seconds...
Checking bootbank filesystems (pre-install)
Installing offline bundle:
/opt/vmware/share/iso/EMCPower.VMWARE.5.4.SP2.b298.zip
Update operation completed successfully
Checking bootbank filesystems (post-install)
[vi-admin@autodploy tmp]$ sudo vibddi -i imagedd -q
< oem-hp-smx-provider (410.02.07.70-260247)
>
< oem-hp-support (410.1.2.0-164009)
>
< oem-vmware-esx-drivers-char-hpilo
(400.8.7.1.1VMW-164009) >
< oem-vmware-esx-drivers-net-be2net
(400.2.102.518.0-1vmw.2.17.249663) >
< oem-vmware-esx-drivers-net-bnx2x
(400.1.60.50.v41.2-1vmw.0.0.00000) >
< oem-vmware-esx-drivers-net-nx-nic
(400.4.0.570-1vmw.2.17.00000) >
< oem-vmware-esx-drivers-net-qlcnic
(400.4.0.719-1OEM) >
< oem-vmware-esx-drivers-net-vxge
(400.2.0.28.21239-1OEM) >
< oem-vmware-esx-drivers-scsi-3w-9xxx
(400.2.26.08.036vm40-1OEM) >
< oem-vmware-esx-drivers-scsi-be2iscsi
(400.2.102.525.9-1vmw.0.0.343171) >
< oem-vmware-esx-drivers-scsi-bfa (400.2.1.1.1-1OEM)
>
< oem-vmware-esx-drivers-scsi-lpfc820
(400.8.2.1.79.28-1OEM) >
< oem-vmware-esx-ima-be2iscsi
(400.2.102.525.9-1vmw.0.0.343171) >
< powerpath.cim.esx (5.4.2.00.00-b298)
>
< powerpath.plugin.esx (5.4.2.00.00-b298)
>
< vmware-esx-drivers-char-hpnmi
(410.1.2.0.1VMW-260247) >
< vmware-esx-firmware (4.1.0-1.4.348481)
>
< CMPI-1.0 >
< VMW_CMPI_CPP-1.0.5 >
< vmkapi_1_1_0_0 >
< vmknexus1kvapi-1-4 >
< vmkepsecapi_1.0.0.0 >
< DriverAPI-9.0 >
< DriverAPI-9.1 >
< vmware-esx-tools-light (4.1.0-1.4.348481)
>
[vi-admin@autodploy tmp]$ bzip2 imagedd
[vi-admin@autodploy tmp]$ md5sum imagedd.bz2
432109c30e47535657980a73
[vi-admin@autodploy tmp]$ cd custom-iso/
[vi-admin@autodploy
custom-iso]$ sudo vi imagedd.md5
Password:
[vi-admin@autodploy custom-iso]$ vi imagedd1.md5
:: rename the file
[vi-admin@autodploy
custom-iso]$ ls
a.z
boot.cat
cimstg.tgz
cim.vgz
[vi-admin@autodploy custom-iso]$ vi imagedd.md5
[vi-admin@autodploy custom-iso]$ cd ..
8 -o /tmp/VMware-Custom-ESXi_4.1.iso -b isolinux.bin -c boot.cat
-no-emul-boot -
boot-load-size 4 -boot-info-table /tmp/custom-iso
Password:
Unknown file type (unallocated) /tmp/custom-iso/.. - ignoring and
continuing.
Size of boot image is 4 sectors -> No
emulation
Total translation table size: 6272
Total rockridge attributes bytes: 1814
Total directory bytes: 2962
Path table size(bytes): 10
Max brk space used 0
239541 extents written (467 MB)
Done!! copied the ISO and installed on the HP 460c G7 server, works great.