载入中。。。 'S bLog
 
载入中。。。
 
载入中。。。
载入中。。。
载入中。。。
载入中。。。
载入中。。。
 
填写您的邮件地址,订阅我们的精彩内容:


 
VMWare ESXi 技巧
[ 2011/4/6 21:53:00 | By: 梦翔儿 ]
 

The VMWare ESXi is a virtual machine hypervisor. Unlike the traditional VMWare Server, you don't need to install an OS to host the server. Instead, the hypervisor itself is a small OS by itself. All system calls are optimized for VM. This improves performance and reduces resource wastage.

The new VMWare ESXi (version 4.0 and above) only supports 64-bit CPU. While the older version (version 3.5 and below) supports 32-bit CPU.

Either way, the ESXi supports a very limited hardware (e.g. chipsets, network cards, CPUs). So make sure to check your system is compatible with the VMWare compatibility database.

This guide is written for the ESXi 3.5.

Installation

Download the ESXi from VMWare website. Then burn the image to CD and boot into it. Follow the instructions to complete the installation.

Once installation is completed, you can control the server using a client from another machine. Using a web browser, go to http://[server name/IP]. Then download the VMware Infrastructure Client (VIC). Install the program in a Windows machine and you can start logging in. The default username is "root" and pssword is blank. So don't forget to change it. You can also disable root access.

Note: IDE hard disk

In some cases. the ESXi might not recognize your hard drink. And so it will complain there is no hard disk to write the image to.

  1. Press ALT-F1 to access the console. The username is "root" and password is blank.
  2. Edit the TargetFilter.py file.

     vi /usr/lib/vmware/installer/Core/TargetFilter.py
  3. Find the section "def IDEFilter", and change from:
     return interface.GetInterfaceType() == ScsiInterface.SCSI_IFACE_TYPE_IDE
    to
    return interface.GetInterfaceType() == ScsiInterface.SCSI_IFACE_TYPE_ISCSI
  4. Press ALT-F2 to return to the screen and continue the install, an error still be shown. Press ALT-F1 into the console again and type:
     install
    Continue with the installation.

Note: Booting up a fresh new VM guest

When a newly created virtual machine boots up, the boot order is:

  • Removable storage
  • Hard disk
  • CD-ROM
  • Network

Therefore, if you need to boot to a CD, you will have to change that order in the virtual BIOS, or press "Esc" during booting and select CD-ROM.

Note: Installing Windows XP guest machine

Windows XP does not have an appropriate SCSI driver. So during the installation, XP cannot detect a drive. You will need to download the SCSI Disk Drivers for VMware Server, Workstation or ACE. Then mount the image as floppy in VIC.

Enabling SSH on the ESXi Server

The ESXi has SSH disabled by default. To enable SSH (this is acquired from VMWare website):

  1. Press ALT-F1 to access the console window.
  2. Enter unsupported in the console and then press Enter. You will not see the text you type in.
  3. If you typed in unsupported correctly, you will see the Tech Support Mode warning and a password prompt. Enter the password for the root login.
  4. Edit the file /etc/inetd.conf.
  5. Find the line that begins with #ssh and remove the #. Then save the file.
  6. Restart host or try kill -HUP `ps | grep inetd`

Converting Other VMDK format into ESXi Compatible Format

Upload the legacy VMDK files onto the ESXi server, then ssh into it and use the vmkfstools tool:

vmkfstools -i [old].vmdk [new].vmdk

Converting IDE Virtual Drive to SCSI Virtual Drive

ESXi only runs on SCSI disk, so if you have IDE you will need to convert it to SCSI:

  1. Edit the vdisk's vmdk file. You will see a block of section like this:

    # Extent description
    RW 4192256 SPARSE "Windows XP Professional-f001.vmdk"
    RW 4192256 SPARSE "Windows XP Professional-f002.vmdk"
    RW 4192256 SPARSE "Windows XP Professional-f003.vmdk"
    RW 4192256 SPARSE "Windows XP Professional-f004.vmdk"
    RW 8192 SPARSE "Windows XP Professional-f005.vmdk"
  2. The numbers represent the sectors. Add them all up to get total number of sectors.
  3. Looking down the vmdk file you will see another block that looks like this:

    ddb.adapterType = "buslogic"
    ddb.geometry.sectors = "63"
    ddb.geometry.heads = "16"
    ddb.geometry.cylinders = "16383"
    ddb.virtualHWVersion = "7"
  4. For SCSI, the setting should be like this:

    ddb.adapterType = "buslogic" -OR- "lsilogic"
    ddb.geometry.sectors = "63"
    ddb.geometry.heads = "255"
    ddb.geometry.cylinders = [CYLX]
    ddb.virtualHWVersion = "4"
  5. AdapterType: Use "lsilogic" if your guest is Windows 2003, 2008, Vista or Linux. Use "buslogic" if your guest is Windows NT, 2000, XP.

  6. CYLX = (total number of sectors) / 63 / 255. Take the lower bound value if there's decimal point.

Troubleshooting Resource Allocation

On a low-end server, you might get the following errors for resource allocation (e.g allocating 2 CPUs) to a VM guest.

Error: “Could not power on VM: Admission check failed for memory resource”
Solution: Go to "Configuration" --> "System resource allocation" --> "Advanced". Then, find "VIM" in the tree. Click "Edit settings" and change the reservation from 512 MB to 192 MB.

Error: “Could not power on VM: Admission check failed for cpu resource”
Solution: On each virtual machines, click "Settings" --> "Resources". Then, set CPU with a reservation of 0Mhz and verify that "Advanced CPU" --> "Hyperthreaded Cored Shared Mode" is set to "Any".

Links

Unofficial VMWare ESXi support website: http://vm-help.com

 
 
  • 标签:ESXi 
  • 发表评论:
    载入中。。。

     
     
     

    梦翔儿网站 梦飞翔的地方 http://www.dreamflier.net
    中华人民共和国信息产业部TCP/IP系统 备案序号:辽ICP备09000550号

    Powered by Oblog.