ESXi

From Attie's Wiki
Jump to: navigation, search

Contents

Enable SSH

Direct - via the keyboard

  1. At the console, press F2 and login
  2. Select Troubleshooting Options
  3. Select Enable SSH
  4. Press ESC to logout

vSphere

  1. Configuration tab
  2. Security Profile
  3. Properties... for Services
  4. SSH
  5. Options...
  6. Start
  7. Start and stop with host
  8. OK

Cloning a VM

You should copy the files, and then remove all lines that match the following regex from the *.vmx file

^ethernet[0-9]+.generatedAddress

Hanging on ipmi_si_drv

  1. Press Shift + O and append noipmiEnabled to the boot args
  2. Once booted, connect with vSphere and add uncheck VMkernel.Boot.impiEnabled

Virtual Machine with PassThrough devices won't boot

  • Enable SSH
  • Login via SSH
  • Locate the VM's store (/vmfs/volumes/...)
  • There is probably a vmware.log file, cat it:
cat vmware.log | grep pciHole
  • You'll probably find something like this:
2011-10-12T18:56:50.990Z| vcpu-0| \[msg.pciPassthru.mmioOutsidePCIHole\] PCIPassthru 008:00.0: Guest
tried to map 32 device pages (with base address of 0xb2520) to a range occupied by main memory. This
is outside of the PCI Hole. Add pciHole.start = "2853" to the configuration file and then power on
the VM.
  • Add the following line to your VM's *.vmx file (don't forget to use the correct value!):
pciHole.start = "2853"

Use a VM from VMWare Player

If you get the "unsupported or invalid disk type 7" error while powering on a VM, do the following:

  1. Locate and run: vmkfstools -i <vmware_player_disk_in> -d zeroedthick <esxi_disk_out>

VNC to a Virtual Machine's Console

Add the following to the .vmx file:

RemoteDisplay.vnc.enabled = TRUE
RemoteDisplay.vnc.port = 27015
RemoteDisplay.vnc.password = hello123

Don't forget to add a firewall rule!

Custom Firewall Rules

This example file would be stored at /etc/vmware/firewall/vnc.xml.

<!-- Custom Firewall Rule set for VNC -->
<ConfigRoot>
        <service>
                <id>VNC</id>
                <rule id='0000'>
                        <!-- VM: xxxx -->
                        <direction>inbound</direction>
                        <protocol>tcp</protocol>
                        <porttype>dst</porttype>
                        <port>5900</port>
                </rule>
                <enabled>true</enabled>
                <required>false</required>
        </service>
</ConfigRoot>

You can then reload the Firewall rules by running this command:

esxcli network firewall refresh

And list them:

esxcli network firewall ruleset list

Persistent Command Line Settings

Any configuration done on the command line (for example adding custom firewall rules), will not be persistent. To make it persistent, you should make the following file in /bootbank/custom.do

#!/bin/sh
 
tar -czvf /bootbank/custom.tgz /etc/vmware/firewall/vnc.xml

Ensure that every customized file is added to the archive, and run the script every time you make a change.

Use SATA drive as an RDM

  1. Login as root
  2. Run fdisk -l and locate the disk you wish to use
  3. Run ls /dev/disks/ -l and locate the symlink to that disk
  4. Goto the correct directory to place the new vmdk
  5. Run vmkfstools -r /vmfs/devices/disks/<symlink> RDM.vmdk -a lsilogic
    1. Disk type
      • -r - create Virtual device
      • -z - create Physical (passthrough) device - careful with these
    2. Controller -a ...
      • buslogic - probrably not
      • lsilogic
      • ide

Expand a Virtual Disk

NEW_SIZE=100Gb
vmware-vdiskmanager -x ${NEW_SIZE} ${VMDK}
Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox