{"id":706,"date":"2013-06-25T18:46:22","date_gmt":"2013-06-25T16:46:22","guid":{"rendered":"http:\/\/michlstechblog.info\/blog\/?p=706"},"modified":"2014-06-12T13:28:00","modified_gmt":"2014-06-12T11:28:00","slug":"vmware-esxi-some-host-commands","status":"publish","type":"post","link":"https:\/\/michlstechblog.info\/blog\/vmware-esxi-some-host-commands\/","title":{"rendered":"VMware ESXi: A (incomplete) list of host commands Part 1"},"content":{"rendered":"<div class=\"twoclick_social_bookmarks_post_706 social_share_privacy clearfix 1.6.4 locale-en_US sprite-en_US\"><\/div><div class=\"twoclick-js\"><script type=\"text\/javascript\">\/* <![CDATA[ *\/\njQuery(document).ready(function($){if($('.twoclick_social_bookmarks_post_706')){$('.twoclick_social_bookmarks_post_706').socialSharePrivacy({\"services\":{\"flattr\":{\"uid\":\"Michl\",\"status\":\"on\",\"the_title\":\"VMware%20ESXi%3A%20A%20%28incomplete%29%20list%20of%20host%20commands%20Part%201\",\"the_excerpt\":\"Hi%2C%0D%0A%0D%0Ahere%20is%20a%20list%20of%20some%20cli%27s%C2%A0%20to%20control%20a%20VMware%20ESXi%20host%20from%20the%20command%20line.%20Enable%20the%20ESXi%20shell%20and%20login%20to%20console%20or%20connect%20with%20a%20ssh%20client%20remotely.%0D%0AManagement%0D%0ARestart%20Management%2C%20HA%20Services%0D%0A%2Fsbin%2Fservices%20restart%0D%0A%0D%0AInstalling%20Software.%20List%2FInstall%2FUninstall%C2%A0%20VIBs%20%28vSphere%20Installation%20bundle%29%0D%0A%0D%0AList%20vibs%0D%0A%0D%0Aesxcli%20software%20vib%20list%0D%0A%0D%0AInstall%20a%20vib%0D%0A%0D%0Aesxcli%20soft%20...\",\"txt_info\":\"2 clicks for more data protection:\\r\\n\\r\\nOnly when you click here, the button will be come active and you can send your recommendation to Flattr. When activating, data are transmitted to third parties. \",\"perma_option\":\"off\"}},\"txt_help\":\"When you activate these fields by clicking, information to Flattr may be transferred abroad, and probably may also stored there.\",\"settings_perma\":\"Enable permanently and accept data transmission. \",\"info_link\":\"http:\\\/\\\/www.heise.de\\\/ct\\\/artikel\\\/2-Klicks-fuer-mehr-Datenschutz-1333879.html\",\"uri\":\"https:\\\/\\\/michlstechblog.info\\\/blog\\\/vmware-esxi-some-host-commands\\\/\",\"post_id\":706,\"post_title_referrer_track\":\"VMware+ESXi%3A+A+%28incomplete%29+list+of+host+commands+Part+1\",\"display_infobox\":\"on\"});}});\n\/* ]]> *\/<\/script><\/div><p>Hi,<\/p>\n<p>here is a list of some cli&#8217;s\u00a0 to control a VMware ESXi host from the command line. Enable the ESXi shell and login to console or connect with a ssh client remotely.<br \/>\n<strong>Management<\/strong><br \/>\nRestart Management, HA Services<br \/>\n<code>\/sbin\/services restart<\/code><\/p>\n<p><strong>Installing Software. List\/Install\/Uninstall\u00a0 VIBs (vSphere Installation bundle)<\/strong><\/p>\n<p>List vibs<\/p>\n<p><code>esxcli software vib list<\/code><\/p>\n<p>Install a vib<\/p>\n<p><code>esxcli software vib install -v file:\/tmp\/[NewVIB].vib<\/code><\/p>\n<p>Uninstall a vib (determine the Name of the VIB by the list command)<\/p>\n<p><code>esxcli software vib remove -n VIBname<\/code><\/p>\n<p>Install a patch<\/p>\n<p><code>esxcli software vib install \/tmp\/[patchName].zip<\/code><\/p>\n<p><strong>Network<\/strong><\/p>\n<p>firewall state<\/p>\n<p><code>esxcli network firewall get<\/code><\/p>\n<p>Firewall rules<br \/>\n<!--more--><br \/>\n<code>esxcli network firewall ruleset list<\/code><\/p>\n<p>Firewall activate a Ruleset, i.e. sshClient<\/p>\n<p><code>esxcli network firewall ruleset set --ruleset-id=sshClient --enabled=true<\/code><\/p>\n<p>Only allow an IP Range for the ssh daemon<\/p>\n<p><code>esxcli network firewall ruleset allowedip add --ruleset-id sshServer --ip-address 192.168.254.0\/24<\/code><\/p>\n<p>List Kernel Network Interfaces<\/p>\n<p><code>esxcli network ip interface list<\/code><\/p>\n<p>List physical Network Interfaces<br \/>\n<code>esxcli network nic list<\/code><\/p>\n<p>Shutdown physical network interface<br \/>\n<code>esxcli network nic down -n vmnic4<\/code><\/p>\n<p>List routing table<\/p>\n<p><code>esxcli network ip route ipv4 list<\/code><\/p>\n<p>Add a route<\/p>\n<p><code>esxcli network ip route ipv4 add --gateway 10.1.1.254 --network 10.1.2.0\/24<\/code><\/p>\n<p>To make the route persistent add the command line to a ESXi startup script. In ESXi 5.1<\/p>\n<p><code>\/etc\/rc.local.d\/local.sh<\/code><\/p>\n<p>in ESXi &lt;=5.0<\/p>\n<p><code>\/etc\/rc.local<\/code><\/p>\n<p>List arp cache<br \/>\n<code>esxcli network ip neighbor list<\/code><\/p>\n<p>Remove arp cache entry<br \/>\n<code> esxcli network ip neighbor remove -a 10.192.10.3 -v 4<\/code><\/p>\n<p>SNMP<\/p>\n<p>Set Community (Communityname: MGMCOM)<\/p>\n<p><code>esxcli system snmp set --communities MGMCOM<\/code><\/p>\n<p>Set Trap destintion (IP Address Management station: 192.168.254.100)<\/p>\n<p><code>esxcli system snmp set --targets 192.168.254.100\/MGMCOM<\/code><\/p>\n<p>Send test trap<\/p>\n<p><code>esxcli system snmp test<\/code><\/p>\n<p>State<\/p>\n<p><code>esxcli system snmp get<\/code><\/p>\n<p>enable IPMI as SNMP source<\/p>\n<p><code>esxcli system snmp set --hwsrc sensors<\/code><\/p>\n<p>enable CIM as SNMP source<\/p>\n<p><code>esxcli system snmp set --hwsrc indications<\/code><\/p>\n<p>Enable snmp<\/p>\n<p><code>esxcli system snmp set --enable true<\/code><\/p>\n<p><strong>Virtual disks<\/strong><\/p>\n<p>extend a virtual disk, i.e. to 40GB<\/p>\n<p><code>vmkfstools -X 40G \/vmfs\/volumes\/datastore1\/Test\/test.vmdk<\/code><\/p>\n<p>Convert a Workstation based virtual Disk to a VMFS Disk for use at ESXi. Disk to convert: Computer.vmdk<br \/>\nRename Disk Computer.vmdk to Computer_WS.vmdk<br \/>\n<code>mv Computer.vmdk Computer_WS.vmdk<\/code><br \/>\nClone the disk<br \/>\n<code>vmkfstools -i Computer_WS.vmdk -d zeroedthick Computer.vmdk<br \/>\nDestination disk format: VMFS thin-provisioned<br \/>\nCloning disk 'Computer.vmdk'...<br \/>\nClone: 100% done.<\/code><\/p>\n<p>Remove Workstation disk<\/p>\n<p><code>rm Computer_WS.vmdk<code><\/code><\/code><\/p>\n<p>Note: if you have manually copied the virtual machine from a Workstation to the ESXi, remove the\u00a0 Computer.vmx.lck folder. Otherwise the virtual machine could not be altered. The prefered way to bring your workstation based virtual machine to an ESXi host is to you the vmware converter or use the VMware Workstation Upload function.<\/p>\n<p>To be continued&#8230;.in <a title=\"VMware ESXi: A (incomplete) list of host commands Part 2\" href=\"http:\/\/michlstechblog.info\/blog\/vmware-esxi-a-incomplete-list-of-host-commands-part-2\/\">Part 2<\/a><\/p>\n<p>Michael<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hi, here is a list of some cli&#8217;s\u00a0 to control a VMware ESXi host from the command line. Enable the ESXi shell and login to console or connect with a ssh client remotely. Management Restart Management, HA Services \/sbin\/services restart Installing Software. List\/Install\/Uninstall\u00a0 VIBs (vSphere Installation bundle) List vibs esxcli software vib list Install a &hellip; <a href=\"https:\/\/michlstechblog.info\/blog\/vmware-esxi-some-host-commands\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">VMware ESXi: A (incomplete) list of host commands Part 1<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[195,188,196,199,16,200,202,201,204,203,325,198,324,197,194,14],"class_list":["post-706","post","type-post","status-publish","format-standard","hentry","category-vmware","tag-cli","tag-command","tag-console","tag-disk","tag-esx","tag-extend","tag-firewall","tag-grow","tag-off","tag-on","tag-persistent","tag-power","tag-route","tag-snapshot","tag-ssh","tag-vmware-2"],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/posts\/706","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/comments?post=706"}],"version-history":[{"count":35,"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/posts\/706\/revisions"}],"predecessor-version":[{"id":2053,"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/posts\/706\/revisions\/2053"}],"wp:attachment":[{"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/media?parent=706"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/categories?post=706"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/tags?post=706"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}