===== VMware ===== [[http://tmade.de|Home tmade.de]] [[http://wiki.tmade.de|Home Wiki]] ==== Version ==== https://www.virten.net/vmware/vcenter-release-and-build-number-history/ https://packages.vmware.com/tools/versions ====VMware Tools==== vmware-toolbox-cmd -v #check installed version /usr/bin/vmware-uninstall-tools.pl #uninstall ./vmware-install.pl -d #install with default values ==== Links ==== http://www.vmware.com/support/pubs/vi_pubs.html http://www.vmware.com/support/vi3/doc/vi3_vum_10_sizing_estimator.xls P2V: http://www.youtube.com/watch?v=VepgExB_39E ==== Ports (vCenter) ==== http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=1012382 ==== AD Join (>= 6.5) ==== https://vcenter.local:5480 https://docs.vmware.com/en/VMware-vSphere/6.7/com.vmware.vsphere.vcsa.doc/GUID-08EA2F92-78A7-4EFF-880E-2B63ACC962F3.html https://www.hex64.net/enabling-active-directory-authentication-in-vcenter-6-5/ ==== 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/vsphere-client https://vcenter-server.local/vsphere-client/?locale=en_US&csp Appliance: https://vcenter-server.local:5480 ==== 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)! Last solution (this works always even on older linux-derivates): 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 Power-on the virtual machine with the command: vim-cmd vmsvc/power.on 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 esxcli software vib list | egrep ixgbe #Show "vSphere Installation Bundle" (vib) esxcli system module list |grep ixgbe #Show "is loaded" and "is active" esxcli software vib get -n ixgben #Detailed view esxcli system module set --enabled=false --module=ixgben #Deactivate NIC-module "ixgben". Reboot is required! ==== NFS ==== ESXi 5.x: esxcli storage nfs add -H HOST-IP-OR-FQDN -s NFS-Share-Name -v DataStoreName esxcli storage nfs remove -v NFS_Datastore_Name esxcfg-nas -l esxcli storage nfs list ==== 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 ==== UUID ==== === <= ESXi 6.0 === Get/ change UUID (e. g. if a disk has been restored from backup): vmkfstools -J getuuid /vmfs/volumes/datastore/VM/vm.vmdk vmkfstools -J setuuid /vmfs/volumes/datastore/VM/vm.vmdk === >= ESXi 6.5 === UUID doesn´t need to be changed! ==== 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 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 vCenter Appliance ==== https://kb.vmware.com/s/article/2054085?other.KM_Utility.getArticleLanguage=1&r=1&other.KM_Utility.getArticleData=1&other.KM_Utility.getArticle=1&ui-comm-runtime-components-aura-components-siteforce-qb.Quarterback.validateRoute=1&other.KM_Utility.getGUser=1 Overview Services: ^ Service Description ^ Service Name ^ | VMware VirtualCenter Server Service | vmware-vpxd | | Embedded vPostgres Database service | vmware-vpostgres | | VMware Tools Service | vmware-tools-services | | VMware vSphere Profile-Driven Storage Service | vmware-sps | | VMware vCenter Inventory Service | vmware-inventoryservice | | VMware vSphere Network Dump Collector service | vmware-netdumper | | VMware vSphere Log Browser | vmware-logbrowser | | VMware vSphere Auto Deploy service | vmware-rbd-watchdog | | VMware vSphere Web Client | vsphere-client | | [For vSphere 5.1 Only] vCenter Single Sign-On 5.1 | vmware-sso | | [For vSphere 5.5 Only] vCenter Single Sign-On 5.5 - VMware Directory Service | vmdird | | [For vSphere 5.5 Only] vCenter Single Sign-On 5.5 - VMware Certificate Service| vmcad | | [For vSphere 5.5 Only] vCenter Single Sign-On 5.5 - VMware Secure Token Service | vmware-stsd | | [For vSphere 5.5 Only] vCenter Single Sign-On 5.5 - VMware Kdc Service | vmkdcd | | [For vSphere 5.5 Only] vCenter Single Sign-On 5.5 - VMware Identity Management Service | vmware-sts-idmd | ==== MISC ==== Check Version vs. Buildnumber: https://kb.vmware.com/s/article/2143832?other.KM_Utility.getArticleLanguage=1&r=1&other.KM_Utility.getArticleData=1&other.KM_Utility.getArticle=1&ui-comm-runtime-components-aura-components-siteforce-qb.Quarterback.validateRoute=1&other.KM_Utility.getGUser=1 CPU-Info: vim-cmd hostsvc/hostsummary | grep cpuModel ==== RVTools ==== Collecting data from vCenter and export to xml-files for documentation of the cluster. Check: https://www.robware.net/rvtools/