-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathESXI CLI
89 lines (59 loc) · 1.9 KB
/
ESXI CLI
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
Backup/Restore
--------------------
Backup ESXI Config:
vim-cmd hostsvc/firmware/backup_config
Will be saved in "/scratch/downloads".
Use WNSCP to download config or
xxx.xxx.xxx.xxx/scratch/downloads
Restore Backup ESXI Config:
Same Version and Build Number required
Copy backup file to "/tmp/"configBundle.tgz""
Then run the following commands
vim-cmd hostsvc/maintenance_mode_enter
vim-cmd hostsvc/firmware/restore_config /tmp/configBundle.tgz
Find a File recursively:
find /. -name *."Enter Extension"
i.e
find -regex -type f ".*\."txt""
Find a file
find / -iname "search term"
Copy file from source to destination:
cp -r “SourcePath” "DestinationPath”
Set a file to executable:
chmod 777 “filename”
Run a file against a location:
.\”Filename” /“Enter location to run ”
Display Version info:
esxcli system version get
Display Hostname:
esxcli system “hostname or version” get (display hostname or version/build)
System stats i.e Install Date:
esxcli system stats installtime get
Enable/Disable maintenace mode:
esxcli system maintenanceMode set –enable “true/False” (Enter maintenance mode)
List all running processes:
esxcli vm process list (List all running VMs)
Kill a running process:
esxcli vm process kill -w 69237 -t soft (Shutdown a specific VM)
List all datastore:
esxcli storage filesystem list ()list all volumes or Datastores)
Show NIC List:
esxcli network nic list
Show IP interface list:
esxcli network ip interface list
Show network VM list:
esxcli network vswitch standard list
List all VMs:
vim-cmd vmsvc/getallvms (List all VMs)
VM Summary:
vim-cmd vmsvc/get.summary “VMID”
VM power on:
vim-cmd vmsvc/power.on “VMID”
VM power off:
vim-cmd vmsvc/power.off “VMID”
VM reboot:
vim-cmd vmsvc/power.reboot “VMID”
Vm shutdown:
vim-cmd vmsvc/power.shutdown “VMID”
vim-cmd vmsvc/power.suspend “VMID”
vim-cmd solo/registervm ""path and filename".vmx"