github.com/vmware/govmomi@v0.43.0/govc/emacs/README.md (about) 1 # govc.el 2 3 Interface to govc for managing VMware ESXi and vCenter. 4 5 6 The goal of this package is to provide a simple interface for commonly used 7 govc commands within Emacs. This includes table based inventory/state modes 8 for vms, hosts, datastores and pools. The keymap for each mode provides 9 shortcuts for easily feeding the data in view to other govc commands. 10 11 Within the various govc modes, press `?` to see a popup menu of options. 12 A menu bar is enabled for certain modes, such as `govc-vm-mode` and `govc-host-mode`. 13 There is also a `govc` menu at all times under the `Tools` menu. 14 15 The recommended way to install govc.el is via MELPA (http://melpa.org/). 16 17 ## govc-mode 18 19 Running `govc-global-mode` creates key bindings to the various govc modes. 20 The default prefix is `C-c ;` and can be changed by setting `govc-keymap-prefix`. 21 22 ### govc-command-map 23 24 Keybinding | Description 25 ---------------|------------------------------------------------------------ 26 <kbd>h</kbd> | Host info via govc 27 <kbd>p</kbd> | Pool info via govc 28 <kbd>v</kbd> | VM info via govc 29 <kbd>s</kbd> | Datastore info via govc 30 31 ### govc-urls 32 33 List of URLs for use with `govc-session`. 34 The `govc-session-name` displayed by `govc-mode-line` uses `url-target` (anchor) 35 if set, otherwise `url-host` is used. 36 37 Example: 38 ``` 39 (setq govc-urls `("root:vagrant@localhost:18443#Vagrant-ESXi" 40 "root:password@192.168.1.192#Intel-NUC" 41 "Administrator@vsphere.local:password!@vcva-clovervm")) 42 ``` 43 To enter a URL that is not in the list, prefix `universal-argument`, for example: 44 45 `C-u M-x govc-vm` 46 47 To avoid putting your credentials in a variable, you can use the 48 auth-source search integration. 49 50 ``` 51 (setq govc-urls `("myserver-vmware-2")) 52 ``` 53 54 And then put this line in your `auth-sources` (e.g. `~/.authinfo.gpg`): 55 ``` 56 machine myserver-vmware-2 login tzz password mypass url "myserver-vmware-2.some.domain.here:443?insecure=true" 57 ``` 58 59 Which will result in the URL "tzz:mypass@myserver-vmware-2.some.domain.here:443?insecure=true". 60 For more details on `auth-sources`, see Info node `(auth) Help for users`. 61 62 When in `govc-vm` or `govc-host` mode, a default URL is composed with the 63 current session credentials and the IP address of the current vm/host and 64 the vm/host name as the session name. This makes it easier to connect to 65 nested ESX/vCenter VMs or directly to an ESX host. 66 67 ### govc-session-url 68 69 ESX or vCenter URL set by `govc-session` via `govc-urls` selection. 70 71 ### govc-session-insecure 72 73 Skip verification of server certificate when true. 74 This variable is set to the value of the `GOVC_INSECURE` env var by default. 75 It can also be set per-url via the query string (insecure=true). For example: 76 ``` 77 (setq govc-urls `("root:password@hostname?insecure=true")) 78 ``` 79 80 ### govc-session-datacenter 81 82 Datacenter to use for the current `govc-session`. 83 If the endpoint has a single Datacenter it will be used by default, otherwise 84 `govc-session` will prompt for selection. It can also be set per-url via the 85 query string. For example: 86 ``` 87 (setq govc-urls `("root:password@hostname?datacenter=dc1")) 88 ``` 89 90 ### govc-session-datastore 91 92 Datastore to use for the current `govc-session`. 93 If the endpoint has a single Datastore it will be used by default, otherwise 94 `govc-session` will prompt for selection. It can also be set per-url via the 95 query string. For example: 96 ``` 97 (setq govc-urls `("root:password@hostname?datastore=vsanDatastore")) 98 ``` 99 100 ### govc-session-network 101 102 Network to use for the current `govc-session`. 103 104 ## govc-tabulated-list-mode 105 106 Generic table bindings to mark/unmark rows. 107 108 In addition to any hooks its parent mode `tabulated-list-mode` might have run, 109 this mode runs the hook `govc-tabulated-list-mode-hook`, as the final step 110 during initialization. 111 112 ### govc-tabulated-list-mode-map 113 114 Keybinding | Description 115 ---------------|------------------------------------------------------------ 116 <kbd>m</kbd> | Mark and move to the next line 117 <kbd>u</kbd> | Unmark and move to the next line 118 <kbd>t</kbd> | Toggle mark 119 <kbd>U</kbd> | Unmark all 120 <kbd>M-&</kbd> | Shell CMD in BUFFER with current `govc-session` exported as GOVC_ env vars 121 <kbd>M-w</kbd> | Copy current selection or region to the kill ring 122 <kbd>M-E</kbd> | Export session to `process-environment` and `kill-ring` 123 124 ## govc-host-mode 125 126 Major mode for handling a list of govc hosts. 127 128 In addition to any hooks its parent mode `govc-tabulated-list-mode` might have run, 129 this mode runs the hook `govc-host-mode-hook`, as the final step 130 during initialization. 131 132 ### govc-host-mode-map 133 134 Keybinding | Description 135 ---------------|------------------------------------------------------------ 136 <kbd>E</kbd> | Events via govc events -n `govc-max-events` 137 <kbd>L</kbd> | Logs via govc logs -n `govc-max-events` 138 <kbd>J</kbd> | JSON via govc host 139 <kbd>M</kbd> | Metrics info 140 <kbd>N</kbd> | Netstat via `govc-esxcli-netstat-info` with current host id 141 <kbd>O</kbd> | Object browser via govc object 142 <kbd>T</kbd> | Tasks via govc tasks 143 <kbd>c</kbd> | Connect new session for the current govc mode 144 <kbd>p</kbd> | Pool-mode with current session 145 <kbd>s</kbd> | Datastore-mode with current session 146 <kbd>v</kbd> | VM-mode with current session 147 148 ## govc-pool-mode 149 150 Major mode for handling a list of govc pools. 151 152 In addition to any hooks its parent mode `govc-tabulated-list-mode` might have run, 153 this mode runs the hook `govc-pool-mode-hook`, as the final step 154 during initialization. 155 156 ### govc-pool-mode-map 157 158 Keybinding | Description 159 ---------------|------------------------------------------------------------ 160 <kbd>D</kbd> | Destroy via `govc-pool-destroy` on the pool selection 161 <kbd>E</kbd> | Events via govc events -n `govc-max-events` 162 <kbd>J</kbd> | JSON via govc pool 163 <kbd>M</kbd> | Metrics info 164 <kbd>O</kbd> | Object browser via govc object 165 <kbd>T</kbd> | Tasks via govc tasks 166 <kbd>c</kbd> | Connect new session for the current govc mode 167 <kbd>h</kbd> | Host-mode with current session 168 <kbd>s</kbd> | Datastore-mode with current session 169 <kbd>v</kbd> | VM-mode with current session 170 171 ## govc-datastore-mode 172 173 Major mode for govc datastore.info. 174 175 In addition to any hooks its parent mode `tabulated-list-mode` might have run, 176 this mode runs the hook `govc-datastore-mode-hook`, as the final step 177 during initialization. 178 179 ### govc-datastore-mode-map 180 181 Keybinding | Description 182 ---------------|------------------------------------------------------------ 183 <kbd>J</kbd> | JSON via govc datastore 184 <kbd>M</kbd> | Metrics info 185 <kbd>O</kbd> | Object browser via govc object 186 <kbd>RET</kbd> | Browse datastore 187 <kbd>c</kbd> | Connect new session for the current govc mode 188 <kbd>h</kbd> | Host-mode with current session 189 <kbd>p</kbd> | Pool-mode with current session 190 <kbd>v</kbd> | VM-mode with current session 191 192 ## govc-datastore-ls-mode 193 194 Major mode govc datastore.ls. 195 196 In addition to any hooks its parent mode `govc-tabulated-list-mode` might have run, 197 this mode runs the hook `govc-datastore-ls-mode-hook`, as the final step 198 during initialization. 199 200 ### govc-datastore-ls-mode-map 201 202 Keybinding | Description 203 ---------------|------------------------------------------------------------ 204 <kbd>I</kbd> | Info datastore disk 205 <kbd>J</kbd> | JSON via govc datastore 206 <kbd>S</kbd> | Search via govc datastore 207 <kbd>D</kbd> | Delete selected datastore paths 208 <kbd>T</kbd> | Tail datastore FILE 209 <kbd>+</kbd> | Mkdir via govc datastore 210 <kbd>DEL</kbd> | Up to parent folder 211 <kbd>RET</kbd> | Open datastore folder or file 212 213 ## govc-vm-mode 214 215 Major mode for handling a list of govc vms. 216 217 In addition to any hooks its parent mode `govc-tabulated-list-mode` might have run, 218 this mode runs the hook `govc-vm-mode-hook`, as the final step 219 during initialization. 220 221 ### govc-vm-mode-map 222 223 Keybinding | Description 224 ---------------|------------------------------------------------------------ 225 <kbd>E</kbd> | Events via govc events -n `govc-max-events` 226 <kbd>L</kbd> | Logs via `govc-datastore-tail` with logDirectory of current selection 227 <kbd>J</kbd> | JSON via govc vm 228 <kbd>O</kbd> | Object browser via govc object 229 <kbd>T</kbd> | Tasks via govc tasks 230 <kbd>X</kbd> | ExtraConfig via `govc-vm-extra-config` on the current selection 231 <kbd>RET</kbd> | Devices via `govc-device` on the current selection 232 <kbd>C</kbd> | Console via `govc-vm-console` on the current selection 233 <kbd>V</kbd> | VNC via `govc-vm-vnc` on the current selection 234 <kbd>D</kbd> | Destroy via `govc-vm-destroy` on the current selection 235 <kbd>^</kbd> | Start via `govc-vm-start` on the current selection 236 <kbd>!</kbd> | Shutdown via `govc-vm-shutdown` on the current selection 237 <kbd>@</kbd> | Reboot via `govc-vm-reboot` on the current selection 238 <kbd>&</kbd> | Suspend via `govc-vm-suspend` on the current selection 239 <kbd>H</kbd> | Host info via `govc-host` with host(s) of current selection 240 <kbd>M</kbd> | Metrics info 241 <kbd>P</kbd> | Ping VM 242 <kbd>S</kbd> | Datastore via `govc-datastore-ls` with datastore of current selection 243 <kbd>c</kbd> | Connect new session for the current govc mode 244 <kbd>h</kbd> | Host-mode with current session 245 <kbd>p</kbd> | Pool-mode with current session 246 <kbd>s</kbd> | Datastore-mode with current session 247 248 ## govc-device-mode 249 250 Major mode for handling a govc device. 251 252 In addition to any hooks its parent mode `govc-tabulated-list-mode` might have run, 253 this mode runs the hook `govc-device-mode-hook`, as the final step 254 during initialization. 255 256 ### govc-device-mode-map 257 258 Keybinding | Description 259 ---------------|------------------------------------------------------------ 260 <kbd>J</kbd> | JSON via govc device 261 <kbd>RET</kbd> | Tabulated govc device 262 263 ## govc-object-mode 264 265 Major mode for handling a govc object. 266 267 In addition to any hooks its parent mode `govc-tabulated-list-mode` might have run, 268 this mode runs the hook `govc-object-mode-hook`, as the final step 269 during initialization. 270 271 ### govc-object-mode-map 272 273 Keybinding | Description 274 ---------------|------------------------------------------------------------ 275 <kbd>J</kbd> | JSON object selection via govc object 276 <kbd>N</kbd> | Next managed object reference 277 <kbd>O</kbd> | Object browser via govc object 278 <kbd>DEL</kbd> | Parent object selection if reachable, otherwise prompt with `govc-object-history` 279 <kbd>RET</kbd> | Expand object selection via govc object 280 281 ## govc-metric-mode 282 283 Major mode for handling a govc metric. 284 285 In addition to any hooks its parent mode `govc-tabulated-list-mode` might have run, 286 this mode runs the hook `govc-metric-mode-hook`, as the final step 287 during initialization. 288 289 ### govc-metric-mode-map 290 291 Keybinding | Description 292 ---------------|------------------------------------------------------------ 293 <kbd>RET</kbd> | Sample metrics 294 <kbd>P</kbd> | Plot metric sample 295 <kbd>s</kbd> | Select metric names