VMware ESXi: Difference between revisions

From Dave-Wiki
No edit summary
No edit summary
Line 38: Line 38:


  ovftool -ds=<dest-datastore> -dm=thin -n=<dest-vm-name> --net:"<src-network>"="<dest-network>" vi://<src-esxi-ip>/<src-vm-name> vi://<dest-esxi-ip>
  ovftool -ds=<dest-datastore> -dm=thin -n=<dest-vm-name> --net:"<src-network>"="<dest-network>" vi://<src-esxi-ip>/<src-vm-name> vi://<dest-esxi-ip>
==Active Directory==
===Unjoin a Domain===
/opt/likewise/bin/domainjoin-cli query
sso-config.sh -get_identity_sources
sso-config.sh -delete_identity_source -i lambnet.us
==SNMP==
===Enable SNMP on an ESXi Host===
esxcli system snmp get
esxcli system snmp set --communities public,eastnoc,westnoc
esxcli system snmp set --enable true
==SSL==
===ESXi Host===
SSH into the ESXi Host.
In the directory <code>/etc/vmware/ssl</code>, back up the <code>rui.crt</code> and <code>rui.key</code> files.
Replace the contents of <code>rui.crt</code> with your new certificate and <code>rui.key</code> with your new private key.
Restart the management server by executing these two commands:
/etc/init.d/hostd restart
/etc/init.d/vpxa restart
===vCenter Server===
SCP your .crt, .key, and ca.crt files to the VCSA server.
SSH into the VCSA shell.
Execute <code>/usr/lib/vmware-vmca/bin/certificate-manager</code>
Choose <code>1. Replace Machine SSL certificate with Custom Certificate</code>
Provide valid SSO and VC privileged user credential, as requested.
Choose <code>2. Import custom certificate(s) and key(s) to replace existing Machine SSL certificate</code>
Follow the on-screen instructions to provide paths to the files you uploaded:
    Please provide valid custom certificate for Machine SSL.
    File : /root/vm.crt
    Please provide valid custom key for Machine SSL.
    File : /root/vm.key
    Please provide the signing certificate of the Machine SSL certificate
    File : /root/lambnet-ca-ec.crt
Services will restart (this will take a few minutes).

Revision as of 19:57, 21 January 2025

Summary

ESXi (Elastic Sky X Integrated) is a hypervisor developed by VMware that is used to create and manage virtual machines (VMs) in a virtualized environment. It is part of VMware's vSphere suite of products and is a foundational component for running virtualized workloads in both small and large-scale enterprise data centers.

General

VMDK Commands

Shrink a Thin VMDK

ls –lh *.vmdk
du -h *.vmdk
vmkfstools --punchzero vm.vmdk
du -h *.vmdk

ovftool

You can install this tool on your local machine (e.g., Windows) and use it to remotely move powered-down VMs from one ESXi to another or to your local machine as an .ovf file, etc.

Get Info About A VM

.\ovftool vi://10.144.30.134/plex

Export VM from ESXi to a Local Windows PC

.\ovftool.exe vi://<src-esxi-ip>/<src-vm-name> "C:\Downloads\<ovffile>.ovf"

Import VM from a Local Windows PC to ESXi

.\ovftool.exe -ds=<dest-datastore> -dm=thin -n=<dest-vm-name> --net:"<src-network1>"="<dest-network1>" --net:"<src-network2>"="<dest-network2>" "C:\Downloads\<ovffile>.ovf" vi://<dest-esxi-ip>

Export Directly From ESXi to ESXi

ovftool -ds=<dest-datastore> -dm=thin -n=<dest-vm-name> --net:"<src-network>"="<dest-network>" vi://<src-esxi-ip>/<src-vm-name> vi://<dest-esxi-ip>

Active Directory

Unjoin a Domain

/opt/likewise/bin/domainjoin-cli query
sso-config.sh -get_identity_sources
sso-config.sh -delete_identity_source -i lambnet.us

SNMP

Enable SNMP on an ESXi Host

esxcli system snmp get
esxcli system snmp set --communities public,eastnoc,westnoc
esxcli system snmp set --enable true

SSL

ESXi Host

SSH into the ESXi Host.

In the directory /etc/vmware/ssl, back up the rui.crt and rui.key files.

Replace the contents of rui.crt with your new certificate and rui.key with your new private key.

Restart the management server by executing these two commands:

/etc/init.d/hostd restart
/etc/init.d/vpxa restart

vCenter Server

SCP your .crt, .key, and ca.crt files to the VCSA server.

SSH into the VCSA shell.

Execute /usr/lib/vmware-vmca/bin/certificate-manager

Choose 1. Replace Machine SSL certificate with Custom Certificate

Provide valid SSO and VC privileged user credential, as requested.

Choose 2. Import custom certificate(s) and key(s) to replace existing Machine SSL certificate

Follow the on-screen instructions to provide paths to the files you uploaded:

   Please provide valid custom certificate for Machine SSL.
   File : /root/vm.crt
   Please provide valid custom key for Machine SSL.
   File : /root/vm.key
   Please provide the signing certificate of the Machine SSL certificate
   File : /root/lambnet-ca-ec.crt

Services will restart (this will take a few minutes).