ESXi
From Attie's Wiki
(Difference between revisions)
m (Created page with 'Useful stuffs... == Hanging on ipmi_si_drv == # Press <code>Shift + O</code> and append <code>noipmiEnabled</code> to the boot args # Once booted, connect with vSphere and add uā¦') |
m (āāExpand a Virtual Disk) |
||
(17 intermediate revisions by one user not shown) | |||
Line 1: | Line 1: | ||
ā | + | == Enable SSH == | |
+ | === Direct - via the keyboard === | ||
+ | # At the console, press <code>F2</code> and login | ||
+ | # Select <code>Troubleshooting Options</code> | ||
+ | # Select <code>Enable SSH</code> | ||
+ | # Press <code>ESC</code> to logout | ||
+ | |||
+ | === vSphere === | ||
+ | # <code>Configuration</code> tab | ||
+ | # <code>Security Profile</code> | ||
+ | # <code>Properties...</code> for <code>Services</code> | ||
+ | # <code>SSH</code> | ||
+ | # <code>Options...</code> | ||
+ | # <code>Start</code> | ||
+ | # <code>Start and stop with host</code> | ||
+ | # <code>OK</code> | ||
+ | |||
+ | == Cloning a VM == | ||
+ | You should copy the files, and then remove all lines that match the following regex from the <code>*.vmx</code> file | ||
+ | <source lang="text"> | ||
+ | ^ethernet[0-9]+.generatedAddress | ||
+ | </source> | ||
== Hanging on ipmi_si_drv == | == Hanging on ipmi_si_drv == | ||
# Press <code>Shift + O</code> and append <code>noipmiEnabled</code> to the boot args | # Press <code>Shift + O</code> and append <code>noipmiEnabled</code> to the boot args | ||
# Once booted, connect with vSphere and add uncheck <code>VMkernel.Boot.impiEnabled</code> | # Once booted, connect with vSphere and add uncheck <code>VMkernel.Boot.impiEnabled</code> | ||
+ | |||
+ | == Virtual Machine with PassThrough devices won't boot == | ||
+ | * Enable SSH | ||
+ | * Login via SSH | ||
+ | * Locate the VM's store (<code>/vmfs/volumes/...</code>) | ||
+ | * There is probably a vmware.log file, <code>cat</code> it: | ||
+ | <source lang="bash"> | ||
+ | cat vmware.log | grep pciHole | ||
+ | </source> | ||
+ | * You'll probably find something like this: | ||
+ | <pre> | ||
+ | 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. | ||
+ | </pre> | ||
+ | * Add the following line to your VM's *.vmx file (don't forget to use the correct value!): | ||
+ | <pre> | ||
+ | pciHole.start = "2853" | ||
+ | </pre> | ||
+ | |||
+ | == Use a VM from VMWare Player== | ||
+ | If you get the "<code>unsupported or invalid disk type 7</code>" error while powering on a VM, do the following: | ||
+ | # Locate and run: <code>vmkfstools -i <i><vmware_player_disk_in></i> -d zeroedthick <i><esxi_disk_out></i></code> | ||
+ | |||
+ | == VNC to a Virtual Machine's Console== | ||
+ | Add the following to the <code>.vmx</code> file: | ||
+ | <source lang="text"> | ||
+ | RemoteDisplay.vnc.enabled = TRUE | ||
+ | RemoteDisplay.vnc.port = 27015 | ||
+ | RemoteDisplay.vnc.password = hello123 | ||
+ | </source> | ||
+ | |||
+ | Don't forget to add a firewall rule! | ||
+ | |||
+ | == Custom Firewall Rules == | ||
+ | This example file would be stored at <code>/etc/vmware/firewall/vnc.xml</code>. | ||
+ | <source lang="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> | ||
+ | </source> | ||
+ | |||
+ | You can then reload the Firewall rules by running this command: | ||
+ | <source lang="bash"> | ||
+ | esxcli network firewall refresh | ||
+ | </source> | ||
+ | And list them: | ||
+ | <source lang="bash"> | ||
+ | esxcli network firewall ruleset list | ||
+ | </source> | ||
+ | |||
+ | == 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 <code>/bootbank/custom.do</code> | ||
+ | <source lang="bash"> | ||
+ | #!/bin/sh | ||
+ | |||
+ | tar -czvf /bootbank/custom.tgz /etc/vmware/firewall/vnc.xml | ||
+ | </source> | ||
+ | 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 == | == Use SATA drive as an RDM == | ||
Line 18: | Line 112: | ||
##* <code>lsilogic</code> | ##* <code>lsilogic</code> | ||
##* <code>ide</code> | ##* <code>ide</code> | ||
+ | |||
+ | == Expand a Virtual Disk == | ||
+ | <source lang="bash"> | ||
+ | NEW_SIZE=100Gb | ||
+ | vmware-vdiskmanager -x ${NEW_SIZE} ${VMDK} | ||
+ | </source> |
Latest revision as of 11:29, 17 October 2015
Contents |
[edit] Enable SSH
[edit] Direct - via the keyboard
- At the console, press
F2
and login - Select
Troubleshooting Options
- Select
Enable SSH
- Press
ESC
to logout
[edit] vSphere
-
Configuration
tab -
Security Profile
-
Properties...
forServices
-
SSH
-
Options...
-
Start
-
Start and stop with host
-
OK
[edit] 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
[edit] Hanging on ipmi_si_drv
- Press
Shift + O
and appendnoipmiEnabled
to the boot args - Once booted, connect with vSphere and add uncheck
VMkernel.Boot.impiEnabled
[edit] 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"
[edit] 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:
- Locate and run:
vmkfstools -i <vmware_player_disk_in> -d zeroedthick <esxi_disk_out>
[edit] 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!
[edit] 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
[edit] 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.
[edit] Use SATA drive as an RDM
- Login as root
- Run
fdisk -l
and locate the disk you wish to use - Run
ls /dev/disks/ -l
and locate the symlink to that disk - Goto the correct directory to place the new vmdk
- Run
vmkfstools -r /vmfs/devices/disks/<symlink> RDM.vmdk -a lsilogic
- Disk type
-
-r
- create Virtual device -
-z
- create Physical (passthrough) device - careful with these
-
- Controller
-a ...
-
buslogic
- probrably not -
lsilogic
-
ide
-
- Disk type
[edit] Expand a Virtual Disk
NEW_SIZE=100Gb vmware-vdiskmanager -x ${NEW_SIZE} ${VMDK}