加载中…
个人资料
  • 博客等级:
  • 博客积分:
  • 博客访问:
  • 关注人气:
  • 获赠金笔:0支
  • 赠出金笔:0支
  • 荣誉徽章:
正文 字体大小:

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. Auto Deploy appliance
2. VMware Workstation (VMware Player or ESXi will also work)

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. Mount the ISO image
sudo mount -o loop VMware-VMvisor-Installer-4.1.0.update1-348481.x86_64.iso /mnt/iso/
2. Create a new folder which will be used for the content of the mounted IS0
mkdir /tmp/custom-iso
3. Copy the content of the ISO to the folder
cp -R /mnt/iso/* /tmp/custom-iso/
4. Go to the tmp folder
cd /tmp
5. Unzup the image to enable the injection of a bundle
sudo bunzip2 -c /tmp/custom-iso/imagedd.bz2 > imagedd
6. Inject the bundle (-o) or a driver (-v) into the image, for the exercise we will insert a single .vib file, please not that <filename.vib> will need to replaced with the actual filename
sudo vibddi -i imagedd -v <filename.vib> -n
7. Validate that the bundle has been injected
sudo vibddi -i imagedd -q
8. Zip the image
bzip2 imagedd
9. Create a new checksum
md5sum imagedd.bz2
10. Copy the checksum and replace the checksum in the following file using your favorite editor (I used "vi")
/tmp/custom-iso/imagedd.md5
11. Copy the file to the custom ISO folder (might need to "sudo" depending on the permissions)
cp imagedd.bz2 /tmp/custom-iso/
12. Go to the custom ISO folder
cd /tmp/custom-iso
13. Recreate the ESXi ISO
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
432109c30e47535657980a7335fa1234  imagedd.bz2
[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         ienviron.vgz  install.vgz   menu.c32                  tboot.gz
boot.cat    imagedd2.md5  isolinux.bin  open_source_licenses.txt  vmkboot.gz
cimstg.tgz  imagedd.bz2   isolinux.cfg  README.txt                vmkernel.gz
cim.vgz     imagedd.md5   mboot.c32     sys.vgz
[vi-admin@autodploy custom-iso]$ vi imagedd.md5
[vi-admin@autodploy custom-iso]$ cd ..
[vi-admin@autodploy custom-iso]$ sudo mkisofs -l -J -R -r -T -input-charset UTF-
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
  2.09% done, estimate finish Mon Jun 27 12:19:10 2011
  4.18% done, estimate finish Mon Jun 27 12:19:10 2011
  6.27% done, estimate finish Mon Jun 27 12:19:25 2011
  8.35% done, estimate finish Mon Jun 27 12:19:21 2011
 10.44% done, estimate finish Mon Jun 27 12:19:19 2011
 12.53% done, estimate finish Mon Jun 27 12:19:17 2011
 14.62% done, estimate finish Mon Jun 27 12:19:16 2011
 16.70% done, estimate finish Mon Jun 27 12:19:21 2011
 18.79% done, estimate finish Mon Jun 27 12:19:20 2011
 20.87% done, estimate finish Mon Jun 27 12:19:19 2011
 22.97% done, estimate finish Mon Jun 27 12:19:18 2011
 25.05% done, estimate finish Mon Jun 27 12:19:21 2011
 27.14% done, estimate finish Mon Jun 27 12:19:21 2011
 29.22% done, estimate finish Mon Jun 27 12:19:20 2011
 31.31% done, estimate finish Mon Jun 27 12:19:19 2011
 33.40% done, estimate finish Mon Jun 27 12:19:18 2011
 35.49% done, estimate finish Mon Jun 27 12:19:18 2011
 37.57% done, estimate finish Mon Jun 27 12:19:17 2011
 39.66% done, estimate finish Mon Jun 27 12:19:20 2011
 41.75% done, estimate finish Mon Jun 27 12:19:19 2011
 43.84% done, estimate finish Mon Jun 27 12:19:19 2011
 45.92% done, estimate finish Mon Jun 27 12:19:18 2011
 48.01% done, estimate finish Mon Jun 27 12:19:18 2011
 50.10% done, estimate finish Mon Jun 27 12:19:19 2011
 52.19% done, estimate finish Mon Jun 27 12:19:19 2011
 54.27% done, estimate finish Mon Jun 27 12:19:21 2011
 56.36% done, estimate finish Mon Jun 27 12:19:20 2011
 58.45% done, estimate finish Mon Jun 27 12:19:20 2011
 60.54% done, estimate finish Mon Jun 27 12:19:19 2011
 62.62% done, estimate finish Mon Jun 27 12:19:27 2011
 64.71% done, estimate finish Mon Jun 27 12:19:33 2011
 66.80% done, estimate finish Mon Jun 27 12:19:32 2011
 68.89% done, estimate finish Mon Jun 27 12:19:31 2011
 70.97% done, estimate finish Mon Jun 27 12:19:31 2011
 73.06% done, estimate finish Mon Jun 27 12:19:30 2011
 75.14% done, estimate finish Mon Jun 27 12:19:31 2011
 77.24% done, estimate finish Mon Jun 27 12:19:30 2011
 79.32% done, estimate finish Mon Jun 27 12:19:30 2011
 81.41% done, estimate finish Mon Jun 27 12:19:34 2011
 83.50% done, estimate finish Mon Jun 27 12:19:36 2011
 85.58% done, estimate finish Mon Jun 27 12:19:39 2011
 87.67% done, estimate finish Mon Jun 27 12:19:39 2011
 89.76% done, estimate finish Mon Jun 27 12:19:42 2011
 91.85% done, estimate finish Mon Jun 27 12:19:42 2011
 93.93% done, estimate finish Mon Jun 27 12:19:44 2011
 96.02% done, estimate finish Mon Jun 27 12:19:45 2011
 98.11% done, estimate finish Mon Jun 27 12:19:45 2011
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.

0

阅读 收藏 喜欢 打印举报/Report
  

新浪BLOG意见反馈留言板 欢迎批评指正

新浪简介 | About Sina | 广告服务 | 联系我们 | 招聘信息 | 网站律师 | SINA English | 产品答疑

新浪公司 版权所有