VMware

Ports (vCenter)

vSphere Client

To start the client with US language please add the following to your windows shortcut:

"-locale en_US"          #Start with US language (add to shortcut properties without ")

To preset the user information (to avoid putting it in each time) please add the following to your windows shortcut:

"-u domain\username"

Web Client

Browser-URL:

https://vcenter-server.local:9443/vsphere-client/#

LUN

A „LUN“ (or virtual Disk) can be recognised in a VMware Virtual Maschine (Linux) with the following command:

echo "- - -" > /sys/class/scsi_host/host1/scan
echo "- - -" > /sys/class/scsi_host/host0/scan

“host1” represents the controller ID.

Another solution:

rescan-scsi-bus

Note: The package “scsitools” is required (apt-get install scsitools)!

To expand a Disk:

echo 1 > /sys/class/scsi_device/0:0:1:0/device/rescan 
echo 1 > /sys/class/scsi_disk/0:0:2:0/device/rescan
echo 1 > /sys/class/scsi_disk/1\:0\:2\:0/device/rescan

iSCSI

The VM Kernel Port has to be mapped to the iSCSI HBA:

esxcli --server 10.6.11.11 swiscsi  nic list -d vmhba38                    #List the Konfiguration
esxcli --server 10.6.11.11 swiscsi  nic add -n vmk0 -d vmhba38             #Set HBA
esxcli swiscsi nic remove esxcli -n vmkX -d vmhba3X

Console Commands ESX

To restart all management agents on the host, run the command:

services.sh restart

List VM´s

vim-cmd vmsvc/getallvms

Show details/ WorldNumber:

esxcli vm process list

Check the power state of the virtual machine with the command:

vim-cmd vmsvc/power.getstate <vmid>

Power-on the virtual machine with the command:

vim-cmd vmsvc/power.on <vmid> 

Kill VM:

esxcli vm process kill -t [soft,hard,force] -w WorldNumber

Example:

esxcli vm process kill --type=soft --world-id=35041

ESXi 4/ 4.1:

List VM´s:

vmware-cmd -l

Start/ Stop/ Restart/ Suspend/ State of VM´s:

vmware-cmd /nas/vms/FreeBSD/FreeBSD.vmx start

To stop VM/VPS, enter:

vmware-cmd /nas/vms/FreeBSD/FreeBSD.vmx stop

To reset VM/VPS, enter:

vmware-cmd /nas/vms/FreeBSD/FreeBSD.vmx reset

To suspend VM/VPS, enter:

vmware-cmd /nas/vms/FreeBSD/FreeBSD.vmx suspend

Find out if OpenBSD VM is on or off:

vmware-cmd /disk2.vmware/vms/OpenBSD/OpenBSD.vmx getstate

Console Commands ESXi

vim-cmd vmsvc/getallvms                          #Overview vm´s

Troubleshooting

/var/log # less vobd.log                          #network
/var/log # less vmkernel.log | grep -i doubt
/var/log # less vmkernel.log | grep -i dead
/var/log # less vmkernel.log | grep -i want
/var/log # less vmkwarning.log

Network

To view the status of your vmnics, you can use the

esxcfg-nics -l
esxcli network nic list

To get networkdevice driver information:

ethtool -i vmnicX
ethtool -i vmnic11

Note: Please run previously “esxcfg-nics -l” to get a summary of networkdevices or have a look on vSphere-Client → Configuration → Networking

Timeserver

When using an SSH shell or local console session on ESXi 5.5 and 5.1:

watch ntpq -p localhost_or_127.0.0.1

When using a Linux client for ESXi/ESX 4.x:

watch "ntpq -p ESX_host_IP_or_domain_name"

Firewall

esxcfg-firewall  -s                            #Show all services
esxcfg-firewall --enableService sshClient      #Enable sshClient

Virtual Disk

Copy a virtual disk (*.vmdk)

vmkfstools -i source.vmdk destination.vmdk 

Create a new virtual disk with cmdline:

vmkfstools -d thick -a lsilogic -c 30G disc.vmdk                                      #ESX3, ESX3,5
vmkfstools -d eagerzeroedthick -a lsilogic -c 30G disc.vmdk                           #ESX4, 5, ESXi 4,5

Convert a VMWare Server disk to ESX as follows:

vmkfstools -i ATIX_SLES10_SP3-s001.vmdk -d eagerzeroedthick ATIX_SLES10_SP3_thick.vmdk                   #Convert an existing VMWare Server disk into "thick" format esx4 disk
vmkfstools -i Win2ksource.vmdk Win2Knew.vmdk                                                             #Convert an existing VMWare Server disk into a esx4 disk

ESXi

Manage the ESXi Server via the vMA (vSphere Management Assistant):

1. Access the vMA with the “vi-admin” user (e.g. SSH)

2. Add a server as follows:

sudo vifp addserver <servername>

3. Switch to the ESXi with the following command:

vifptarget -s x.x.x.x

Create a virtual shared disk:

vmkfstools -d eagerzeroedthick -a lsilogic -c 500G /vmfs/volumes/storage_name/disk.vmdk

More vMA commands:

resxtop -server IP               #"top". Enter "n" to show NICS and related VM´s

List all VM´s on console:

vim-cmd vmsvc/getallvms

This should allow root user to access VMware ESX box remotely using SSH.

VMWare Server (2.0.1)

To share a virtual disk you have to edit the “*.vmx” config-file as follows:

Add at the end of the file add:

disk.locking = "false"

Additionally you have to change

scsi0.sharedBus = "none"

to

scsi0.sharedBus = "virtual"

The ID number behind scsi (“0” in the example) represents the SCSI Controller ID!

To enter Bios add

bios.forceSetupOnce = "TRUE"

to the *.vmx config file and you are entering once the Bios

Useful Commands

esxcli swiscsi  nic remove -n vmk2 -d vmhba38 
esxcli swiscsi  nic list -d vmhba38

VMware tools

vmware-uninstall-tools.pl
vmware/vmware.txt · Last modified: 2018/01/12 11:35 by tmade
 
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Noncommercial-Share Alike 4.0 International
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki