github.com/vmware/govmomi@v0.37.1/govc/USAGE.md (about) 1 # govc usage 2 3 This document is generated from `govc -h` and `govc $cmd -h` commands. 4 5 The following common options are filtered out in this document, 6 but appear via `govc $cmd -h`: 7 8 ``` 9 -h Show this message 10 -cert= Certificate [GOVC_CERTIFICATE] 11 -debug=false Store debug logs [GOVC_DEBUG] 12 -trace=false Write SOAP/REST traffic to stderr 13 -verbose=false Write request/response data to stderr 14 -dump=false Enable output dump 15 -json=false Enable JSON output 16 -xml=false Enable XML output 17 -k=false Skip verification of server certificate [GOVC_INSECURE] 18 -key= Private key [GOVC_PRIVATE_KEY] 19 -persist-session=true Persist session to disk [GOVC_PERSIST_SESSION] 20 -tls-ca-certs= TLS CA certificates file [GOVC_TLS_CA_CERTS] 21 -tls-known-hosts= TLS known hosts file [GOVC_TLS_KNOWN_HOSTS] 22 -u= ESX or vCenter URL [GOVC_URL] 23 -vim-namespace=urn:vim25 Vim namespace [GOVC_VIM_NAMESPACE] 24 -vim-version=6.0 Vim version [GOVC_VIM_VERSION] 25 -dc= Datacenter [GOVC_DATACENTER] 26 -host.dns= Find host by FQDN 27 -host.ip= Find host by IP address 28 -host.ipath= Find host by inventory path 29 -host.uuid= Find host by UUID 30 -vm.dns= Find VM by FQDN 31 -vm.ip= Find VM by IP address 32 -vm.ipath= Find VM by inventory path 33 -vm.path= Find VM by path to .vmx file 34 -vm.uuid= Find VM by UUID 35 ``` 36 37 <details><summary>Contents</summary> 38 39 - [about](#about) 40 - [about.cert](#aboutcert) 41 - [cluster.add](#clusteradd) 42 - [cluster.change](#clusterchange) 43 - [cluster.create](#clustercreate) 44 - [cluster.draft.baseimage.info](#clusterdraftbaseimageinfo) 45 - [cluster.draft.baseimage.set](#clusterdraftbaseimageset) 46 - [cluster.draft.commit](#clusterdraftcommit) 47 - [cluster.draft.component.add](#clusterdraftcomponentadd) 48 - [cluster.draft.component.info](#clusterdraftcomponentinfo) 49 - [cluster.draft.component.ls](#clusterdraftcomponentls) 50 - [cluster.draft.component.rm](#clusterdraftcomponentrm) 51 - [cluster.draft.create](#clusterdraftcreate) 52 - [cluster.draft.info](#clusterdraftinfo) 53 - [cluster.draft.ls](#clusterdraftls) 54 - [cluster.draft.rm](#clusterdraftrm) 55 - [cluster.group.change](#clustergroupchange) 56 - [cluster.group.create](#clustergroupcreate) 57 - [cluster.group.ls](#clustergroupls) 58 - [cluster.group.remove](#clustergroupremove) 59 - [cluster.module.create](#clustermodulecreate) 60 - [cluster.module.ls](#clustermodulels) 61 - [cluster.module.rm](#clustermodulerm) 62 - [cluster.module.vm.add](#clustermodulevmadd) 63 - [cluster.module.vm.rm](#clustermodulevmrm) 64 - [cluster.mv](#clustermv) 65 - [cluster.override.change](#clusteroverridechange) 66 - [cluster.override.info](#clusteroverrideinfo) 67 - [cluster.override.remove](#clusteroverrideremove) 68 - [cluster.rule.change](#clusterrulechange) 69 - [cluster.rule.create](#clusterrulecreate) 70 - [cluster.rule.info](#clusterruleinfo) 71 - [cluster.rule.ls](#clusterrulels) 72 - [cluster.rule.remove](#clusterruleremove) 73 - [cluster.stretch](#clusterstretch) 74 - [cluster.usage](#clusterusage) 75 - [cluster.vlcm.enable](#clustervlcmenable) 76 - [cluster.vlcm.info](#clustervlcminfo) 77 - [datacenter.create](#datacentercreate) 78 - [datacenter.info](#datacenterinfo) 79 - [datastore.cluster.change](#datastoreclusterchange) 80 - [datastore.cluster.info](#datastoreclusterinfo) 81 - [datastore.cp](#datastorecp) 82 - [datastore.create](#datastorecreate) 83 - [datastore.disk.create](#datastorediskcreate) 84 - [datastore.disk.inflate](#datastorediskinflate) 85 - [datastore.disk.info](#datastorediskinfo) 86 - [datastore.disk.shrink](#datastorediskshrink) 87 - [datastore.download](#datastoredownload) 88 - [datastore.info](#datastoreinfo) 89 - [datastore.ls](#datastorels) 90 - [datastore.maintenance.enter](#datastoremaintenanceenter) 91 - [datastore.maintenance.exit](#datastoremaintenanceexit) 92 - [datastore.mkdir](#datastoremkdir) 93 - [datastore.mv](#datastoremv) 94 - [datastore.remove](#datastoreremove) 95 - [datastore.rm](#datastorerm) 96 - [datastore.tail](#datastoretail) 97 - [datastore.upload](#datastoreupload) 98 - [datastore.vsan.dom.ls](#datastorevsandomls) 99 - [datastore.vsan.dom.rm](#datastorevsandomrm) 100 - [device.boot](#deviceboot) 101 - [device.cdrom.add](#devicecdromadd) 102 - [device.cdrom.eject](#devicecdromeject) 103 - [device.cdrom.insert](#devicecdrominsert) 104 - [device.clock.add](#deviceclockadd) 105 - [device.connect](#deviceconnect) 106 - [device.disconnect](#devicedisconnect) 107 - [device.floppy.add](#devicefloppyadd) 108 - [device.floppy.eject](#devicefloppyeject) 109 - [device.floppy.insert](#devicefloppyinsert) 110 - [device.info](#deviceinfo) 111 - [device.ls](#devicels) 112 - [device.model.tree](#devicemodeltree) 113 - [device.pci.add](#devicepciadd) 114 - [device.pci.ls](#devicepcils) 115 - [device.pci.remove](#devicepciremove) 116 - [device.remove](#deviceremove) 117 - [device.scsi.add](#devicescsiadd) 118 - [device.serial.add](#deviceserialadd) 119 - [device.serial.connect](#deviceserialconnect) 120 - [device.serial.disconnect](#deviceserialdisconnect) 121 - [device.usb.add](#deviceusbadd) 122 - [disk.create](#diskcreate) 123 - [disk.ls](#diskls) 124 - [disk.register](#diskregister) 125 - [disk.rm](#diskrm) 126 - [disk.snapshot.create](#disksnapshotcreate) 127 - [disk.snapshot.ls](#disksnapshotls) 128 - [disk.snapshot.rm](#disksnapshotrm) 129 - [disk.tags.attach](#disktagsattach) 130 - [disk.tags.detach](#disktagsdetach) 131 - [dvs.add](#dvsadd) 132 - [dvs.change](#dvschange) 133 - [dvs.create](#dvscreate) 134 - [dvs.portgroup.add](#dvsportgroupadd) 135 - [dvs.portgroup.change](#dvsportgroupchange) 136 - [dvs.portgroup.info](#dvsportgroupinfo) 137 - [env](#env) 138 - [events](#events) 139 - [export.ovf](#exportovf) 140 - [extension.info](#extensioninfo) 141 - [extension.register](#extensionregister) 142 - [extension.setcert](#extensionsetcert) 143 - [extension.unregister](#extensionunregister) 144 - [fields.add](#fieldsadd) 145 - [fields.info](#fieldsinfo) 146 - [fields.ls](#fieldsls) 147 - [fields.rename](#fieldsrename) 148 - [fields.rm](#fieldsrm) 149 - [fields.set](#fieldsset) 150 - [find](#find) 151 - [firewall.ruleset.find](#firewallrulesetfind) 152 - [folder.create](#foldercreate) 153 - [folder.info](#folderinfo) 154 - [guest.chmod](#guestchmod) 155 - [guest.chown](#guestchown) 156 - [guest.df](#guestdf) 157 - [guest.download](#guestdownload) 158 - [guest.getenv](#guestgetenv) 159 - [guest.kill](#guestkill) 160 - [guest.ls](#guestls) 161 - [guest.mkdir](#guestmkdir) 162 - [guest.mktemp](#guestmktemp) 163 - [guest.mv](#guestmv) 164 - [guest.ps](#guestps) 165 - [guest.rm](#guestrm) 166 - [guest.rmdir](#guestrmdir) 167 - [guest.run](#guestrun) 168 - [guest.start](#gueststart) 169 - [guest.touch](#guesttouch) 170 - [guest.upload](#guestupload) 171 - [host.account.create](#hostaccountcreate) 172 - [host.account.remove](#hostaccountremove) 173 - [host.account.update](#hostaccountupdate) 174 - [host.add](#hostadd) 175 - [host.autostart.add](#hostautostartadd) 176 - [host.autostart.configure](#hostautostartconfigure) 177 - [host.autostart.info](#hostautostartinfo) 178 - [host.autostart.remove](#hostautostartremove) 179 - [host.cert.csr](#hostcertcsr) 180 - [host.cert.import](#hostcertimport) 181 - [host.cert.info](#hostcertinfo) 182 - [host.date.change](#hostdatechange) 183 - [host.date.info](#hostdateinfo) 184 - [host.disconnect](#hostdisconnect) 185 - [host.esxcli](#hostesxcli) 186 - [host.info](#hostinfo) 187 - [host.maintenance.enter](#hostmaintenanceenter) 188 - [host.maintenance.exit](#hostmaintenanceexit) 189 - [host.option.ls](#hostoptionls) 190 - [host.option.set](#hostoptionset) 191 - [host.portgroup.add](#hostportgroupadd) 192 - [host.portgroup.change](#hostportgroupchange) 193 - [host.portgroup.info](#hostportgroupinfo) 194 - [host.portgroup.remove](#hostportgroupremove) 195 - [host.reconnect](#hostreconnect) 196 - [host.remove](#hostremove) 197 - [host.service](#hostservice) 198 - [host.service.ls](#hostservicels) 199 - [host.shutdown](#hostshutdown) 200 - [host.storage.info](#hoststorageinfo) 201 - [host.storage.mark](#hoststoragemark) 202 - [host.storage.partition](#hoststoragepartition) 203 - [host.vnic.change](#hostvnicchange) 204 - [host.vnic.hint](#hostvnichint) 205 - [host.vnic.info](#hostvnicinfo) 206 - [host.vnic.service](#hostvnicservice) 207 - [host.vswitch.add](#hostvswitchadd) 208 - [host.vswitch.info](#hostvswitchinfo) 209 - [host.vswitch.remove](#hostvswitchremove) 210 - [import.ova](#importova) 211 - [import.ovf](#importovf) 212 - [import.spec](#importspec) 213 - [import.vmdk](#importvmdk) 214 - [library.checkin](#librarycheckin) 215 - [library.checkout](#librarycheckout) 216 - [library.clone](#libraryclone) 217 - [library.cp](#librarycp) 218 - [library.create](#librarycreate) 219 - [library.deploy](#librarydeploy) 220 - [library.evict](#libraryevict) 221 - [library.export](#libraryexport) 222 - [library.import](#libraryimport) 223 - [library.info](#libraryinfo) 224 - [library.ls](#libraryls) 225 - [library.policy.ls](#librarypolicyls) 226 - [library.publish](#librarypublish) 227 - [library.rm](#libraryrm) 228 - [library.session.ls](#librarysessionls) 229 - [library.session.rm](#librarysessionrm) 230 - [library.subscriber.create](#librarysubscribercreate) 231 - [library.subscriber.info](#librarysubscriberinfo) 232 - [library.subscriber.ls](#librarysubscriberls) 233 - [library.subscriber.rm](#librarysubscriberrm) 234 - [library.sync](#librarysync) 235 - [library.trust.create](#librarytrustcreate) 236 - [library.trust.info](#librarytrustinfo) 237 - [library.trust.ls](#librarytrustls) 238 - [library.trust.rm](#librarytrustrm) 239 - [library.update](#libraryupdate) 240 - [library.vmtx.info](#libraryvmtxinfo) 241 - [license.add](#licenseadd) 242 - [license.assign](#licenseassign) 243 - [license.assigned.ls](#licenseassignedls) 244 - [license.decode](#licensedecode) 245 - [license.label.set](#licenselabelset) 246 - [license.ls](#licensels) 247 - [license.remove](#licenseremove) 248 - [logs](#logs) 249 - [logs.download](#logsdownload) 250 - [logs.ls](#logsls) 251 - [ls](#ls) 252 - [metric.change](#metricchange) 253 - [metric.info](#metricinfo) 254 - [metric.interval.change](#metricintervalchange) 255 - [metric.interval.info](#metricintervalinfo) 256 - [metric.ls](#metricls) 257 - [metric.reset](#metricreset) 258 - [metric.sample](#metricsample) 259 - [namespace.cluster.disable](#namespaceclusterdisable) 260 - [namespace.cluster.enable](#namespaceclusterenable) 261 - [namespace.cluster.ls](#namespaceclusterls) 262 - [namespace.create](#namespacecreate) 263 - [namespace.info](#namespaceinfo) 264 - [namespace.logs.download](#namespacelogsdownload) 265 - [namespace.ls](#namespacels) 266 - [namespace.rm](#namespacerm) 267 - [namespace.service.activate](#namespaceserviceactivate) 268 - [namespace.service.create](#namespaceservicecreate) 269 - [namespace.service.deactivate](#namespaceservicedeactivate) 270 - [namespace.service.info](#namespaceserviceinfo) 271 - [namespace.service.ls](#namespaceservicels) 272 - [namespace.service.rm](#namespaceservicerm) 273 - [namespace.update](#namespaceupdate) 274 - [namespace.vmclass.create](#namespacevmclasscreate) 275 - [namespace.vmclass.info](#namespacevmclassinfo) 276 - [namespace.vmclass.ls](#namespacevmclassls) 277 - [namespace.vmclass.rm](#namespacevmclassrm) 278 - [namespace.vmclass.update](#namespacevmclassupdate) 279 - [object.collect](#objectcollect) 280 - [object.destroy](#objectdestroy) 281 - [object.method](#objectmethod) 282 - [object.mv](#objectmv) 283 - [object.reload](#objectreload) 284 - [object.rename](#objectrename) 285 - [object.save](#objectsave) 286 - [option.ls](#optionls) 287 - [option.set](#optionset) 288 - [permissions.ls](#permissionsls) 289 - [permissions.remove](#permissionsremove) 290 - [permissions.set](#permissionsset) 291 - [pool.change](#poolchange) 292 - [pool.create](#poolcreate) 293 - [pool.destroy](#pooldestroy) 294 - [pool.info](#poolinfo) 295 - [role.create](#rolecreate) 296 - [role.ls](#rolels) 297 - [role.remove](#roleremove) 298 - [role.update](#roleupdate) 299 - [role.usage](#roleusage) 300 - [session.login](#sessionlogin) 301 - [session.logout](#sessionlogout) 302 - [session.ls](#sessionls) 303 - [session.rm](#sessionrm) 304 - [snapshot.create](#snapshotcreate) 305 - [snapshot.remove](#snapshotremove) 306 - [snapshot.revert](#snapshotrevert) 307 - [snapshot.tree](#snapshottree) 308 - [sso.group.create](#ssogroupcreate) 309 - [sso.group.ls](#ssogroupls) 310 - [sso.group.rm](#ssogrouprm) 311 - [sso.group.update](#ssogroupupdate) 312 - [sso.idp.default.ls](#ssoidpdefaultls) 313 - [sso.idp.default.update](#ssoidpdefaultupdate) 314 - [sso.idp.ldap.update](#ssoidpldapupdate) 315 - [sso.idp.ls](#ssoidpls) 316 - [sso.lpp.info](#ssolppinfo) 317 - [sso.lpp.update](#ssolppupdate) 318 - [sso.service.ls](#ssoservicels) 319 - [sso.user.create](#ssousercreate) 320 - [sso.user.id](#ssouserid) 321 - [sso.user.ls](#ssouserls) 322 - [sso.user.rm](#ssouserrm) 323 - [sso.user.update](#ssouserupdate) 324 - [storage.policy.create](#storagepolicycreate) 325 - [storage.policy.info](#storagepolicyinfo) 326 - [storage.policy.ls](#storagepolicyls) 327 - [storage.policy.rm](#storagepolicyrm) 328 - [tags.attach](#tagsattach) 329 - [tags.attached.ls](#tagsattachedls) 330 - [tags.category.create](#tagscategorycreate) 331 - [tags.category.info](#tagscategoryinfo) 332 - [tags.category.ls](#tagscategoryls) 333 - [tags.category.rm](#tagscategoryrm) 334 - [tags.category.update](#tagscategoryupdate) 335 - [tags.create](#tagscreate) 336 - [tags.detach](#tagsdetach) 337 - [tags.info](#tagsinfo) 338 - [tags.ls](#tagsls) 339 - [tags.rm](#tagsrm) 340 - [tags.update](#tagsupdate) 341 - [task.cancel](#taskcancel) 342 - [tasks](#tasks) 343 - [tree](#tree) 344 - [vapp.destroy](#vappdestroy) 345 - [vapp.power](#vapppower) 346 - [vcsa.access.consolecli.get](#vcsaaccessconsolecliget) 347 - [vcsa.access.consolecli.set](#vcsaaccessconsolecliset) 348 - [vcsa.access.dcui.get](#vcsaaccessdcuiget) 349 - [vcsa.access.dcui.set](#vcsaaccessdcuiset) 350 - [vcsa.access.shell.get](#vcsaaccessshellget) 351 - [vcsa.access.shell.set](#vcsaaccessshellset) 352 - [vcsa.access.ssh.get](#vcsaaccesssshget) 353 - [vcsa.access.ssh.set](#vcsaaccesssshset) 354 - [vcsa.log.forwarding.info](#vcsalogforwardinginfo) 355 - [vcsa.net.proxy.info](#vcsanetproxyinfo) 356 - [vcsa.shutdown.cancel](#vcsashutdowncancel) 357 - [vcsa.shutdown.get](#vcsashutdownget) 358 - [vcsa.shutdown.poweroff](#vcsashutdownpoweroff) 359 - [vcsa.shutdown.reboot](#vcsashutdownreboot) 360 - [version](#version) 361 - [vlcm.depot.baseimages.ls](#vlcmdepotbaseimagesls) 362 - [vlcm.depot.offline.create](#vlcmdepotofflinecreate) 363 - [vlcm.depot.offline.info](#vlcmdepotofflineinfo) 364 - [vlcm.depot.offline.ls](#vlcmdepotofflinels) 365 - [vlcm.depot.offline.rm](#vlcmdepotofflinerm) 366 - [vm.change](#vmchange) 367 - [vm.clone](#vmclone) 368 - [vm.console](#vmconsole) 369 - [vm.create](#vmcreate) 370 - [vm.customize](#vmcustomize) 371 - [vm.dataset.create](#vmdatasetcreate) 372 - [vm.dataset.entry.get](#vmdatasetentryget) 373 - [vm.dataset.entry.ls](#vmdatasetentryls) 374 - [vm.dataset.entry.rm](#vmdatasetentryrm) 375 - [vm.dataset.entry.set](#vmdatasetentryset) 376 - [vm.dataset.info](#vmdatasetinfo) 377 - [vm.dataset.ls](#vmdatasetls) 378 - [vm.dataset.rm](#vmdatasetrm) 379 - [vm.dataset.update](#vmdatasetupdate) 380 - [vm.destroy](#vmdestroy) 381 - [vm.disk.attach](#vmdiskattach) 382 - [vm.disk.change](#vmdiskchange) 383 - [vm.disk.create](#vmdiskcreate) 384 - [vm.guest.tools](#vmguesttools) 385 - [vm.info](#vminfo) 386 - [vm.instantclone](#vminstantclone) 387 - [vm.ip](#vmip) 388 - [vm.keystrokes](#vmkeystrokes) 389 - [vm.markastemplate](#vmmarkastemplate) 390 - [vm.markasvm](#vmmarkasvm) 391 - [vm.migrate](#vmmigrate) 392 - [vm.network.add](#vmnetworkadd) 393 - [vm.network.change](#vmnetworkchange) 394 - [vm.option.info](#vmoptioninfo) 395 - [vm.option.ls](#vmoptionls) 396 - [vm.power](#vmpower) 397 - [vm.question](#vmquestion) 398 - [vm.rdm.attach](#vmrdmattach) 399 - [vm.rdm.ls](#vmrdmls) 400 - [vm.register](#vmregister) 401 - [vm.target.cap.ls](#vmtargetcapls) 402 - [vm.target.info](#vmtargetinfo) 403 - [vm.unregister](#vmunregister) 404 - [vm.upgrade](#vmupgrade) 405 - [vm.vnc](#vmvnc) 406 - [volume.ls](#volumels) 407 - [volume.rm](#volumerm) 408 - [volume.snapshot.create](#volumesnapshotcreate) 409 - [volume.snapshot.ls](#volumesnapshotls) 410 - [volume.snapshot.rm](#volumesnapshotrm) 411 - [vsan.change](#vsanchange) 412 - [vsan.info](#vsaninfo) 413 414 </details> 415 416 ## about 417 418 ``` 419 Usage: govc about [OPTIONS] 420 421 Display About info for HOST. 422 423 System information including the name, type, version, and build number. 424 425 Examples: 426 govc about 427 govc about -json | jq -r .about.productLineId 428 429 Options: 430 -c=false Include client info 431 -l=false Include service content 432 ``` 433 434 ## about.cert 435 436 ``` 437 Usage: govc about.cert [OPTIONS] 438 439 Display TLS certificate info for HOST. 440 441 If the HOST certificate cannot be verified, about.cert will return with exit code 60 (as curl does). 442 If the '-k' flag is provided, about.cert will return with exit code 0 in this case. 443 The SHA1 thumbprint can also be used as '-thumbprint' for the 'host.add' and 'cluster.add' commands. 444 445 Examples: 446 govc about.cert -k -json | jq -r .thumbprintSHA1 447 govc about.cert -k -show | sudo tee /usr/local/share/ca-certificates/host.crt 448 govc about.cert -k -thumbprint | tee -a ~/.govmomi/known_hosts 449 450 Options: 451 -show=false Show PEM encoded server certificate only 452 -thumbprint=false Output host hash and thumbprint only 453 ``` 454 455 ## cluster.add 456 457 ``` 458 Usage: govc cluster.add [OPTIONS] 459 460 Add HOST to CLUSTER. 461 462 The host is added to the cluster specified by the 'cluster' flag. 463 464 Examples: 465 thumbprint=$(govc about.cert -k -u host.example.com -thumbprint | awk '{print $2}') 466 govc cluster.add -cluster ClusterA -hostname host.example.com -username root -password pass -thumbprint $thumbprint 467 govc cluster.add -cluster ClusterB -hostname 10.0.6.1 -username root -password pass -noverify 468 469 Options: 470 -cluster= Cluster [GOVC_CLUSTER] 471 -connect=true Immediately connect to host 472 -force=false Force when host is managed by another VC 473 -hostname= Hostname or IP address of the host 474 -license= Assign license key 475 -noverify=false Accept host thumbprint without verification 476 -password= Password of administration account on the host 477 -thumbprint= SHA-1 thumbprint of the host's SSL certificate 478 -username= Username of administration account on the host 479 ``` 480 481 ## cluster.change 482 483 ``` 484 Usage: govc cluster.change [OPTIONS] CLUSTER... 485 486 Change configuration of the given clusters. 487 488 Examples: 489 govc cluster.change -drs-enabled -vsan-enabled -vsan-autoclaim ClusterA 490 govc cluster.change -drs-enabled=false ClusterB 491 govc cluster.change -drs-vmotion-rate=4 ClusterC 492 493 Options: 494 -drs-enabled=<nil> Enable DRS 495 -drs-mode= DRS behavior for virtual machines: manual, partiallyAutomated, fullyAutomated 496 -drs-vmotion-rate=0 Aggressiveness of vMotions (1-5) 497 -ha-admission-control-enabled=<nil> Enable HA admission control 498 -ha-enabled=<nil> Enable HA 499 -vsan-autoclaim=<nil> Autoclaim storage on cluster hosts 500 -vsan-enabled=<nil> Enable vSAN 501 ``` 502 503 ## cluster.create 504 505 ``` 506 Usage: govc cluster.create [OPTIONS] CLUSTER 507 508 Create CLUSTER in datacenter. 509 510 The cluster is added to the folder specified by the 'folder' flag. If not given, 511 this defaults to the host folder in the specified or default datacenter. 512 513 Examples: 514 govc cluster.create ClusterA 515 govc cluster.create -folder /dc2/test-folder ClusterB 516 517 Options: 518 -folder= Inventory folder [GOVC_FOLDER] 519 ``` 520 521 ## cluster.draft.baseimage.info 522 523 ``` 524 Usage: govc cluster.draft.baseimage.info [OPTIONS] CLUSTER 525 526 Displays the base image version of a software draft. 527 528 Examples: 529 govc cluster.draft.baseimage.info -cluster-id=domain-c21 -draft-id=13 530 531 Options: 532 -cluster-id= The identifier of the cluster. 533 -draft-id= The identifier of the software draft. 534 ``` 535 536 ## cluster.draft.baseimage.set 537 538 ``` 539 Usage: govc cluster.draft.baseimage.set [OPTIONS] CLUSTER 540 541 Sets the ESXi base image on the software draft. 542 543 Examples: 544 govc cluster.draft.baseimage.set -cluster-id=domain-c21 -draft-id=31 545 546 Options: 547 -cluster-id= The identifier of the cluster. 548 -draft-id= The identifier of the software draft. 549 -version= The identifier of the ESXi image version. 550 ``` 551 552 ## cluster.draft.commit 553 554 ``` 555 Usage: govc cluster.draft.commit [OPTIONS] CLUSTER 556 557 Commits the provided software draft. 558 559 Execution will block the terminal for the duration of the task. 560 561 Examples: 562 govc cluster.draft.commit -cluster-id=domain-c21 -draft-id=13 563 564 Options: 565 -cluster-id= The identifier of the cluster. 566 -draft-id= The identifier of the software draft. 567 ``` 568 569 ## cluster.draft.component.add 570 571 ``` 572 Usage: govc cluster.draft.component.add [OPTIONS] CLUSTER 573 574 Adds a new component to the software draft. 575 576 Examples: 577 govc cluster.draft.component.add -cluster-id=domain-c21 -draft-id=13 -component-id=NVD-AIE-800 -component-version=550.54.10-1OEM.800.1.0.20613240 578 579 Options: 580 -cluster-id= The identifier of the cluster. 581 -component-id= The identifier of the software component. 582 -component-version= The version of the software component. 583 -draft-id= The identifier of the software draft. 584 ``` 585 586 ## cluster.draft.component.info 587 588 ``` 589 Usage: govc cluster.draft.component.info [OPTIONS] CLUSTER 590 591 Displays the details of a component in a software draft. 592 593 Examples: 594 govc cluster.draft.component.info -cluster-id=domain-c21 -draft-id=13 -component-id=NVD-AIE-800 595 596 Options: 597 -cluster-id= The identifier of the cluster. 598 -component-id= The identifier of the software component. 599 -draft-id= The identifier of the software draft. 600 ``` 601 602 ## cluster.draft.component.ls 603 604 ``` 605 Usage: govc cluster.draft.component.ls [OPTIONS] CLUSTER 606 607 Displays the list of components in a software draft. 608 609 Examples: 610 govc cluster.draft.component.ls -cluster-id=domain-c21 -draft-id=13 611 612 Options: 613 -cluster-id= The identifier of the cluster. 614 -draft-id= The identifier of the software draft. 615 ``` 616 617 ## cluster.draft.component.rm 618 619 ``` 620 Usage: govc cluster.draft.component.rm [OPTIONS] CLUSTER 621 622 Removes a component from a software draft. 623 624 Examples: 625 govc cluster.draft.component.rm -cluster-id=domain-c21 -draft-id=13 -component-id=NVD-AIE-800 626 627 Options: 628 -cluster-id= The identifier of the cluster. 629 -component-id= The identifier of the software component. 630 -draft-id= The identifier of the software draft. 631 ``` 632 633 ## cluster.draft.create 634 635 ``` 636 Usage: govc cluster.draft.create [OPTIONS] CLUSTER 637 638 Creates a new software draft. 639 640 There can be only one active draft at a time on every cluster. 641 642 Examples: 643 govc cluster.draft.create -cluster-id=domain-c21 644 645 Options: 646 -cluster-id= The identifier of the cluster. 647 ``` 648 649 ## cluster.draft.info 650 651 ``` 652 Usage: govc cluster.draft.info [OPTIONS] CLUSTER 653 654 Displays the details of a software draft. 655 656 Examples: 657 govc cluster.draft.info -cluster-id=domain-c21 -draft-id=13 658 659 Options: 660 -cluster-id= The identifier of the cluster. 661 -draft-id= The identifier of the software draft. 662 ``` 663 664 ## cluster.draft.ls 665 666 ``` 667 Usage: govc cluster.draft.ls [OPTIONS] CLUSTER 668 669 Displays the list of software drafts. 670 671 Examples: 672 govc cluster.draft.ls -cluster-id=domain-c21 673 govc cluster.draft.ls -cluster-id=domain-c21 -owners=stoyan1,stoyan2 674 675 Options: 676 -cluster-id= The identifier of the cluster. 677 -owners= A comma-separated list of owners to filter by. 678 ``` 679 680 ## cluster.draft.rm 681 682 ``` 683 Usage: govc cluster.draft.rm [OPTIONS] CLUSTER 684 685 Discards a software draft. 686 687 Examples: 688 govc cluster.draft.rm -cluster-id=domain-c21 -draft-id=13 689 690 Options: 691 -cluster-id= The identifier of the cluster. 692 -draft-id= The identifier of the software draft. 693 ``` 694 695 ## cluster.group.change 696 697 ``` 698 Usage: govc cluster.group.change [OPTIONS] NAME... 699 700 Set cluster group members. 701 702 Examples: 703 govc cluster.group.change -name my_group vm_a vm_b vm_c # set 704 govc cluster.group.change -name my_group vm_a vm_b vm_c $(govc cluster.group.ls -name my_group) vm_d # add 705 govc cluster.group.ls -name my_group | grep -v vm_b | xargs govc cluster.group.change -name my_group vm_a vm_b vm_c # remove 706 707 Options: 708 -cluster= Cluster [GOVC_CLUSTER] 709 -name= Cluster group name 710 ``` 711 712 ## cluster.group.create 713 714 ``` 715 Usage: govc cluster.group.create [OPTIONS] 716 717 Create cluster group. 718 719 One of '-vm' or '-host' must be provided to specify the group type. 720 721 Examples: 722 govc cluster.group.create -name my_vm_group -vm vm_a vm_b vm_c 723 govc cluster.group.create -name my_host_group -host host_a host_b host_c 724 725 Options: 726 -cluster= Cluster [GOVC_CLUSTER] 727 -host=false Create cluster Host group 728 -name= Cluster group name 729 -vm=false Create cluster VM group 730 ``` 731 732 ## cluster.group.ls 733 734 ``` 735 Usage: govc cluster.group.ls [OPTIONS] 736 737 List cluster groups and group members. 738 739 Examples: 740 govc cluster.group.ls -cluster my_cluster 741 govc cluster.group.ls -cluster my_cluster -l | grep ClusterHostGroup 742 govc cluster.group.ls -cluster my_cluster -name my_group 743 744 Options: 745 -cluster= Cluster [GOVC_CLUSTER] 746 -l=false Long listing format 747 -name= Cluster group name 748 ``` 749 750 ## cluster.group.remove 751 752 ``` 753 Usage: govc cluster.group.remove [OPTIONS] 754 755 Remove cluster group. 756 757 Examples: 758 govc cluster.group.remove -cluster my_cluster -name my_group 759 760 Options: 761 -cluster= Cluster [GOVC_CLUSTER] 762 -name= Cluster group name 763 ``` 764 765 ## cluster.module.create 766 767 ``` 768 Usage: govc cluster.module.create [OPTIONS] 769 770 Create cluster module. 771 772 This command will output the ID of the new module. 773 774 Examples: 775 govc cluster.module.create -cluster my_cluster 776 777 Options: 778 -cluster= Cluster [GOVC_CLUSTER] 779 ``` 780 781 ## cluster.module.ls 782 783 ``` 784 Usage: govc cluster.module.ls [OPTIONS] 785 786 List cluster modules. 787 788 When -id is specified, that module's members are listed. 789 790 Examples: 791 govc cluster.module.ls 792 govc cluster.module.ls -json | jq . 793 govc cluster.module.ls -id module_id 794 795 Options: 796 -id= Module ID 797 ``` 798 799 ## cluster.module.rm 800 801 ``` 802 Usage: govc cluster.module.rm [OPTIONS] ID 803 804 Delete cluster module ID. 805 806 If ID is "-", read a list from stdin. 807 808 Examples: 809 govc cluster.module.rm module_id 810 govc cluster.module.rm - < input-file.txt 811 812 Options: 813 -ignore-not-found=false Treat "404 Not Found" as a successful delete. 814 ``` 815 816 ## cluster.module.vm.add 817 818 ``` 819 Usage: govc cluster.module.vm.add [OPTIONS] VM... 820 821 Add VM(s) to a cluster module. 822 823 Examples: 824 govc cluster.module.vm.add -id module_id $vm... 825 826 Options: 827 -id= Module ID 828 ``` 829 830 ## cluster.module.vm.rm 831 832 ``` 833 Usage: govc cluster.module.vm.rm [OPTIONS] VM... 834 835 Remove VM(s) from a cluster module. 836 837 Examples: 838 govc cluster.module.vm.rm -id module_id $vm... 839 840 Options: 841 -id= Module ID 842 ``` 843 844 ## cluster.mv 845 846 ``` 847 Usage: govc cluster.mv [OPTIONS] 848 849 Move HOST to CLUSTER. 850 851 The hosts are moved to the cluster specified by the 'cluster' flag. 852 853 Examples: 854 govc cluster.mv -cluster ClusterA host1 host2 855 856 Options: 857 -cluster= Cluster [GOVC_CLUSTER] 858 ``` 859 860 ## cluster.override.change 861 862 ``` 863 Usage: govc cluster.override.change [OPTIONS] 864 865 Change cluster VM overrides. 866 867 Examples: 868 govc cluster.override.change -cluster cluster_1 -vm vm_1 -drs-enabled=false 869 govc cluster.override.change -cluster cluster_1 -vm vm_2 -drs-enabled -drs-mode fullyAutomated 870 govc cluster.override.change -cluster cluster_1 -vm vm_3 -ha-restart-priority high 871 govc cluster.override.change -cluster cluster_1 -vm vm_4 -ha-additional-delay 30 872 govc cluster.override.change -cluster cluster_1 -vm vm_5 -ha-ready-condition poweredOn 873 874 Options: 875 -cluster= Cluster [GOVC_CLUSTER] 876 -drs-enabled=<nil> Enable DRS 877 -drs-mode= DRS behavior for virtual machines: manual, partiallyAutomated, fullyAutomated 878 -ha-additional-delay=0 HA Additional Delay 879 -ha-ready-condition= HA VM Ready Condition (Start next priority VMs when): poweredOn, guestHbStatusGreen, appHbStatusGreen, useClusterDefault 880 -ha-restart-priority= HA restart priority: disabled, lowest, low, medium, high, highest 881 -vm= Virtual machine [GOVC_VM] 882 ``` 883 884 ## cluster.override.info 885 886 ``` 887 Usage: govc cluster.override.info [OPTIONS] 888 889 Cluster VM overrides info. 890 891 Examples: 892 govc cluster.override.info 893 govc cluster.override.info -json 894 895 Options: 896 -cluster= Cluster [GOVC_CLUSTER] 897 ``` 898 899 ## cluster.override.remove 900 901 ``` 902 Usage: govc cluster.override.remove [OPTIONS] 903 904 Remove cluster VM overrides. 905 906 Examples: 907 govc cluster.override.remove -cluster cluster_1 -vm vm_1 908 909 Options: 910 -cluster= Cluster [GOVC_CLUSTER] 911 -vm= Virtual machine [GOVC_VM] 912 ``` 913 914 ## cluster.rule.change 915 916 ``` 917 Usage: govc cluster.rule.change [OPTIONS] NAME... 918 919 Change cluster rule. 920 921 Examples: 922 govc cluster.rule.change -cluster my_cluster -name my_rule -enable=false 923 924 Options: 925 -cluster= Cluster [GOVC_CLUSTER] 926 -enable=<nil> Enable rule 927 -host-affine-group= Host affine group name 928 -host-anti-affine-group= Host anti-affine group name 929 -l=false Long listing format 930 -mandatory=<nil> Enforce rule compliance 931 -name= Cluster rule name 932 -vm-group= VM group name 933 ``` 934 935 ## cluster.rule.create 936 937 ``` 938 Usage: govc cluster.rule.create [OPTIONS] NAME... 939 940 Create cluster rule. 941 942 Rules are not enabled by default, use the 'enable' flag to enable upon creation or cluster.rule.change after creation. 943 944 One of '-affinity', '-anti-affinity', '-depends' or '-vm-host' must be provided to specify the rule type. 945 946 With '-affinity' or '-anti-affinity', at least 2 vm NAME arguments must be specified. 947 948 With '-depends', vm group NAME and vm group dependency NAME arguments must be specified. 949 950 With '-vm-host', use the '-vm-group' flag combined with the '-host-affine-group' and/or '-host-anti-affine-group' flags. 951 952 Examples: 953 govc cluster.rule.create -name pod1 -enable -affinity vm_a vm_b vm_c 954 govc cluster.rule.create -name pod2 -enable -anti-affinity vm_d vm_e vm_f 955 govc cluster.rule.create -name pod3 -enable -mandatory -vm-host -vm-group my_vms -host-affine-group my_hosts 956 govc cluster.rule.create -name pod4 -depends vm_group_app vm_group_db 957 958 Options: 959 -affinity=false Keep Virtual Machines Together 960 -anti-affinity=false Separate Virtual Machines 961 -cluster= Cluster [GOVC_CLUSTER] 962 -depends=false Virtual Machines to Virtual Machines 963 -enable=<nil> Enable rule 964 -host-affine-group= Host affine group name 965 -host-anti-affine-group= Host anti-affine group name 966 -l=false Long listing format 967 -mandatory=<nil> Enforce rule compliance 968 -name= Cluster rule name 969 -vm-group= VM group name 970 -vm-host=false Virtual Machines to Hosts 971 ``` 972 973 ## cluster.rule.info 974 975 ``` 976 Usage: govc cluster.rule.info [OPTIONS] 977 978 Provides detailed infos about cluster rules, their types and rule members. 979 980 Examples: 981 govc cluster.rule.info -cluster my_cluster 982 govc cluster.rule.info -cluster my_cluster -name my_rule 983 984 Options: 985 -cluster= Cluster [GOVC_CLUSTER] 986 -l=false Long listing format 987 -name= Cluster rule name 988 ``` 989 990 ## cluster.rule.ls 991 992 ``` 993 Usage: govc cluster.rule.ls [OPTIONS] 994 995 List cluster rules and rule members. 996 997 Examples: 998 govc cluster.rule.ls -cluster my_cluster 999 govc cluster.rule.ls -cluster my_cluster -name my_rule 1000 govc cluster.rule.ls -cluster my_cluster -l 1001 govc cluster.rule.ls -cluster my_cluster -name my_rule -l 1002 1003 Options: 1004 -cluster= Cluster [GOVC_CLUSTER] 1005 -l=false Long listing format 1006 -name= Cluster rule name 1007 ``` 1008 1009 ## cluster.rule.remove 1010 1011 ``` 1012 Usage: govc cluster.rule.remove [OPTIONS] 1013 1014 Remove cluster rule. 1015 1016 Examples: 1017 govc cluster.group.remove -cluster my_cluster -name my_rule 1018 1019 Options: 1020 -cluster= Cluster [GOVC_CLUSTER] 1021 -l=false Long listing format 1022 -name= Cluster rule name 1023 ``` 1024 1025 ## cluster.stretch 1026 1027 ``` 1028 Usage: govc cluster.stretch [OPTIONS] CLUSTER 1029 1030 Convert a vSAN cluster into a stretched cluster 1031 1032 The vSAN cluster is converted to a stretched cluster with a witness host 1033 specified by the 'witness' flag. The datastore hosts are placed into one 1034 of two fault domains that are specified in each host list. The name of the 1035 preferred fault domain can be specified by the 'preferred-fault-domain' flag. 1036 1037 Examples: 1038 govc cluster.stretch -dc remote-site-1 \ 1039 -witness /dc-name/host/192.168.112.2 \ 1040 -first-fault-domain-hosts 192.168.113.121 \ 1041 -second-fault-domain-hosts 192.168.113.45,192.168.113.70 \ 1042 cluster-name 1043 1044 Options: 1045 -first-fault-domain-hosts= Hosts to place in the first fault domain 1046 -first-fault-domain-name=Primary Name of the first fault domain 1047 -preferred-fault-domain=Primary Name of the preferred fault domain 1048 -second-fault-domain-hosts= Hosts to place in the second fault domain 1049 -second-fault-domain-name=Secondary Name of the second fault domain 1050 -witness= Witness host for the stretched cluster 1051 ``` 1052 1053 ## cluster.usage 1054 1055 ``` 1056 Usage: govc cluster.usage [OPTIONS] CLUSTER 1057 1058 Cluster resource usage summary. 1059 1060 Examples: 1061 govc cluster.usage ClusterName 1062 govc cluster.usage -S ClusterName # summarize shared storage only 1063 govc cluster.usage -json ClusterName | jq -r .cpu.summary.usage 1064 1065 Options: 1066 -S=false Exclude host local storage 1067 ``` 1068 1069 ## cluster.vlcm.enable 1070 1071 ``` 1072 Usage: govc cluster.vlcm.enable [OPTIONS] CLUSTER 1073 1074 Enables vLCM on the provided cluster 1075 1076 This operation is irreversible 1077 1078 Examples: 1079 govc cluster.vlcm.enable -cluster-id=domain-c21 1080 1081 Options: 1082 -cluster-id= The identifier of the cluster. 1083 -skip-check=false Whether to skip the software check after enabling vLCM 1084 ``` 1085 1086 ## cluster.vlcm.info 1087 1088 ``` 1089 Usage: govc cluster.vlcm.info [OPTIONS] CLUSTER 1090 1091 Displays the software management status of a cluster. 1092 1093 Examples: 1094 govc cluster.vlcm.info -cluster-id=domain-c21 1095 1096 Options: 1097 -cluster-id= The identifier of the cluster. 1098 ``` 1099 1100 ## datacenter.create 1101 1102 ``` 1103 Usage: govc datacenter.create [OPTIONS] NAME... 1104 1105 Create datacenter NAME. 1106 1107 Examples: 1108 govc datacenter.create MyDC # create 1109 govc object.destroy /MyDC # delete 1110 1111 Options: 1112 -folder= Inventory folder [GOVC_FOLDER] 1113 ``` 1114 1115 ## datacenter.info 1116 1117 ``` 1118 Usage: govc datacenter.info [OPTIONS] [PATH]... 1119 1120 Options: 1121 ``` 1122 1123 ## datastore.cluster.change 1124 1125 ``` 1126 Usage: govc datastore.cluster.change [OPTIONS] CLUSTER... 1127 1128 Change configuration of the given datastore clusters. 1129 1130 Examples: 1131 govc datastore.cluster.change -drs-enabled ClusterA 1132 govc datastore.cluster.change -drs-enabled=false ClusterB 1133 1134 Options: 1135 -drs-enabled=<nil> Enable Storage DRS 1136 -drs-mode= Storage DRS behavior: manual, automated 1137 ``` 1138 1139 ## datastore.cluster.info 1140 1141 ``` 1142 Usage: govc datastore.cluster.info [OPTIONS] [PATH]... 1143 1144 Display datastore cluster info. 1145 1146 Examples: 1147 govc datastore.cluster.info 1148 govc datastore.cluster.info MyDatastoreCluster 1149 1150 Options: 1151 ``` 1152 1153 ## datastore.cp 1154 1155 ``` 1156 Usage: govc datastore.cp [OPTIONS] SRC DST 1157 1158 Copy SRC to DST on DATASTORE. 1159 1160 Examples: 1161 govc datastore.cp foo/foo.vmx foo/foo.vmx.old 1162 govc datastore.cp -f my.vmx foo/foo.vmx 1163 govc datastore.cp disks/disk1.vmdk disks/disk2.vmdk 1164 govc datastore.cp disks/disk1.vmdk -dc-target DC2 disks/disk2.vmdk 1165 govc datastore.cp disks/disk1.vmdk -ds-target NFS-2 disks/disk2.vmdk 1166 1167 Options: 1168 -dc-target= Datacenter destination (defaults to -dc) 1169 -ds= Datastore [GOVC_DATASTORE] 1170 -ds-target= Datastore destination (defaults to -ds) 1171 -f=false If true, overwrite any identically named file at the destination 1172 -t=true Use file type to choose disk or file manager 1173 ``` 1174 1175 ## datastore.create 1176 1177 ``` 1178 Usage: govc datastore.create [OPTIONS] HOST... 1179 1180 Create datastore on HOST. 1181 1182 Examples: 1183 govc datastore.create -type nfs -name nfsDatastore -remote-host 10.143.2.232 -remote-path /share cluster1 1184 govc datastore.create -type vmfs -name vmfsDatastore -disk=mpx.vmhba0:C0:T0:L0 cluster1 1185 govc datastore.create -type local -name localDatastore -path /var/datastore host1 1186 1187 Options: 1188 -disk= Canonical name of disk (VMFS only) 1189 -force=false Ignore DuplicateName error if datastore is already mounted on a host 1190 -host= Host system [GOVC_HOST] 1191 -mode=readOnly Access mode for the mount point (readOnly|readWrite) 1192 -name= Datastore name 1193 -password= Password to use when connecting (CIFS only) 1194 -path= Local directory path for the datastore (local only) 1195 -remote-host= Remote hostname of the NAS datastore 1196 -remote-path= Remote path of the NFS mount point 1197 -type= Datastore type (NFS|NFS41|CIFS|VMFS|local) 1198 -username= Username to use when connecting (CIFS only) 1199 -version=<nil> VMFS major version 1200 ``` 1201 1202 ## datastore.disk.create 1203 1204 ``` 1205 Usage: govc datastore.disk.create [OPTIONS] VMDK 1206 1207 Create VMDK on DS. 1208 1209 Examples: 1210 govc datastore.mkdir disks 1211 govc datastore.disk.create -size 24G disks/disk1.vmdk 1212 govc datastore.disk.create disks/parent.vmdk disk/child.vmdk 1213 1214 Options: 1215 -a=lsiLogic Disk adapter 1216 -d=thin Disk format 1217 -ds= Datastore [GOVC_DATASTORE] 1218 -f=false Force 1219 -size=10.0GB Size of new disk 1220 -uuid= Disk UUID 1221 ``` 1222 1223 ## datastore.disk.inflate 1224 1225 ``` 1226 Usage: govc datastore.disk.inflate [OPTIONS] VMDK 1227 1228 Inflate VMDK on DS. 1229 1230 Examples: 1231 govc datastore.disk.inflate disks/disk1.vmdk 1232 1233 Options: 1234 -ds= Datastore [GOVC_DATASTORE] 1235 ``` 1236 1237 ## datastore.disk.info 1238 1239 ``` 1240 Usage: govc datastore.disk.info [OPTIONS] VMDK 1241 1242 Query VMDK info on DS. 1243 1244 Examples: 1245 govc datastore.disk.info disks/disk1.vmdk 1246 1247 Options: 1248 -c=false Chain format 1249 -d=false Include datastore in output 1250 -ds= Datastore [GOVC_DATASTORE] 1251 -p=true Include parents 1252 -uuid=false Include disk UUID 1253 ``` 1254 1255 ## datastore.disk.shrink 1256 1257 ``` 1258 Usage: govc datastore.disk.shrink [OPTIONS] VMDK 1259 1260 Shrink VMDK on DS. 1261 1262 Examples: 1263 govc datastore.disk.shrink disks/disk1.vmdk 1264 1265 Options: 1266 -copy=<nil> Perform shrink in-place mode if false, copy-shrink mode otherwise 1267 -ds= Datastore [GOVC_DATASTORE] 1268 ``` 1269 1270 ## datastore.download 1271 1272 ``` 1273 Usage: govc datastore.download [OPTIONS] SOURCE DEST 1274 1275 Copy SOURCE from DS to DEST on the local system. 1276 1277 If DEST name is "-", source is written to stdout. 1278 1279 Examples: 1280 govc datastore.download vm-name/vmware.log ./local.log 1281 govc datastore.download vm-name/vmware.log - | grep -i error 1282 1283 Options: 1284 -ds= Datastore [GOVC_DATASTORE] 1285 -host= Host system [GOVC_HOST] 1286 ``` 1287 1288 ## datastore.info 1289 1290 ``` 1291 Usage: govc datastore.info [OPTIONS] [PATH]... 1292 1293 Display info for Datastores. 1294 1295 Examples: 1296 govc datastore.info 1297 govc datastore.info vsanDatastore 1298 # info on Datastores shared between cluster hosts: 1299 govc object.collect -s -d " " /dc1/host/k8s-cluster host | xargs govc datastore.info -H 1300 # info on Datastores shared between VM hosts: 1301 govc ls /dc1/vm/*k8s* | xargs -n1 -I% govc object.collect -s % summary.runtime.host | xargs govc datastore.info -H 1302 1303 Options: 1304 -H=false Display info for Datastores shared between hosts 1305 ``` 1306 1307 ## datastore.ls 1308 1309 ``` 1310 Usage: govc datastore.ls [OPTIONS] [FILE]... 1311 1312 Options: 1313 -R=false List subdirectories recursively 1314 -a=false Do not ignore entries starting with . 1315 -ds= Datastore [GOVC_DATASTORE] 1316 -l=false Long listing format 1317 -p=false Append / indicator to directories 1318 ``` 1319 1320 ## datastore.maintenance.enter 1321 1322 ``` 1323 Usage: govc datastore.maintenance.enter [OPTIONS] DATASTORE 1324 1325 Put DATASTORE in maintenance mode. 1326 1327 Examples: 1328 govc datastore.cluster.change -drs-mode automated my-datastore-cluster # automatically schedule Storage DRS migration 1329 govc datastore.maintenance.enter -ds my-datastore-cluster/datastore1 1330 # no virtual machines can be powered on and no provisioning operations can be performed on the datastore during this time 1331 govc datastore.maintenance.exit -ds my-datastore-cluster/datastore1 1332 1333 Options: 1334 -ds= Datastore [GOVC_DATASTORE] 1335 ``` 1336 1337 ## datastore.maintenance.exit 1338 1339 ``` 1340 Usage: govc datastore.maintenance.exit [OPTIONS] DATASTORE 1341 1342 Take DATASTORE out of maintenance mode. 1343 1344 Options: 1345 -ds= Datastore [GOVC_DATASTORE] 1346 ``` 1347 1348 ## datastore.mkdir 1349 1350 ``` 1351 Usage: govc datastore.mkdir [OPTIONS] DIRECTORY 1352 1353 Options: 1354 -ds= Datastore [GOVC_DATASTORE] 1355 -namespace=false Return uuid of namespace created on vsan datastore 1356 -p=false Create intermediate directories as needed 1357 ``` 1358 1359 ## datastore.mv 1360 1361 ``` 1362 Usage: govc datastore.mv [OPTIONS] SRC DST 1363 1364 Move SRC to DST on DATASTORE. 1365 1366 Examples: 1367 govc datastore.mv foo/foo.vmx foo/foo.vmx.old 1368 govc datastore.mv -f my.vmx foo/foo.vmx 1369 1370 Options: 1371 -dc-target= Datacenter destination (defaults to -dc) 1372 -ds= Datastore [GOVC_DATASTORE] 1373 -ds-target= Datastore destination (defaults to -ds) 1374 -f=false If true, overwrite any identically named file at the destination 1375 -t=true Use file type to choose disk or file manager 1376 ``` 1377 1378 ## datastore.remove 1379 1380 ``` 1381 Usage: govc datastore.remove [OPTIONS] HOST... 1382 1383 Remove datastore from HOST. 1384 1385 Examples: 1386 govc datastore.remove -ds nfsDatastore cluster1 1387 govc datastore.remove -ds nasDatastore host1 host2 host3 1388 1389 Options: 1390 -ds= Datastore [GOVC_DATASTORE] 1391 -host= Host system [GOVC_HOST] 1392 ``` 1393 1394 ## datastore.rm 1395 1396 ``` 1397 Usage: govc datastore.rm [OPTIONS] FILE 1398 1399 Remove FILE from DATASTORE. 1400 1401 Examples: 1402 govc datastore.rm vm/vmware.log 1403 govc datastore.rm vm 1404 govc datastore.rm -f images/base.vmdk 1405 1406 Options: 1407 -ds= Datastore [GOVC_DATASTORE] 1408 -f=false Force; ignore nonexistent files and arguments 1409 -namespace=false Path is uuid of namespace on vsan datastore 1410 -t=true Use file type to choose disk or file manager 1411 ``` 1412 1413 ## datastore.tail 1414 1415 ``` 1416 Usage: govc datastore.tail [OPTIONS] PATH 1417 1418 Output the last part of datastore files. 1419 1420 Examples: 1421 govc datastore.tail -n 100 vm-name/vmware.log 1422 govc datastore.tail -n 0 -f vm-name/vmware.log 1423 1424 Options: 1425 -c=-1 Output the last NUM bytes 1426 -ds= Datastore [GOVC_DATASTORE] 1427 -f=false Output appended data as the file grows 1428 -host= Host system [GOVC_HOST] 1429 -n=10 Output the last NUM lines 1430 ``` 1431 1432 ## datastore.upload 1433 1434 ``` 1435 Usage: govc datastore.upload [OPTIONS] SOURCE DEST 1436 1437 Copy SOURCE from the local system to DEST on DS. 1438 1439 If SOURCE name is "-", read source from stdin. 1440 1441 Examples: 1442 govc datastore.upload -ds datastore1 ./config.iso vm-name/config.iso 1443 genisoimage ... | govc datastore.upload -ds datastore1 - vm-name/config.iso 1444 1445 Options: 1446 -ds= Datastore [GOVC_DATASTORE] 1447 ``` 1448 1449 ## datastore.vsan.dom.ls 1450 1451 ``` 1452 Usage: govc datastore.vsan.dom.ls [OPTIONS] [UUID]... 1453 1454 List vSAN DOM objects in DS. 1455 1456 Examples: 1457 govc datastore.vsan.dom.ls 1458 govc datastore.vsan.dom.ls -ds vsanDatastore -l 1459 govc datastore.vsan.dom.ls -l d85aa758-63f5-500a-3150-0200308e589c 1460 1461 Options: 1462 -ds= Datastore [GOVC_DATASTORE] 1463 -l=false Long listing 1464 -o=false List orphan objects 1465 ``` 1466 1467 ## datastore.vsan.dom.rm 1468 1469 ``` 1470 Usage: govc datastore.vsan.dom.rm [OPTIONS] UUID... 1471 1472 Remove vSAN DOM objects in DS. 1473 1474 Examples: 1475 govc datastore.vsan.dom.rm d85aa758-63f5-500a-3150-0200308e589c 1476 govc datastore.vsan.dom.rm -f d85aa758-63f5-500a-3150-0200308e589c 1477 govc datastore.vsan.dom.ls -o | xargs govc datastore.vsan.dom.rm 1478 1479 Options: 1480 -ds= Datastore [GOVC_DATASTORE] 1481 -f=false Force delete 1482 -v=false Print deleted UUIDs to stdout, failed to stderr 1483 ``` 1484 1485 ## device.boot 1486 1487 ``` 1488 Usage: govc device.boot [OPTIONS] 1489 1490 Configure VM boot settings. 1491 1492 Examples: 1493 govc device.boot -vm $vm -delay 1000 -order floppy,cdrom,ethernet,disk 1494 govc device.boot -vm $vm -order - # reset boot order 1495 govc device.boot -vm $vm -firmware efi -secure 1496 govc device.boot -vm $vm -firmware bios -secure=false 1497 1498 Options: 1499 -delay=0 Delay in ms before starting the boot sequence 1500 -firmware= Firmware type [bios|efi] 1501 -order= Boot device order [-,floppy,cdrom,ethernet,disk] 1502 -retry=false If true, retry boot after retry-delay 1503 -retry-delay=0 Delay in ms before a boot retry 1504 -secure=<nil> Enable EFI secure boot 1505 -setup=false If true, enter BIOS setup on next boot 1506 -vm= Virtual machine [GOVC_VM] 1507 ``` 1508 1509 ## device.cdrom.add 1510 1511 ``` 1512 Usage: govc device.cdrom.add [OPTIONS] 1513 1514 Add CD-ROM device to VM. 1515 1516 Examples: 1517 govc device.cdrom.add -vm $vm 1518 govc device.ls -vm $vm | grep ide- 1519 govc device.cdrom.add -vm $vm -controller ide-200 1520 govc device.info cdrom-* 1521 1522 Options: 1523 -controller= IDE controller name 1524 -vm= Virtual machine [GOVC_VM] 1525 ``` 1526 1527 ## device.cdrom.eject 1528 1529 ``` 1530 Usage: govc device.cdrom.eject [OPTIONS] 1531 1532 Eject media from CD-ROM device. 1533 1534 If device is not specified, the first CD-ROM device is used. 1535 1536 Examples: 1537 govc device.cdrom.eject -vm vm-1 1538 govc device.cdrom.eject -vm vm-1 -device floppy-1 1539 1540 Options: 1541 -device= CD-ROM device name 1542 -vm= Virtual machine [GOVC_VM] 1543 ``` 1544 1545 ## device.cdrom.insert 1546 1547 ``` 1548 Usage: govc device.cdrom.insert [OPTIONS] ISO 1549 1550 Insert media on datastore into CD-ROM device. 1551 1552 If device is not specified, the first CD-ROM device is used. 1553 1554 Examples: 1555 govc device.cdrom.insert -vm vm-1 -device cdrom-3000 images/boot.iso 1556 1557 Options: 1558 -device= CD-ROM device name 1559 -ds= Datastore [GOVC_DATASTORE] 1560 -vm= Virtual machine [GOVC_VM] 1561 ``` 1562 1563 ## device.clock.add 1564 1565 ``` 1566 Usage: govc device.clock.add [OPTIONS] 1567 1568 Add precision clock device to VM. 1569 1570 Examples: 1571 govc device.clock.add -vm $vm 1572 govc device.info clock-* 1573 1574 Options: 1575 -vm= Virtual machine [GOVC_VM] 1576 ``` 1577 1578 ## device.connect 1579 1580 ``` 1581 Usage: govc device.connect [OPTIONS] DEVICE... 1582 1583 Connect DEVICE on VM. 1584 1585 Examples: 1586 govc device.connect -vm $name cdrom-3000 1587 1588 Options: 1589 -vm= Virtual machine [GOVC_VM] 1590 ``` 1591 1592 ## device.disconnect 1593 1594 ``` 1595 Usage: govc device.disconnect [OPTIONS] DEVICE... 1596 1597 Disconnect DEVICE on VM. 1598 1599 Examples: 1600 govc device.disconnect -vm $name cdrom-3000 1601 1602 Options: 1603 -vm= Virtual machine [GOVC_VM] 1604 ``` 1605 1606 ## device.floppy.add 1607 1608 ``` 1609 Usage: govc device.floppy.add [OPTIONS] 1610 1611 Add floppy device to VM. 1612 1613 Examples: 1614 govc device.floppy.add -vm $vm 1615 govc device.info floppy-* 1616 1617 Options: 1618 -vm= Virtual machine [GOVC_VM] 1619 ``` 1620 1621 ## device.floppy.eject 1622 1623 ``` 1624 Usage: govc device.floppy.eject [OPTIONS] 1625 1626 Eject image from floppy device. 1627 1628 If device is not specified, the first floppy device is used. 1629 1630 Examples: 1631 govc device.floppy.eject -vm vm-1 1632 1633 Options: 1634 -device= Floppy device name 1635 -vm= Virtual machine [GOVC_VM] 1636 ``` 1637 1638 ## device.floppy.insert 1639 1640 ``` 1641 Usage: govc device.floppy.insert [OPTIONS] IMG 1642 1643 Insert IMG on datastore into floppy device. 1644 1645 If device is not specified, the first floppy device is used. 1646 1647 Examples: 1648 govc device.floppy.insert -vm vm-1 vm-1/config.img 1649 1650 Options: 1651 -device= Floppy device name 1652 -ds= Datastore [GOVC_DATASTORE] 1653 -vm= Virtual machine [GOVC_VM] 1654 ``` 1655 1656 ## device.info 1657 1658 ``` 1659 Usage: govc device.info [OPTIONS] [DEVICE]... 1660 1661 Device info for VM. 1662 1663 Examples: 1664 govc device.info -vm $name 1665 govc device.info -vm $name disk-* 1666 govc device.info -vm $name -json disk-* | jq -r .devices[].backing.uuid 1667 govc device.info -vm $name -json 'disk-*' | jq -r .devices[].backing.fileName # vmdk path 1668 govc device.info -vm $name -json ethernet-0 | jq -r .devices[].macAddress 1669 1670 Options: 1671 -net= Network [GOVC_NETWORK] 1672 -net.adapter=e1000 Network adapter type 1673 -net.address= Network hardware address 1674 -net.protocol= Network device protocol. Applicable to vmxnet3vrdma. Default to 'rocev2' 1675 -vm= Virtual machine [GOVC_VM] 1676 ``` 1677 1678 ## device.ls 1679 1680 ``` 1681 Usage: govc device.ls [OPTIONS] 1682 1683 List devices for VM. 1684 1685 Examples: 1686 govc device.ls -vm $name 1687 govc device.ls -vm $name disk-* 1688 govc device.ls -vm $name -json | jq '.devices[].name' 1689 1690 Options: 1691 -boot=false List devices configured in the VM's boot options 1692 -vm= Virtual machine [GOVC_VM] 1693 ``` 1694 1695 ## device.model.tree 1696 1697 ``` 1698 Usage: govc device.model.tree [OPTIONS] 1699 1700 Print the device model as a tree. 1701 1702 Examples: 1703 govc device.model.tree 1704 govc device.model.tree VirtualEthernetCard 1705 govc device.model.tree -backings 1706 govc device.model.tree -backings VirtualDiskRawDiskVer2BackingInfo 1707 1708 Options: 1709 -backings=false Print the devices backings 1710 ``` 1711 1712 ## device.pci.add 1713 1714 ``` 1715 Usage: govc device.pci.add [OPTIONS] PCI_ADDRESS... 1716 1717 Add PCI Passthrough device to VM. 1718 1719 Examples: 1720 govc device.pci.ls -vm $vm 1721 govc device.pci.add -vm $vm $pci_address 1722 govc device.info -vm $vm 1723 1724 Assuming vm name is helloworld, list command has below output 1725 1726 $ govc device.pci.ls -vm helloworld 1727 System ID Address Vendor Name Device Name 1728 5b087ce4-ce46-72c0-c7c2-28ac9e22c3c2 0000:60:00.0 Pensando Ethernet Controller 1 1729 5b087ce4-ce46-72c0-c7c2-28ac9e22c3c2 0000:61:00.0 Pensando Ethernet Controller 2 1730 1731 To add only 'Ethernet Controller 1', command should be as below. No output upon success. 1732 1733 $ govc device.pci.add -vm helloworld 0000:60:00.0 1734 1735 To add both 'Ethernet Controller 1' and 'Ethernet Controller 2', command should be as below. 1736 No output upon success. 1737 1738 $ govc device.pci.add -vm helloworld 0000:60:00.0 0000:61:00.0 1739 1740 $ govc device.info -vm helloworld 1741 ... 1742 Name: pcipassthrough-13000 1743 Type: VirtualPCIPassthrough 1744 Label: PCI device 0 1745 Summary: 1746 Key: 13000 1747 Controller: pci-100 1748 Unit number: 18 1749 Name: pcipassthrough-13001 1750 Type: VirtualPCIPassthrough 1751 Label: PCI device 1 1752 Summary: 1753 Key: 13001 1754 Controller: pci-100 1755 Unit number: 19 1756 1757 Options: 1758 -vm= Virtual machine [GOVC_VM] 1759 ``` 1760 1761 ## device.pci.ls 1762 1763 ``` 1764 Usage: govc device.pci.ls [OPTIONS] 1765 1766 List allowed PCI passthrough devices that could be attach to VM. 1767 1768 Examples: 1769 govc device.pci.ls -vm VM 1770 1771 Options: 1772 -vm= Virtual machine [GOVC_VM] 1773 ``` 1774 1775 ## device.pci.remove 1776 1777 ``` 1778 Usage: govc device.pci.remove [OPTIONS] <PCI ADDRESS>... 1779 1780 Remove PCI Passthrough device from VM. 1781 1782 Examples: 1783 govc device.info -vm $vm 1784 govc device.pci.remove -vm $vm $pci_address 1785 govc device.info -vm $vm 1786 1787 Assuming vm name is helloworld, device info command has below output 1788 1789 $ govc device.info -vm helloworld 1790 ... 1791 Name: pcipassthrough-13000 1792 Type: VirtualPCIPassthrough 1793 Label: PCI device 0 1794 Summary: 1795 Key: 13000 1796 Controller: pci-100 1797 Unit number: 18 1798 Name: pcipassthrough-13001 1799 Type: VirtualPCIPassthrough 1800 Label: PCI device 1 1801 Summary: 1802 Key: 13001 1803 Controller: pci-100 1804 Unit number: 19 1805 1806 To remove only 'pcipassthrough-13000', command should be as below. No output upon success. 1807 1808 $ govc device.pci.remove -vm helloworld pcipassthrough-13000 1809 1810 To remove both 'pcipassthrough-13000' and 'pcipassthrough-13001', command should be as below. 1811 No output upon success. 1812 1813 $ govc device.pci.remove -vm helloworld pcipassthrough-13000 pcipassthrough-13001 1814 1815 Options: 1816 -vm= Virtual machine [GOVC_VM] 1817 ``` 1818 1819 ## device.remove 1820 1821 ``` 1822 Usage: govc device.remove [OPTIONS] DEVICE... 1823 1824 Remove DEVICE from VM. 1825 1826 Examples: 1827 govc device.remove -vm $name cdrom-3000 1828 govc device.remove -vm $name disk-1000 1829 govc device.remove -vm $name -keep disk-* 1830 1831 Options: 1832 -keep=false Keep files in datastore 1833 -vm= Virtual machine [GOVC_VM] 1834 ``` 1835 1836 ## device.scsi.add 1837 1838 ``` 1839 Usage: govc device.scsi.add [OPTIONS] 1840 1841 Add SCSI controller to VM. 1842 1843 Examples: 1844 govc device.scsi.add -vm $vm 1845 govc device.scsi.add -vm $vm -type pvscsi 1846 govc device.info -vm $vm {lsi,pv}* 1847 1848 Options: 1849 -hot=false Enable hot-add/remove 1850 -sharing=noSharing SCSI sharing 1851 -type=lsilogic SCSI controller type (lsilogic|buslogic|pvscsi|lsilogic-sas) 1852 -vm= Virtual machine [GOVC_VM] 1853 ``` 1854 1855 ## device.serial.add 1856 1857 ``` 1858 Usage: govc device.serial.add [OPTIONS] 1859 1860 Add serial port to VM. 1861 1862 Examples: 1863 govc device.serial.add -vm $vm 1864 govc device.info -vm $vm serialport-* 1865 1866 Options: 1867 -vm= Virtual machine [GOVC_VM] 1868 ``` 1869 1870 ## device.serial.connect 1871 1872 ``` 1873 Usage: govc device.serial.connect [OPTIONS] URI 1874 1875 Connect service URI to serial port. 1876 1877 If "-" is given as URI, connects file backed device with file name of 1878 device name + .log suffix in the VM Config.Files.LogDirectory. 1879 1880 Defaults to the first serial port if no DEVICE is given. 1881 1882 Examples: 1883 govc device.ls | grep serialport- 1884 govc device.serial.connect -vm $vm -device serialport-8000 telnet://:33233 1885 govc device.info -vm $vm serialport-* 1886 govc device.serial.connect -vm $vm "[datastore1] $vm/console.log" 1887 govc device.serial.connect -vm $vm - 1888 govc datastore.tail -f $vm/serialport-8000.log 1889 1890 Options: 1891 -client=false Use client direction 1892 -device= serial port device name 1893 -vm= Virtual machine [GOVC_VM] 1894 -vspc-proxy= vSPC proxy URI 1895 ``` 1896 1897 ## device.serial.disconnect 1898 1899 ``` 1900 Usage: govc device.serial.disconnect [OPTIONS] 1901 1902 Disconnect service URI from serial port. 1903 1904 Examples: 1905 govc device.ls | grep serialport- 1906 govc device.serial.disconnect -vm $vm -device serialport-8000 1907 govc device.info -vm $vm serialport-* 1908 1909 Options: 1910 -device= serial port device name 1911 -vm= Virtual machine [GOVC_VM] 1912 ``` 1913 1914 ## device.usb.add 1915 1916 ``` 1917 Usage: govc device.usb.add [OPTIONS] 1918 1919 Add USB device to VM. 1920 1921 Examples: 1922 govc device.usb.add -vm $vm 1923 govc device.usb.add -type xhci -vm $vm 1924 govc device.info usb* 1925 1926 Options: 1927 -auto=true Enable ability to hot plug devices 1928 -ehci=true Enable enhanced host controller interface (USB 2.0) 1929 -type=usb USB controller type (usb|xhci) 1930 -vm= Virtual machine [GOVC_VM] 1931 ``` 1932 1933 ## disk.create 1934 1935 ``` 1936 Usage: govc disk.create [OPTIONS] NAME 1937 1938 Create disk NAME on DS. 1939 1940 Examples: 1941 govc disk.create -size 24G my-disk 1942 1943 Options: 1944 -datastore-cluster= Datastore cluster [GOVC_DATASTORE_CLUSTER] 1945 -ds= Datastore [GOVC_DATASTORE] 1946 -keep=<nil> Keep disk after VM is deleted 1947 -pool= Resource pool [GOVC_RESOURCE_POOL] 1948 -size=10.0GB Size of new disk 1949 ``` 1950 1951 ## disk.ls 1952 1953 ``` 1954 Usage: govc disk.ls [OPTIONS] [ID]... 1955 1956 List disk IDs on DS. 1957 1958 Examples: 1959 govc disk.ls 1960 govc disk.ls -l -T 1961 govc disk.ls -l e9b06a8b-d047-4d3c-b15b-43ea9608b1a6 1962 govc disk.ls -c k8s-region -t us-west-2 1963 1964 Options: 1965 -L=false Print disk backing path instead of disk name 1966 -R=false Reconcile the datastore inventory info 1967 -T=false List attached tags 1968 -c= Query tag category 1969 -ds= Datastore [GOVC_DATASTORE] 1970 -l=false Long listing format 1971 -t= Query tag name 1972 ``` 1973 1974 ## disk.register 1975 1976 ``` 1977 Usage: govc disk.register [OPTIONS] PATH [NAME] 1978 1979 Register existing disk on DS. 1980 1981 Examples: 1982 govc disk.register disks/disk1.vmdk my-disk 1983 1984 Options: 1985 -ds= Datastore [GOVC_DATASTORE] 1986 ``` 1987 1988 ## disk.rm 1989 1990 ``` 1991 Usage: govc disk.rm [OPTIONS] ID 1992 1993 Remove disk ID on DS. 1994 1995 Examples: 1996 govc disk.rm ID 1997 1998 Options: 1999 -ds= Datastore [GOVC_DATASTORE] 2000 ``` 2001 2002 ## disk.snapshot.create 2003 2004 ``` 2005 Usage: govc disk.snapshot.create [OPTIONS] ID DESC 2006 2007 Create snapshot of ID on DS. 2008 2009 Examples: 2010 govc disk.snapshot.create b9fe5f17-3b87-4a03-9739-09a82ddcc6b0 my-disk-snapshot 2011 2012 Options: 2013 -ds= Datastore [GOVC_DATASTORE] 2014 ``` 2015 2016 ## disk.snapshot.ls 2017 2018 ``` 2019 Usage: govc disk.snapshot.ls [OPTIONS] ID 2020 2021 List snapshots for disk ID on DS. 2022 2023 Examples: 2024 govc snapshot.disk.ls -l 9b06a8b-d047-4d3c-b15b-43ea9608b1a6 2025 2026 Options: 2027 -ds= Datastore [GOVC_DATASTORE] 2028 -l=false Long listing format 2029 ``` 2030 2031 ## disk.snapshot.rm 2032 2033 ``` 2034 Usage: govc disk.snapshot.rm [OPTIONS] ID SID 2035 2036 Remove disk ID snapshot ID on DS. 2037 2038 Examples: 2039 govc disk.snapshot.rm ffe6a398-eb8e-4eaa-9118-e1f16b8b8e3c ecbca542-0a25-4127-a585-82e4047750d6 2040 2041 Options: 2042 -ds= Datastore [GOVC_DATASTORE] 2043 ``` 2044 2045 ## disk.tags.attach 2046 2047 ``` 2048 Usage: govc disk.tags.attach [OPTIONS] NAME ID 2049 2050 Attach tag NAME to disk ID. 2051 2052 Examples: 2053 govc disk.tags.attach -c k8s-region k8s-region-us $id 2054 2055 Options: 2056 -c= Tag category 2057 ``` 2058 2059 ## disk.tags.detach 2060 2061 ``` 2062 Usage: govc disk.tags.detach [OPTIONS] NAME ID 2063 2064 Detach tag NAME from disk ID. 2065 2066 Examples: 2067 govc disk.tags.detach -c k8s-region k8s-region-us $id 2068 2069 Options: 2070 -c= Tag category 2071 ``` 2072 2073 ## dvs.add 2074 2075 ``` 2076 Usage: govc dvs.add [OPTIONS] HOST... 2077 2078 Add hosts to DVS. 2079 2080 Examples: 2081 govc dvs.add -dvs dvsName -pnic vmnic1 hostA hostB hostC 2082 2083 Options: 2084 -dvs= DVS path 2085 -host= Host system [GOVC_HOST] 2086 -pnic=vmnic0 Name of the host physical NIC 2087 ``` 2088 2089 ## dvs.change 2090 2091 ``` 2092 Usage: govc dvs.change [OPTIONS] DVS 2093 2094 Change DVS (DistributedVirtualSwitch) in datacenter. 2095 2096 Examples: 2097 govc dvs.change -product-version 5.5.0 DSwitch 2098 govc dvs.change -mtu 9000 DSwitch 2099 govc dvs.change -discovery-protocol [lldp|cdp] DSwitch 2100 2101 Options: 2102 -discovery-protocol= Link Discovery Protocol 2103 -mtu=0 DVS Max MTU 2104 -product-version= DVS product version 2105 ``` 2106 2107 ## dvs.create 2108 2109 ``` 2110 Usage: govc dvs.create [OPTIONS] DVS 2111 2112 Create DVS (DistributedVirtualSwitch) in datacenter. 2113 2114 The dvs is added to the folder specified by the 'folder' flag. If not given, 2115 this defaults to the network folder in the specified or default datacenter. 2116 2117 Examples: 2118 govc dvs.create DSwitch 2119 govc dvs.create -product-version 5.5.0 DSwitch 2120 govc dvs.create -mtu 9000 DSwitch 2121 govc dvs.create -discovery-protocol [lldp|cdp] DSwitch 2122 2123 Options: 2124 -discovery-protocol= Link Discovery Protocol 2125 -folder= Inventory folder [GOVC_FOLDER] 2126 -mtu=0 DVS Max MTU 2127 -num-uplinks=0 Number of Uplinks 2128 -product-version= DVS product version 2129 ``` 2130 2131 ## dvs.portgroup.add 2132 2133 ``` 2134 Usage: govc dvs.portgroup.add [OPTIONS] NAME 2135 2136 Add portgroup to DVS. 2137 2138 The '-type' options are defined by the dvs.DistributedVirtualPortgroup.PortgroupType API. 2139 The UI labels '-type' as "Port binding" with the following choices: 2140 "Static binding": earlyBinding 2141 "Dynanic binding": lateBinding 2142 "No binding": ephemeral 2143 2144 The '-auto-expand' option is labeled in the UI as "Port allocation". 2145 The default value is false, behaves as the UI labeled "Fixed" choice. 2146 When given '-auto-expand=true', behaves as the UI labeled "Elastic" choice. 2147 2148 Examples: 2149 govc dvs.create DSwitch 2150 govc dvs.portgroup.add -dvs DSwitch -type earlyBinding -nports 16 ExternalNetwork 2151 govc dvs.portgroup.add -dvs DSwitch -type ephemeral InternalNetwork 2152 govc object.destroy network/InternalNetwork # remove the portgroup 2153 2154 Options: 2155 -auto-expand=<nil> Ignore the limit on the number of ports 2156 -dvs= DVS path 2157 -nports=128 Number of ports 2158 -type=earlyBinding Portgroup type (earlyBinding|lateBinding|ephemeral) 2159 -vlan=0 VLAN ID 2160 -vlan-mode=vlan vlan mode (vlan|trunking) 2161 -vlan-range=0-4094 VLAN Ranges with comma delimited 2162 ``` 2163 2164 ## dvs.portgroup.change 2165 2166 ``` 2167 Usage: govc dvs.portgroup.change [OPTIONS] PATH 2168 2169 Change DVS portgroup configuration. 2170 2171 Examples: 2172 govc dvs.portgroup.change -nports 26 ExternalNetwork 2173 govc dvs.portgroup.change -vlan 3214 ExternalNetwork 2174 2175 Options: 2176 -auto-expand=<nil> Ignore the limit on the number of ports 2177 -nports=0 Number of ports 2178 -type=earlyBinding Portgroup type (earlyBinding|lateBinding|ephemeral) 2179 -vlan=0 VLAN ID 2180 -vlan-mode=vlan vlan mode (vlan|trunking) 2181 -vlan-range=0-4094 VLAN Ranges with comma delimited 2182 ``` 2183 2184 ## dvs.portgroup.info 2185 2186 ``` 2187 Usage: govc dvs.portgroup.info [OPTIONS] DVS 2188 2189 Portgroup info for DVS. 2190 2191 Examples: 2192 govc dvs.portgroup.info DSwitch 2193 govc dvs.portgroup.info -pg InternalNetwork DSwitch 2194 govc find / -type DistributedVirtualSwitch | xargs -n1 govc dvs.portgroup.info 2195 2196 Options: 2197 -active=false Filter by port active or inactive status 2198 -connected=false Filter by port connected or disconnected status 2199 -count=0 Number of matches to return (0 = unlimited) 2200 -inside=true Filter by port inside or outside status 2201 -pg= Distributed Virtual Portgroup 2202 -r=false Show DVS rules 2203 -uplinkPort=false Filter for uplink ports 2204 -vlan=0 Filter by VLAN ID (0 = unfiltered) 2205 ``` 2206 2207 ## env 2208 2209 ``` 2210 Usage: govc env [OPTIONS] 2211 2212 Output the environment variables for this client. 2213 2214 If credentials are included in the url, they are split into separate variables. 2215 Useful as bash scripting helper to parse GOVC_URL. 2216 2217 Options: 2218 -x=false Output variables for each GOVC_URL component 2219 ``` 2220 2221 ## events 2222 2223 ``` 2224 Usage: govc events [OPTIONS] [PATH]... 2225 2226 Display events. 2227 2228 Examples: 2229 govc events vm/my-vm1 vm/my-vm2 2230 govc events /dc1/vm/* /dc2/vm/* 2231 govc events -type VmPoweredOffEvent -type VmPoweredOnEvent 2232 govc ls -t HostSystem host/* | xargs govc events | grep -i vsan 2233 2234 Options: 2235 -f=false Follow event stream 2236 -force=false Disable number objects to monitor limit 2237 -l=false Long listing format 2238 -n=25 Output the last N events 2239 -type=[] Include only the specified event types 2240 ``` 2241 2242 ## export.ovf 2243 2244 ``` 2245 Usage: govc export.ovf [OPTIONS] DIR 2246 2247 Export VM. 2248 2249 Examples: 2250 govc export.ovf -vm $vm DIR 2251 2252 Options: 2253 -f=false Overwrite existing 2254 -i=false Include image files (*.{iso,img}) 2255 -name= Specifies target name (defaults to source name) 2256 -prefix=true Prepend target name to image filenames if missing 2257 -sha=0 Generate manifest using SHA 1, 256, 512 or 0 to skip 2258 -snapshot= Specifies a snapshot to export from (supports running VMs) 2259 -vm= Virtual machine [GOVC_VM] 2260 ``` 2261 2262 ## extension.info 2263 2264 ``` 2265 Usage: govc extension.info [OPTIONS] [KEY]... 2266 2267 Options: 2268 ``` 2269 2270 ## extension.register 2271 2272 ``` 2273 Usage: govc extension.register [OPTIONS] 2274 2275 Options: 2276 -update=false Update extension 2277 ``` 2278 2279 ## extension.setcert 2280 2281 ``` 2282 Usage: govc extension.setcert [OPTIONS] ID 2283 2284 Set certificate for the extension ID. 2285 2286 The '-cert-pem' option can be one of the following: 2287 '-' : Read the certificate from stdin 2288 '+' : Generate a new key pair and save locally to ID.crt and ID.key 2289 ... : Any other value is passed as-is to ExtensionManager.SetCertificate 2290 2291 Examples: 2292 govc extension.setcert -cert-pem + -org Example com.example.extname 2293 2294 Options: 2295 -cert-pem=- PEM encoded certificate 2296 -org=VMware Organization for generated certificate 2297 ``` 2298 2299 ## extension.unregister 2300 2301 ``` 2302 Usage: govc extension.unregister [OPTIONS] 2303 2304 Options: 2305 ``` 2306 2307 ## fields.add 2308 2309 ``` 2310 Usage: govc fields.add [OPTIONS] NAME 2311 2312 Add a custom field type with NAME. 2313 2314 Examples: 2315 govc fields.add my-field-name # adds a field to all managed object types 2316 govc fields.add -type VirtualMachine my-vm-field-name # adds a field to the VirtualMachine type 2317 2318 Options: 2319 -type= Managed object type 2320 ``` 2321 2322 ## fields.info 2323 2324 ``` 2325 Usage: govc fields.info [OPTIONS] PATH... 2326 2327 Display custom field values for PATH. 2328 2329 Also known as "Custom Attributes". 2330 2331 Examples: 2332 govc fields.info vm/* 2333 govc fields.info -n my-field-name vm/* 2334 2335 Options: 2336 -n= Filter by custom field name 2337 ``` 2338 2339 ## fields.ls 2340 2341 ``` 2342 Usage: govc fields.ls [OPTIONS] 2343 2344 List custom field definitions. 2345 2346 Examples: 2347 govc fields.ls 2348 govc fields.ls -type VirtualMachine 2349 2350 Options: 2351 -type= Filter by a Managed Object Type 2352 ``` 2353 2354 ## fields.rename 2355 2356 ``` 2357 Usage: govc fields.rename [OPTIONS] KEY NAME 2358 2359 Options: 2360 ``` 2361 2362 ## fields.rm 2363 2364 ``` 2365 Usage: govc fields.rm [OPTIONS] KEY... 2366 2367 Options: 2368 ``` 2369 2370 ## fields.set 2371 2372 ``` 2373 Usage: govc fields.set [OPTIONS] KEY VALUE PATH... 2374 2375 Set custom field values for PATH. 2376 2377 Examples: 2378 govc fields.set my-field-name field-value vm/my-vm 2379 govc fields.set -add my-new-global-field-name field-value vm/my-vm 2380 govc fields.set -add -type VirtualMachine my-new-vm-field-name field-value vm/my-vm 2381 2382 Options: 2383 -add=false Adds the field if it does not exist. Use the -type flag to specify the managed object type to which the field is added. Using -add and omitting -kind causes a new, global field to be created if a field with the provided name does not already exist. 2384 -type= Managed object type on which to add the field if it does not exist. This flag is ignored unless -add=true 2385 ``` 2386 2387 ## find 2388 2389 ``` 2390 Usage: govc find [OPTIONS] [ROOT] [KEY VAL]... 2391 2392 Find managed objects. 2393 2394 ROOT can be an inventory path or ManagedObjectReference. 2395 ROOT defaults to '.', an alias for the root folder or DC if set. 2396 2397 Optional KEY VAL pairs can be used to filter results against object instance properties. 2398 Use the govc 'object.collect' command to view possible object property keys. 2399 2400 The '-type' flag value can be a managed entity type or one of the following aliases: 2401 2402 a VirtualApp 2403 c ClusterComputeResource 2404 d Datacenter 2405 f Folder 2406 g DistributedVirtualPortgroup 2407 h HostSystem 2408 m VirtualMachine 2409 n Network 2410 o OpaqueNetwork 2411 p ResourcePool 2412 r ComputeResource 2413 s Datastore 2414 w DistributedVirtualSwitch 2415 2416 Examples: 2417 govc find 2418 govc find -l / # include object type in output 2419 govc find /dc1 -type c 2420 govc find vm -name my-vm-* 2421 govc find . -type n 2422 govc find -p /folder-a/dc-1/host/folder-b/cluster-a -type Datacenter # prints /folder-a/dc-1 2423 govc find . -type m -runtime.powerState poweredOn 2424 govc find . -type m -datastore $(govc find -i datastore -name vsanDatastore) 2425 govc find . -type s -summary.type vsan 2426 govc find . -type s -customValue *:prod # Key:Value 2427 govc find . -type h -hardware.cpuInfo.numCpuCores 16 2428 2429 Options: 2430 -i=false Print the managed object reference 2431 -l=false Long listing format 2432 -maxdepth=-1 Max depth 2433 -name=* Resource name 2434 -p=false Find parent objects 2435 -type=[] Resource type 2436 ``` 2437 2438 ## firewall.ruleset.find 2439 2440 ``` 2441 Usage: govc firewall.ruleset.find [OPTIONS] 2442 2443 Find firewall rulesets matching the given rule. 2444 2445 For a complete list of rulesets: govc host.esxcli network firewall ruleset list 2446 For a complete list of rules: govc host.esxcli network firewall ruleset rule list 2447 2448 Examples: 2449 govc firewall.ruleset.find -direction inbound -port 22 2450 govc firewall.ruleset.find -direction outbound -port 2377 2451 2452 Options: 2453 -c=true Check if esx firewall is enabled 2454 -direction=outbound Direction 2455 -enabled=true Find enabled rule sets if true, disabled if false 2456 -host= Host system [GOVC_HOST] 2457 -port=0 Port 2458 -proto=tcp Protocol 2459 -type=dst Port type 2460 ``` 2461 2462 ## folder.create 2463 2464 ``` 2465 Usage: govc folder.create [OPTIONS] PATH... 2466 2467 Create folder with PATH. 2468 2469 Examples: 2470 govc folder.create /dc1/vm/folder-foo 2471 govc object.mv /dc1/vm/vm-foo-* /dc1/vm/folder-foo 2472 govc folder.create -pod /dc1/datastore/sdrs 2473 govc object.mv /dc1/datastore/iscsi-* /dc1/datastore/sdrs 2474 2475 Options: 2476 -pod=false Create folder(s) of type StoragePod (DatastoreCluster) 2477 ``` 2478 2479 ## folder.info 2480 2481 ``` 2482 Usage: govc folder.info [OPTIONS] [PATH]... 2483 2484 Options: 2485 ``` 2486 2487 ## guest.chmod 2488 2489 ``` 2490 Usage: govc guest.chmod [OPTIONS] MODE FILE 2491 2492 Change FILE MODE on VM. 2493 2494 Examples: 2495 govc guest.chmod -vm $name 0644 /var/log/foo.log 2496 2497 Options: 2498 -l=: Guest VM credentials (<user>:<password>) [GOVC_GUEST_LOGIN] 2499 -vm= Virtual machine [GOVC_VM] 2500 ``` 2501 2502 ## guest.chown 2503 2504 ``` 2505 Usage: govc guest.chown [OPTIONS] UID[:GID] FILE 2506 2507 Change FILE UID and GID on VM. 2508 2509 Examples: 2510 govc guest.chown -vm $name UID[:GID] /var/log/foo.log 2511 2512 Options: 2513 -l=: Guest VM credentials (<user>:<password>) [GOVC_GUEST_LOGIN] 2514 -vm= Virtual machine [GOVC_VM] 2515 ``` 2516 2517 ## guest.df 2518 2519 ``` 2520 Usage: govc guest.df [OPTIONS] 2521 2522 Report file system disk space usage. 2523 2524 Examples: 2525 govc guest.df -vm $name 2526 2527 Options: 2528 -vm= Virtual machine [GOVC_VM] 2529 ``` 2530 2531 ## guest.download 2532 2533 ``` 2534 Usage: govc guest.download [OPTIONS] SOURCE DEST 2535 2536 Copy SOURCE from the guest VM to DEST on the local system. 2537 2538 If DEST name is "-", source is written to stdout. 2539 2540 Examples: 2541 govc guest.download -l user:pass -vm=my-vm /var/log/my.log ./local.log 2542 govc guest.download -l user:pass -vm=my-vm /etc/motd - 2543 tar -cf- foo/ | govc guest.run -d - tar -C /tmp -xf- 2544 govc guest.run tar -C /tmp -cf- foo/ | tar -C /tmp -xf- # download directory 2545 2546 Options: 2547 -f=false If set, the local destination file is clobbered 2548 -l=: Guest VM credentials (<user>:<password>) [GOVC_GUEST_LOGIN] 2549 -vm= Virtual machine [GOVC_VM] 2550 ``` 2551 2552 ## guest.getenv 2553 2554 ``` 2555 Usage: govc guest.getenv [OPTIONS] [NAME]... 2556 2557 Read NAME environment variables from VM. 2558 2559 Examples: 2560 govc guest.getenv -vm $name 2561 govc guest.getenv -vm $name HOME 2562 2563 Options: 2564 -i=false Interactive session 2565 -l=: Guest VM credentials (<user>:<password>) [GOVC_GUEST_LOGIN] 2566 -vm= Virtual machine [GOVC_VM] 2567 ``` 2568 2569 ## guest.kill 2570 2571 ``` 2572 Usage: govc guest.kill [OPTIONS] 2573 2574 Kill process ID on VM. 2575 2576 Examples: 2577 govc guest.kill -vm $name -p 12345 2578 2579 Options: 2580 -i=false Interactive session 2581 -l=: Guest VM credentials (<user>:<password>) [GOVC_GUEST_LOGIN] 2582 -p=[] Process ID 2583 -vm= Virtual machine [GOVC_VM] 2584 ``` 2585 2586 ## guest.ls 2587 2588 ``` 2589 Usage: govc guest.ls [OPTIONS] PATH 2590 2591 List PATH files in VM. 2592 2593 Examples: 2594 govc guest.ls -vm $name /tmp 2595 2596 Options: 2597 -l=: Guest VM credentials (<user>:<password>) [GOVC_GUEST_LOGIN] 2598 -s=false Simple path only listing 2599 -vm= Virtual machine [GOVC_VM] 2600 ``` 2601 2602 ## guest.mkdir 2603 2604 ``` 2605 Usage: govc guest.mkdir [OPTIONS] PATH 2606 2607 Create directory PATH in VM. 2608 2609 Examples: 2610 govc guest.mkdir -vm $name /tmp/logs 2611 govc guest.mkdir -vm $name -p /tmp/logs/foo/bar 2612 2613 Options: 2614 -l=: Guest VM credentials (<user>:<password>) [GOVC_GUEST_LOGIN] 2615 -p=false Create intermediate directories as needed 2616 -vm= Virtual machine [GOVC_VM] 2617 ``` 2618 2619 ## guest.mktemp 2620 2621 ``` 2622 Usage: govc guest.mktemp [OPTIONS] 2623 2624 Create a temporary file or directory in VM. 2625 2626 Examples: 2627 govc guest.mktemp -vm $name 2628 govc guest.mktemp -vm $name -d 2629 govc guest.mktemp -vm $name -t myprefix 2630 govc guest.mktemp -vm $name -p /var/tmp/$USER 2631 2632 Options: 2633 -d=false Make a directory instead of a file 2634 -l=: Guest VM credentials (<user>:<password>) [GOVC_GUEST_LOGIN] 2635 -p= If specified, create relative to this directory 2636 -s= Suffix 2637 -t= Prefix 2638 -vm= Virtual machine [GOVC_VM] 2639 ``` 2640 2641 ## guest.mv 2642 2643 ``` 2644 Usage: govc guest.mv [OPTIONS] SOURCE DEST 2645 2646 Move (rename) files in VM. 2647 2648 Examples: 2649 govc guest.mv -vm $name /tmp/foo.sh /tmp/bar.sh 2650 govc guest.mv -vm $name -n /tmp/baz.sh /tmp/bar.sh 2651 2652 Options: 2653 -l=: Guest VM credentials (<user>:<password>) [GOVC_GUEST_LOGIN] 2654 -n=false Do not overwrite an existing file 2655 -vm= Virtual machine [GOVC_VM] 2656 ``` 2657 2658 ## guest.ps 2659 2660 ``` 2661 Usage: govc guest.ps [OPTIONS] 2662 2663 List processes in VM. 2664 2665 By default, unless the '-e', '-p' or '-U' flag is specified, only processes owned 2666 by the '-l' flag user are displayed. 2667 2668 The '-x' and '-X' flags only apply to processes started by vmware-tools, 2669 such as those started with the govc guest.start command. 2670 2671 Examples: 2672 govc guest.ps -vm $name 2673 govc guest.ps -vm $name -e 2674 govc guest.ps -vm $name -p 12345 2675 govc guest.ps -vm $name -U root 2676 2677 Options: 2678 -U= Select by process UID 2679 -X=false Wait for process to exit 2680 -e=false Select all processes 2681 -i=false Interactive session 2682 -l=: Guest VM credentials (<user>:<password>) [GOVC_GUEST_LOGIN] 2683 -p=[] Select by process ID 2684 -vm= Virtual machine [GOVC_VM] 2685 -x=false Output exit time and code 2686 ``` 2687 2688 ## guest.rm 2689 2690 ``` 2691 Usage: govc guest.rm [OPTIONS] PATH 2692 2693 Remove file PATH in VM. 2694 2695 Examples: 2696 govc guest.rm -vm $name /tmp/foo.log 2697 2698 Options: 2699 -l=: Guest VM credentials (<user>:<password>) [GOVC_GUEST_LOGIN] 2700 -vm= Virtual machine [GOVC_VM] 2701 ``` 2702 2703 ## guest.rmdir 2704 2705 ``` 2706 Usage: govc guest.rmdir [OPTIONS] PATH 2707 2708 Remove directory PATH in VM. 2709 2710 Examples: 2711 govc guest.rmdir -vm $name /tmp/empty-dir 2712 govc guest.rmdir -vm $name -r /tmp/non-empty-dir 2713 2714 Options: 2715 -l=: Guest VM credentials (<user>:<password>) [GOVC_GUEST_LOGIN] 2716 -r=false Recursive removal 2717 -vm= Virtual machine [GOVC_VM] 2718 ``` 2719 2720 ## guest.run 2721 2722 ``` 2723 Usage: govc guest.run [OPTIONS] PATH [ARG]... 2724 2725 Run program PATH in VM and display output. 2726 2727 The guest.run command starts a program in the VM with i/o redirected, waits for the process to exit and 2728 propagates the exit code to the govc process exit code. Note that stdout and stderr are redirected by default, 2729 stdin is only redirected when the '-d' flag is specified. 2730 2731 Note that vmware-tools requires program PATH to be absolute. 2732 If PATH is not absolute and vm guest family is Windows, 2733 guest.run changes the command to: 'c:\\Windows\\System32\\cmd.exe /c "PATH [ARG]..."' 2734 Otherwise the command is changed to: '/bin/bash -c "PATH [ARG]..."' 2735 2736 Examples: 2737 govc guest.run -vm $name ifconfig 2738 govc guest.run -vm $name ifconfig eth0 2739 cal | govc guest.run -vm $name -d - cat 2740 govc guest.run -vm $name -d "hello $USER" cat 2741 govc guest.run -vm $name curl -s :invalid: || echo $? # exit code 6 2742 govc guest.run -vm $name -e FOO=bar -e BIZ=baz -C /tmp env 2743 govc guest.run -vm $name -l root:mypassword ntpdate -u pool.ntp.org 2744 govc guest.run -vm $name powershell C:\\network_refresh.ps1 2745 2746 Options: 2747 -C= The absolute path of the working directory for the program to start 2748 -d= Input data string. A value of '-' reads from OS stdin 2749 -e=[] Set environment variables 2750 -i=false Interactive session 2751 -l=: Guest VM credentials (<user>:<password>) [GOVC_GUEST_LOGIN] 2752 -vm= Virtual machine [GOVC_VM] 2753 ``` 2754 2755 ## guest.start 2756 2757 ``` 2758 Usage: govc guest.start [OPTIONS] PATH [ARG]... 2759 2760 Start program in VM. 2761 2762 The process can have its status queried with govc guest.ps. 2763 When the process completes, its exit code and end time will be available for 5 minutes after completion. 2764 2765 Examples: 2766 govc guest.start -vm $name /bin/mount /dev/hdb1 /data 2767 pid=$(govc guest.start -vm $name /bin/long-running-thing) 2768 govc guest.ps -vm $name -p $pid -X 2769 2770 Options: 2771 -C= The absolute path of the working directory for the program to start 2772 -e=[] Set environment variable (key=val) 2773 -i=false Interactive session 2774 -l=: Guest VM credentials (<user>:<password>) [GOVC_GUEST_LOGIN] 2775 -vm= Virtual machine [GOVC_VM] 2776 ``` 2777 2778 ## guest.touch 2779 2780 ``` 2781 Usage: govc guest.touch [OPTIONS] FILE 2782 2783 Change FILE times on VM. 2784 2785 Examples: 2786 govc guest.touch -vm $name /var/log/foo.log 2787 govc guest.touch -vm $name -d "$(date -d '1 day ago')" /var/log/foo.log 2788 2789 Options: 2790 -a=false Change only the access time 2791 -c=false Do not create any files 2792 -d= Use DATE instead of current time 2793 -l=: Guest VM credentials (<user>:<password>) [GOVC_GUEST_LOGIN] 2794 -vm= Virtual machine [GOVC_VM] 2795 ``` 2796 2797 ## guest.upload 2798 2799 ``` 2800 Usage: govc guest.upload [OPTIONS] SOURCE DEST 2801 2802 Copy SOURCE from the local system to DEST in the guest VM. 2803 2804 If SOURCE name is "-", read source from stdin. 2805 2806 Examples: 2807 govc guest.upload -l user:pass -vm=my-vm ~/.ssh/id_rsa.pub /home/$USER/.ssh/authorized_keys 2808 cowsay "have a great day" | govc guest.upload -l user:pass -vm=my-vm - /etc/motd 2809 tar -cf- foo/ | govc guest.run -d - tar -C /tmp -xf- # upload a directory 2810 2811 Options: 2812 -f=false If set, the guest destination file is clobbered 2813 -gid=<nil> Group ID 2814 -l=: Guest VM credentials (<user>:<password>) [GOVC_GUEST_LOGIN] 2815 -perm=0 File permissions 2816 -uid=<nil> User ID 2817 -vm= Virtual machine [GOVC_VM] 2818 ``` 2819 2820 ## host.account.create 2821 2822 ``` 2823 Usage: govc host.account.create [OPTIONS] 2824 2825 Create local account on HOST. 2826 2827 Examples: 2828 govc host.account.create -id $USER -password password-for-esx60 2829 2830 Options: 2831 -description= The description of the specified account 2832 -host= Host system [GOVC_HOST] 2833 -id= The ID of the specified account 2834 -password= The password for the specified account id 2835 ``` 2836 2837 ## host.account.remove 2838 2839 ``` 2840 Usage: govc host.account.remove [OPTIONS] 2841 2842 Remove local account on HOST. 2843 2844 Examples: 2845 govc host.account.remove -id $USER 2846 2847 Options: 2848 -description= The description of the specified account 2849 -host= Host system [GOVC_HOST] 2850 -id= The ID of the specified account 2851 -password= The password for the specified account id 2852 ``` 2853 2854 ## host.account.update 2855 2856 ``` 2857 Usage: govc host.account.update [OPTIONS] 2858 2859 Update local account on HOST. 2860 2861 Examples: 2862 govc host.account.update -id root -password password-for-esx60 2863 2864 Options: 2865 -description= The description of the specified account 2866 -host= Host system [GOVC_HOST] 2867 -id= The ID of the specified account 2868 -password= The password for the specified account id 2869 ``` 2870 2871 ## host.add 2872 2873 ``` 2874 Usage: govc host.add [OPTIONS] 2875 2876 Add host to datacenter. 2877 2878 The host is added to the folder specified by the 'folder' flag. If not given, 2879 this defaults to the host folder in the specified or default datacenter. 2880 2881 Examples: 2882 thumbprint=$(govc about.cert -k -u host.example.com -thumbprint | awk '{print $2}') 2883 govc host.add -hostname host.example.com -username root -password pass -thumbprint $thumbprint 2884 govc host.add -hostname 10.0.6.1 -username root -password pass -noverify 2885 2886 Options: 2887 -connect=true Immediately connect to host 2888 -folder= Inventory folder [GOVC_FOLDER] 2889 -force=false Force when host is managed by another VC 2890 -hostname= Hostname or IP address of the host 2891 -noverify=false Accept host thumbprint without verification 2892 -password= Password of administration account on the host 2893 -thumbprint= SHA-1 thumbprint of the host's SSL certificate 2894 -username= Username of administration account on the host 2895 ``` 2896 2897 ## host.autostart.add 2898 2899 ``` 2900 Usage: govc host.autostart.add [OPTIONS] VM... 2901 2902 Options: 2903 -host= Host system [GOVC_HOST] 2904 -start-action=powerOn Start Action 2905 -start-delay=-1 Start Delay 2906 -start-order=-1 Start Order 2907 -stop-action=systemDefault Stop Action 2908 -stop-delay=-1 Stop Delay 2909 -wait=systemDefault Wait for Hearbeat Setting (systemDefault|yes|no) 2910 ``` 2911 2912 ## host.autostart.configure 2913 2914 ``` 2915 Usage: govc host.autostart.configure [OPTIONS] 2916 2917 Options: 2918 -enabled=<nil> Enable autostart 2919 -host= Host system [GOVC_HOST] 2920 -start-delay=0 Start delay 2921 -stop-action= Stop action 2922 -stop-delay=0 Stop delay 2923 -wait-for-heartbeat=<nil> Wait for hearbeat 2924 ``` 2925 2926 ## host.autostart.info 2927 2928 ``` 2929 Usage: govc host.autostart.info [OPTIONS] 2930 2931 Options: 2932 -host= Host system [GOVC_HOST] 2933 ``` 2934 2935 ## host.autostart.remove 2936 2937 ``` 2938 Usage: govc host.autostart.remove [OPTIONS] VM... 2939 2940 Options: 2941 -host= Host system [GOVC_HOST] 2942 ``` 2943 2944 ## host.cert.csr 2945 2946 ``` 2947 Usage: govc host.cert.csr [OPTIONS] 2948 2949 Generate a certificate-signing request (CSR) for HOST. 2950 2951 Options: 2952 -host= Host system [GOVC_HOST] 2953 -ip=false Use IP address as CN 2954 ``` 2955 2956 ## host.cert.import 2957 2958 ``` 2959 Usage: govc host.cert.import [OPTIONS] FILE 2960 2961 Install SSL certificate FILE on HOST. 2962 2963 If FILE name is "-", read certificate from stdin. 2964 2965 Options: 2966 -host= Host system [GOVC_HOST] 2967 ``` 2968 2969 ## host.cert.info 2970 2971 ``` 2972 Usage: govc host.cert.info [OPTIONS] 2973 2974 Display SSL certificate info for HOST. 2975 2976 Options: 2977 -host= Host system [GOVC_HOST] 2978 ``` 2979 2980 ## host.date.change 2981 2982 ``` 2983 Usage: govc host.date.change [OPTIONS] 2984 2985 Change date and time for HOST. 2986 2987 Examples: 2988 govc host.date.change -date "$(date -u)" 2989 govc host.date.change -server time.vmware.com 2990 govc host.service enable ntpd 2991 govc host.service start ntpd 2992 2993 Options: 2994 -date= Update the date/time on the host 2995 -host= Host system [GOVC_HOST] 2996 -server= IP or FQDN for NTP server(s) 2997 -tz= Change timezone of the host 2998 ``` 2999 3000 ## host.date.info 3001 3002 ``` 3003 Usage: govc host.date.info [OPTIONS] 3004 3005 Display date and time info for HOST. 3006 3007 Options: 3008 -host= Host system [GOVC_HOST] 3009 ``` 3010 3011 ## host.disconnect 3012 3013 ``` 3014 Usage: govc host.disconnect [OPTIONS] 3015 3016 Disconnect HOST from vCenter. 3017 3018 Options: 3019 -host= Host system [GOVC_HOST] 3020 ``` 3021 3022 ## host.esxcli 3023 3024 ``` 3025 Usage: govc host.esxcli [OPTIONS] COMMAND [ARG]... 3026 3027 Invoke esxcli command on HOST. 3028 3029 Output is rendered in table form when possible, unless disabled with '-hints=false'. 3030 3031 Examples: 3032 govc host.esxcli network ip connection list 3033 govc host.esxcli system settings advanced set -o /Net/GuestIPHack -i 1 3034 govc host.esxcli network firewall ruleset set -r remoteSerialPort -e true 3035 govc host.esxcli network firewall set -e false 3036 govc host.esxcli hardware platform get 3037 3038 Options: 3039 -hints=true Use command info hints when formatting output 3040 -host= Host system [GOVC_HOST] 3041 ``` 3042 3043 ## host.info 3044 3045 ``` 3046 Usage: govc host.info [OPTIONS] 3047 3048 Options: 3049 -host= Host system [GOVC_HOST] 3050 ``` 3051 3052 ## host.maintenance.enter 3053 3054 ``` 3055 Usage: govc host.maintenance.enter [OPTIONS] HOST... 3056 3057 Put HOST in maintenance mode. 3058 3059 While this task is running and when the host is in maintenance mode, 3060 no VMs can be powered on and no provisioning operations can be performed on the host. 3061 3062 Options: 3063 -evacuate=false Evacuate powered off VMs 3064 -host= Host system [GOVC_HOST] 3065 -timeout=0 Timeout 3066 ``` 3067 3068 ## host.maintenance.exit 3069 3070 ``` 3071 Usage: govc host.maintenance.exit [OPTIONS] HOST... 3072 3073 Take HOST out of maintenance mode. 3074 3075 This blocks if any concurrent running maintenance-only host configurations operations are being performed. 3076 For example, if VMFS volumes are being upgraded. 3077 3078 The 'timeout' flag is the number of seconds to wait for the exit maintenance mode to succeed. 3079 If the timeout is less than or equal to zero, there is no timeout. 3080 3081 Options: 3082 -host= Host system [GOVC_HOST] 3083 -timeout=0 Timeout 3084 ``` 3085 3086 ## host.option.ls 3087 3088 ``` 3089 Usage: govc host.option.ls [OPTIONS] [NAME] 3090 3091 List option with the given NAME. 3092 3093 If NAME ends with a dot, all options for that subtree are listed. 3094 3095 Examples: 3096 govc host.option.ls 3097 govc host.option.ls Config.HostAgent. 3098 govc host.option.ls Config.HostAgent.plugins.solo.enableMob 3099 3100 Options: 3101 -host= Host system [GOVC_HOST] 3102 ``` 3103 3104 ## host.option.set 3105 3106 ``` 3107 Usage: govc host.option.set [OPTIONS] NAME VALUE 3108 3109 Set option NAME to VALUE. 3110 3111 Examples: 3112 govc host.option.set Config.HostAgent.plugins.solo.enableMob true 3113 govc host.option.set Config.HostAgent.log.level verbose 3114 3115 Options: 3116 -host= Host system [GOVC_HOST] 3117 ``` 3118 3119 ## host.portgroup.add 3120 3121 ``` 3122 Usage: govc host.portgroup.add [OPTIONS] NAME 3123 3124 Add portgroup to HOST. 3125 3126 Examples: 3127 govc host.portgroup.add -vswitch vSwitch0 -vlan 3201 bridge 3128 3129 Options: 3130 -host= Host system [GOVC_HOST] 3131 -vlan=0 VLAN ID 3132 -vswitch= vSwitch Name 3133 ``` 3134 3135 ## host.portgroup.change 3136 3137 ``` 3138 Usage: govc host.portgroup.change [OPTIONS] NAME 3139 3140 Change configuration of HOST portgroup NAME. 3141 3142 Examples: 3143 govc host.portgroup.change -allow-promiscuous -forged-transmits -mac-changes "VM Network" 3144 govc host.portgroup.change -vswitch-name vSwitch1 "Management Network" 3145 3146 Options: 3147 -allow-promiscuous=<nil> Allow promiscuous mode 3148 -forged-transmits=<nil> Allow forged transmits 3149 -host= Host system [GOVC_HOST] 3150 -mac-changes=<nil> Allow MAC changes 3151 -name= Portgroup name 3152 -vlan-id=-1 VLAN ID 3153 -vswitch-name= vSwitch name 3154 ``` 3155 3156 ## host.portgroup.info 3157 3158 ``` 3159 Usage: govc host.portgroup.info [OPTIONS] 3160 3161 Options: 3162 -host= Host system [GOVC_HOST] 3163 ``` 3164 3165 ## host.portgroup.remove 3166 3167 ``` 3168 Usage: govc host.portgroup.remove [OPTIONS] NAME 3169 3170 Remove portgroup from HOST. 3171 3172 Examples: 3173 govc host.portgroup.remove bridge 3174 3175 Options: 3176 -host= Host system [GOVC_HOST] 3177 ``` 3178 3179 ## host.reconnect 3180 3181 ``` 3182 Usage: govc host.reconnect [OPTIONS] 3183 3184 Reconnect HOST to vCenter. 3185 3186 This command can also be used to change connection properties (hostname, fingerprint, username, password), 3187 without disconnecting the host. 3188 3189 Options: 3190 -force=false Force when host is managed by another VC 3191 -host= Host system [GOVC_HOST] 3192 -hostname= Hostname or IP address of the host 3193 -noverify=false Accept host thumbprint without verification 3194 -password= Password of administration account on the host 3195 -sync-state=false Sync state 3196 -thumbprint= SHA-1 thumbprint of the host's SSL certificate 3197 -username= Username of administration account on the host 3198 ``` 3199 3200 ## host.remove 3201 3202 ``` 3203 Usage: govc host.remove [OPTIONS] HOST... 3204 3205 Remove HOST from vCenter. 3206 3207 Options: 3208 -host= Host system [GOVC_HOST] 3209 ``` 3210 3211 ## host.service 3212 3213 ``` 3214 Usage: govc host.service [OPTIONS] ACTION ID 3215 3216 Apply host service ACTION to service ID. 3217 3218 Where ACTION is one of: start, stop, restart, status, enable, disable 3219 3220 Examples: 3221 govc host.service enable TSM-SSH 3222 govc host.service start TSM-SSH 3223 3224 Options: 3225 -host= Host system [GOVC_HOST] 3226 ``` 3227 3228 ## host.service.ls 3229 3230 ``` 3231 Usage: govc host.service.ls [OPTIONS] 3232 3233 List HOST services. 3234 3235 Options: 3236 -host= Host system [GOVC_HOST] 3237 ``` 3238 3239 ## host.shutdown 3240 3241 ``` 3242 Usage: govc host.shutdown [OPTIONS] HOST... 3243 3244 Shutdown HOST. 3245 3246 Options: 3247 -f=false Force shutdown when host is not in maintenance mode 3248 -host= Host system [GOVC_HOST] 3249 -r=false Reboot host 3250 ``` 3251 3252 ## host.storage.info 3253 3254 ``` 3255 Usage: govc host.storage.info [OPTIONS] 3256 3257 Show HOST storage system information. 3258 3259 Examples: 3260 govc find / -type h | xargs -n1 govc host.storage.info -unclaimed -host 3261 3262 Options: 3263 -host= Host system [GOVC_HOST] 3264 -refresh=false Refresh the storage system provider 3265 -rescan=false Rescan all host bus adapters 3266 -rescan-vmfs=false Rescan for new VMFSs 3267 -t=lun Type (hba,lun) 3268 -unclaimed=false Only show disks that can be used as new VMFS datastores 3269 ``` 3270 3271 ## host.storage.mark 3272 3273 ``` 3274 Usage: govc host.storage.mark [OPTIONS] DEVICE_PATH 3275 3276 Mark device at DEVICE_PATH. 3277 3278 Options: 3279 -host= Host system [GOVC_HOST] 3280 -local=<nil> Mark as local 3281 -ssd=<nil> Mark as SSD 3282 ``` 3283 3284 ## host.storage.partition 3285 3286 ``` 3287 Usage: govc host.storage.partition [OPTIONS] DEVICE_PATH 3288 3289 Show partition table for device at DEVICE_PATH. 3290 3291 Options: 3292 -host= Host system [GOVC_HOST] 3293 ``` 3294 3295 ## host.vnic.change 3296 3297 ``` 3298 Usage: govc host.vnic.change [OPTIONS] DEVICE 3299 3300 Change a virtual nic DEVICE. 3301 3302 Examples: 3303 govc host.vnic.change -host hostname -mtu 9000 vmk1 3304 3305 Options: 3306 -host= Host system [GOVC_HOST] 3307 -mtu=0 vmk MTU 3308 ``` 3309 3310 ## host.vnic.hint 3311 3312 ``` 3313 Usage: govc host.vnic.hint [OPTIONS] [DEVICE]... 3314 3315 Query virtual nic DEVICE hints. 3316 Examples: 3317 govc host.vnic.hint -host hostname 3318 govc host.vnic.hint -host hostname vmnic1 3319 3320 Options: 3321 -host= Host system [GOVC_HOST] 3322 ``` 3323 3324 ## host.vnic.info 3325 3326 ``` 3327 Usage: govc host.vnic.info [OPTIONS] 3328 3329 Options: 3330 -host= Host system [GOVC_HOST] 3331 ``` 3332 3333 ## host.vnic.service 3334 3335 ``` 3336 Usage: govc host.vnic.service [OPTIONS] SERVICE DEVICE 3337 3338 3339 Enable or disable service on a virtual nic device. 3340 3341 Where SERVICE is one of: vmotion|faultToleranceLogging|vSphereReplication|vSphereReplicationNFC|management|vsan|vSphereProvisioning 3342 Where DEVICE is one of: vmk0|vmk1|... 3343 3344 Examples: 3345 govc host.vnic.service -host hostname -enable vsan vmk0 3346 govc host.vnic.service -host hostname -enable=false vmotion vmk1 3347 3348 Options: 3349 -enable=true Enable service 3350 -host= Host system [GOVC_HOST] 3351 ``` 3352 3353 ## host.vswitch.add 3354 3355 ``` 3356 Usage: govc host.vswitch.add [OPTIONS] NAME 3357 3358 Options: 3359 -host= Host system [GOVC_HOST] 3360 -mtu=0 MTU 3361 -nic= Bridge nic device 3362 -ports=128 Number of ports 3363 ``` 3364 3365 ## host.vswitch.info 3366 3367 ``` 3368 Usage: govc host.vswitch.info [OPTIONS] 3369 3370 Options: 3371 -host= Host system [GOVC_HOST] 3372 ``` 3373 3374 ## host.vswitch.remove 3375 3376 ``` 3377 Usage: govc host.vswitch.remove [OPTIONS] NAME 3378 3379 Options: 3380 -host= Host system [GOVC_HOST] 3381 ``` 3382 3383 ## import.ova 3384 3385 ``` 3386 Usage: govc import.ova [OPTIONS] PATH_TO_OVA 3387 3388 Options: 3389 -ds= Datastore [GOVC_DATASTORE] 3390 -folder= Inventory folder [GOVC_FOLDER] 3391 -hidden=false Enable hidden properties 3392 -host= Host system [GOVC_HOST] 3393 -m=false Verify checksum of uploaded files against manifest (.mf) 3394 -name= Name to use for new entity 3395 -options= Options spec file path for VM deployment 3396 -pool= Resource pool [GOVC_RESOURCE_POOL] 3397 ``` 3398 3399 ## import.ovf 3400 3401 ``` 3402 Usage: govc import.ovf [OPTIONS] PATH_TO_OVF 3403 3404 Options: 3405 -ds= Datastore [GOVC_DATASTORE] 3406 -folder= Inventory folder [GOVC_FOLDER] 3407 -hidden=false Enable hidden properties 3408 -host= Host system [GOVC_HOST] 3409 -m=false Verify checksum of uploaded files against manifest (.mf) 3410 -name= Name to use for new entity 3411 -options= Options spec file path for VM deployment 3412 -pool= Resource pool [GOVC_RESOURCE_POOL] 3413 ``` 3414 3415 ## import.spec 3416 3417 ``` 3418 Usage: govc import.spec [OPTIONS] PATH_TO_OVF_OR_OVA 3419 3420 Options: 3421 -hidden=false Enable hidden properties 3422 ``` 3423 3424 ## import.vmdk 3425 3426 ``` 3427 Usage: govc import.vmdk [OPTIONS] PATH_TO_VMDK [REMOTE_DIRECTORY] 3428 3429 Options: 3430 -ds= Datastore [GOVC_DATASTORE] 3431 -folder= Inventory folder [GOVC_FOLDER] 3432 -force=false Overwrite existing disk 3433 -pool= Resource pool [GOVC_RESOURCE_POOL] 3434 ``` 3435 3436 ## library.checkin 3437 3438 ``` 3439 Usage: govc library.checkin [OPTIONS] PATH 3440 3441 Check in VM to Content Library item PATH. 3442 3443 Note: this command requires vCenter 7.0 or higher. 3444 3445 Examples: 3446 govc library.checkin -vm my-vm my-content/template-vm-item 3447 3448 Options: 3449 -m= Check in message 3450 -vm= Virtual machine [GOVC_VM] 3451 ``` 3452 3453 ## library.checkout 3454 3455 ``` 3456 Usage: govc library.checkout [OPTIONS] PATH NAME 3457 3458 Check out Content Library item PATH to vm NAME. 3459 3460 Note: this command requires vCenter 7.0 or higher. 3461 3462 Examples: 3463 govc library.checkout -cluster my-cluster my-content/template-vm-item my-vm 3464 3465 Options: 3466 -cluster= Cluster [GOVC_CLUSTER] 3467 -folder= Inventory folder [GOVC_FOLDER] 3468 -host= Host system [GOVC_HOST] 3469 -pool= Resource pool [GOVC_RESOURCE_POOL] 3470 ``` 3471 3472 ## library.clone 3473 3474 ``` 3475 Usage: govc library.clone [OPTIONS] PATH NAME 3476 3477 Clone VM to Content Library PATH. 3478 3479 By default, clone as a VM template (requires vCenter version 6.7U1 or higher). 3480 Clone as an OVF when the '-ovf' flag is specified. 3481 3482 Examples: 3483 govc library.clone -vm template-vm my-content template-vm-item 3484 govc library.clone -ovf -vm template-vm my-content ovf-item 3485 3486 Options: 3487 -cluster= Cluster [GOVC_CLUSTER] 3488 -ds= Datastore [GOVC_DATASTORE] 3489 -e=false Include extra configuration 3490 -folder= Inventory folder [GOVC_FOLDER] 3491 -host= Host system [GOVC_HOST] 3492 -m=false Preserve MAC-addresses on network adapters 3493 -ovf=false Clone as OVF (default is VM Template) 3494 -pool= Resource pool [GOVC_RESOURCE_POOL] 3495 -profile= Storage profile 3496 -vm= Virtual machine [GOVC_VM] 3497 ``` 3498 3499 ## library.cp 3500 3501 ``` 3502 Usage: govc library.cp [OPTIONS] SRC DST 3503 3504 Copy SRC library item to DST library. 3505 Examples: 3506 govc library.cp /my-content/my-item /my-other-content 3507 govc library.cp -n my-item2 /my-content/my-item /my-other-content 3508 3509 Options: 3510 -n= Library item name 3511 ``` 3512 3513 ## library.create 3514 3515 ``` 3516 Usage: govc library.create [OPTIONS] NAME 3517 3518 Create library. 3519 3520 Examples: 3521 govc library.create library_name 3522 govc library.create -sub http://server/path/lib.json library_name 3523 govc library.create -pub library_name 3524 3525 Options: 3526 -d=<nil> Description of library 3527 -ds= Datastore [GOVC_DATASTORE] 3528 -policy= Security Policy ID 3529 -pub=<nil> Publish library 3530 -pub-password= Publication password 3531 -pub-username= Publication username 3532 -sub= Subscribe to library URL 3533 -sub-autosync=true Automatic synchronization 3534 -sub-ondemand=false Download content on demand 3535 -sub-password= Subscription password 3536 -sub-username= Subscription username 3537 -thumbprint= SHA-1 thumbprint of the host's SSL certificate 3538 ``` 3539 3540 ## library.deploy 3541 3542 ``` 3543 Usage: govc library.deploy [OPTIONS] TEMPLATE [NAME] 3544 3545 Deploy library OVF template. 3546 3547 Examples: 3548 govc library.deploy /library_name/ovf_template vm_name 3549 govc library.export /library_name/ovf_template/*.ovf # save local copy of .ovf 3550 govc import.spec *.ovf > deploy.json # generate options from .ovf 3551 # edit deploy.json as needed 3552 govc library.deploy -options deploy.json /library_name/ovf_template 3553 3554 Options: 3555 -ds= Datastore [GOVC_DATASTORE] 3556 -folder= Inventory folder [GOVC_FOLDER] 3557 -host= Host system [GOVC_HOST] 3558 -options= Options spec file path for VM deployment 3559 -pool= Resource pool [GOVC_RESOURCE_POOL] 3560 -profile= Storage profile 3561 ``` 3562 3563 ## library.evict 3564 3565 ``` 3566 Usage: govc library.evict [OPTIONS] LIBRARY NAME | ITEM NAME 3567 3568 Evict library NAME or item NAME. 3569 3570 Examples: 3571 govc library.evict subscribed-library 3572 govc library.evict subscribed-library/item 3573 3574 Options: 3575 ``` 3576 3577 ## library.export 3578 3579 ``` 3580 Usage: govc library.export [OPTIONS] PATH [DEST] 3581 3582 Export library items. 3583 3584 If the given PATH is a library item, all files will be downloaded. 3585 3586 If the given PATH is a library item file, only that file will be downloaded. 3587 3588 By default, files are saved using the library item's file names to the current directory. 3589 If DEST is given for a library item, files are saved there instead of the current directory. 3590 If DEST is given for a library item file, the file will be saved with that name. 3591 If DEST is '-', the file contents are written to stdout instead of saving to a file. 3592 3593 Examples: 3594 govc library.export library_name/item_name 3595 govc library.export library_name/item_name/file_name 3596 govc library.export library_name/item_name/*.ovf - 3597 3598 Options: 3599 ``` 3600 3601 ## library.import 3602 3603 ``` 3604 Usage: govc library.import [OPTIONS] LIBRARY ITEM 3605 3606 Import library items. 3607 3608 Examples: 3609 govc library.import library_name file.ova 3610 govc library.import library_name file.ovf 3611 govc library.import library_name file.iso 3612 govc library.import library_id file.iso # Use library id if multiple libraries have the same name 3613 govc library.import library_name/item_name file.ova # update existing item 3614 govc library.import library_name http://example.com/file.ovf # download and push to vCenter 3615 govc library.import -pull library_name http://example.com/file.ova # direct pull from vCenter 3616 3617 Options: 3618 -m=false Require ova manifest 3619 -n= Library item name 3620 -pull=false Pull library item from http endpoint 3621 -t= Library item type 3622 ``` 3623 3624 ## library.info 3625 3626 ``` 3627 Usage: govc library.info [OPTIONS] 3628 3629 Display library information. 3630 3631 Examples: 3632 govc library.info 3633 govc library.info /lib1 3634 govc library.info -l /lib1 | grep Size: 3635 govc library.info /lib1/item1 3636 govc library.info /lib1/item1/ 3637 govc library.info */ 3638 govc device.cdrom.insert -vm $vm -device cdrom-3000 $(govc library.info -L /lib1/item1/file1) 3639 govc library.info -json | jq . 3640 govc library.info -json /lib1/item1 | jq . 3641 3642 Options: 3643 -L=false List Datastore path only 3644 -U=false List pub/sub URL(s) only 3645 -l=false Long listing format 3646 ``` 3647 3648 ## library.ls 3649 3650 ``` 3651 Usage: govc library.ls [OPTIONS] 3652 3653 List libraries, items, and files. 3654 3655 Examples: 3656 govc library.ls 3657 govc library.ls /lib1 3658 govc library.ls /lib1/item1 3659 govc library.ls /lib1/item1/ 3660 govc library.ls */ 3661 govc library.ls -json | jq . 3662 govc library.ls /lib1/item1 -json | jq . 3663 3664 Options: 3665 ``` 3666 3667 ## library.policy.ls 3668 3669 ``` 3670 Usage: govc library.policy.ls [OPTIONS] 3671 3672 List security policies for content libraries. 3673 3674 Examples: 3675 govc library.policy.ls 3676 3677 3678 Options: 3679 ``` 3680 3681 ## library.publish 3682 3683 ``` 3684 Usage: govc library.publish [OPTIONS] NAME|ITEM [SUBSCRIPTION-ID]... 3685 3686 Publish library NAME or ITEM to subscribers. 3687 3688 If no subscriptions are specified, then publishes the library to all its subscribers. 3689 See 'govc library.subscriber.ls' to get a list of subscription IDs. 3690 3691 Examples: 3692 govc library.publish /my-library 3693 govc library.publish /my-library subscription-id1 subscription-id2 3694 govc library.publish /my-library/my-item 3695 govc library.publish /my-library/my-item subscription-id1 subscription-id2 3696 3697 Options: 3698 ``` 3699 3700 ## library.rm 3701 3702 ``` 3703 Usage: govc library.rm [OPTIONS] NAME 3704 3705 Delete library or item NAME. 3706 3707 Examples: 3708 govc library.rm /library_name 3709 govc library.rm library_id # Use library id if multiple libraries have the same name 3710 govc library.rm /library_name/item_name 3711 3712 Options: 3713 ``` 3714 3715 ## library.session.ls 3716 3717 ``` 3718 Usage: govc library.session.ls [OPTIONS] 3719 3720 List library item update sessions. 3721 3722 Examples: 3723 govc library.session.ls 3724 govc library.session.ls -json | jq . 3725 3726 Options: 3727 -i=false List session item files (with -json only) 3728 ``` 3729 3730 ## library.session.rm 3731 3732 ``` 3733 Usage: govc library.session.rm [OPTIONS] 3734 3735 Remove a library item update session. 3736 3737 Examples: 3738 govc library.session.rm session_id 3739 govc library.session.rm -i session_id foo.ovf 3740 3741 Options: 3742 -f=false Cancel session if active 3743 -i=false Remove session item file 3744 ``` 3745 3746 ## library.subscriber.create 3747 3748 ``` 3749 Usage: govc library.subscriber.create [OPTIONS] PUBLISHED-LIBRARY SUBSCRIPTION-LIBRARY 3750 3751 Create library subscriber. 3752 3753 Examples: 3754 govc library.subscriber.create -cluster my-cluster published-library subscription-library 3755 3756 Options: 3757 -cluster= Cluster [GOVC_CLUSTER] 3758 -folder= Inventory folder [GOVC_FOLDER] 3759 -host= Host system [GOVC_HOST] 3760 -net= Network [GOVC_NETWORK] 3761 -net.adapter=e1000 Network adapter type 3762 -net.address= Network hardware address 3763 -net.protocol= Network device protocol. Applicable to vmxnet3vrdma. Default to 'rocev2' 3764 -pool= Resource pool [GOVC_RESOURCE_POOL] 3765 ``` 3766 3767 ## library.subscriber.info 3768 3769 ``` 3770 Usage: govc library.subscriber.info [OPTIONS] PUBLISHED-LIBRARY SUBSCRIPTION-ID 3771 3772 Library subscriber info. 3773 3774 Examples: 3775 id=$(govc library.subscriber.ls | grep my-library-name | awk '{print $1}') 3776 govc library.subscriber.info published-library-name $id 3777 3778 Options: 3779 ``` 3780 3781 ## library.subscriber.ls 3782 3783 ``` 3784 Usage: govc library.subscriber.ls [OPTIONS] 3785 3786 List library subscriptions. 3787 3788 Examples: 3789 govc library.subscriber.ls library-name 3790 3791 Options: 3792 ``` 3793 3794 ## library.subscriber.rm 3795 3796 ``` 3797 Usage: govc library.subscriber.rm [OPTIONS] SUBSCRIPTION-ID 3798 3799 Delete subscription of the published library. 3800 3801 The subscribed library associated with the subscription will not be deleted. 3802 3803 Examples: 3804 id=$(govc library-subscriber.ls | grep my-library-name | awk '{print $1}') 3805 govc library.subscriber.rm $id 3806 3807 Options: 3808 ``` 3809 3810 ## library.sync 3811 3812 ``` 3813 Usage: govc library.sync [OPTIONS] NAME|ITEM 3814 3815 Sync library NAME or ITEM. 3816 3817 Examples: 3818 govc library.sync subscribed-library 3819 govc library.sync subscribed-library/item 3820 govc library.sync -vmtx local-library subscribed-library # convert subscribed OVFs to local VMTX 3821 3822 Options: 3823 -folder= Inventory folder [GOVC_FOLDER] 3824 -pool= Resource pool [GOVC_RESOURCE_POOL] 3825 -vmtx= Sync subscribed library to local library as VM Templates 3826 ``` 3827 3828 ## library.trust.create 3829 3830 ``` 3831 Usage: govc library.trust.create [OPTIONS] FILE 3832 3833 Add a certificate to content library trust store. 3834 3835 If FILE name is "-", read certificate from stdin. 3836 3837 Examples: 3838 govc library.trust.create cert.pem 3839 govc about.cert -show -u wp-content-int.vmware.com | govc library.trust.create - 3840 3841 Options: 3842 ``` 3843 3844 ## library.trust.info 3845 3846 ``` 3847 Usage: govc library.trust.info [OPTIONS] ID 3848 3849 Display trusted certificate info. 3850 3851 Examples: 3852 govc library.trust.info vmware_signed 3853 3854 Options: 3855 ``` 3856 3857 ## library.trust.ls 3858 3859 ``` 3860 Usage: govc library.trust.ls [OPTIONS] 3861 3862 List trusted certificates for content libraries. 3863 3864 Examples: 3865 govc library.trust.ls 3866 govc library.trust.ls -json 3867 3868 Options: 3869 ``` 3870 3871 ## library.trust.rm 3872 3873 ``` 3874 Usage: govc library.trust.rm [OPTIONS] ID 3875 3876 Remove certificate ID from trusted certificates. 3877 3878 Examples: 3879 govc library.trust.rm $id 3880 3881 Options: 3882 ``` 3883 3884 ## library.update 3885 3886 ``` 3887 Usage: govc library.update [OPTIONS] PATH 3888 3889 Update library or item PATH. 3890 3891 Examples: 3892 govc library.update -d "new library description" -n "new-name" my-library 3893 govc library.update -d "new item description" -n "new-item-name" my-library/my-item 3894 3895 Options: 3896 -d=<nil> Library or item description 3897 -n= Library or item name 3898 ``` 3899 3900 ## library.vmtx.info 3901 3902 ``` 3903 Usage: govc library.vmtx.info [OPTIONS] 3904 3905 Display VMTX template details 3906 3907 Examples: 3908 govc library.vmtx.info /library_name/vmtx_template_name 3909 3910 Options: 3911 ``` 3912 3913 ## license.add 3914 3915 ``` 3916 Usage: govc license.add [OPTIONS] KEY... 3917 3918 Options: 3919 ``` 3920 3921 ## license.assign 3922 3923 ``` 3924 Usage: govc license.assign [OPTIONS] KEY 3925 3926 Assign licenses to HOST or CLUSTER. 3927 3928 Examples: 3929 govc license.assign $VCSA_LICENSE_KEY 3930 govc license.assign -host a_host.example.com $ESX_LICENSE_KEY 3931 govc license.assign -cluster a_cluster $VSAN_LICENSE_KEY 3932 3933 Options: 3934 -cluster= Cluster [GOVC_CLUSTER] 3935 -host= Host system [GOVC_HOST] 3936 -name= Display name 3937 -remove=false Remove assignment 3938 ``` 3939 3940 ## license.assigned.ls 3941 3942 ``` 3943 Usage: govc license.assigned.ls [OPTIONS] 3944 3945 Options: 3946 -id= Entity ID 3947 ``` 3948 3949 ## license.decode 3950 3951 ``` 3952 Usage: govc license.decode [OPTIONS] KEY... 3953 3954 Options: 3955 -feature= List licenses with given feature 3956 ``` 3957 3958 ## license.label.set 3959 3960 ``` 3961 Usage: govc license.label.set [OPTIONS] LICENSE KEY VAL 3962 3963 Set license labels. 3964 3965 Examples: 3966 govc license.label.set 00000-00000-00000-00000-00000 team cnx # add/set label 3967 govc license.label.set 00000-00000-00000-00000-00000 team "" # remove label 3968 govc license.ls -json | jq '.[] | select(.labels[].key == "team") | .licenseKey' 3969 3970 Options: 3971 ``` 3972 3973 ## license.ls 3974 3975 ``` 3976 Usage: govc license.ls [OPTIONS] 3977 3978 Options: 3979 -feature= List licenses with given feature 3980 ``` 3981 3982 ## license.remove 3983 3984 ``` 3985 Usage: govc license.remove [OPTIONS] KEY... 3986 3987 Options: 3988 ``` 3989 3990 ## logs 3991 3992 ``` 3993 Usage: govc logs [OPTIONS] 3994 3995 View VPX and ESX logs. 3996 3997 The '-log' option defaults to "hostd" when connected directly to a host or 3998 when connected to VirtualCenter and a '-host' option is given. Otherwise, 3999 the '-log' option defaults to "vpxd:vpxd.log". The '-host' option is ignored 4000 when connected directly to a host. See 'govc logs.ls' for other '-log' options. 4001 4002 Examples: 4003 govc logs -n 1000 -f 4004 govc logs -host esx1 4005 govc logs -host esx1 -log vmkernel 4006 4007 Options: 4008 -f=false Follow log file changes 4009 -host= Host system [GOVC_HOST] 4010 -log= Log file key 4011 -n=25 Output the last N log lines 4012 ``` 4013 4014 ## logs.download 4015 4016 ``` 4017 Usage: govc logs.download [OPTIONS] [PATH]... 4018 4019 Generate diagnostic bundles. 4020 4021 A diagnostic bundle includes log files and other configuration information. 4022 4023 Use PATH to include a specific set of hosts to include. 4024 4025 Examples: 4026 govc logs.download 4027 govc logs.download host-a host-b 4028 4029 Options: 4030 -default=false Specifies if the bundle should include the default server 4031 ``` 4032 4033 ## logs.ls 4034 4035 ``` 4036 Usage: govc logs.ls [OPTIONS] 4037 4038 List diagnostic log keys. 4039 4040 Examples: 4041 govc logs.ls 4042 govc logs.ls -host host-a 4043 4044 Options: 4045 -host= Host system [GOVC_HOST] 4046 ``` 4047 4048 ## ls 4049 4050 ``` 4051 Usage: govc ls [OPTIONS] [PATH]... 4052 4053 List inventory items. 4054 4055 Examples: 4056 govc ls -l '*' 4057 govc ls -t ClusterComputeResource host 4058 govc ls -t Datastore host/ClusterA/* | grep -v local | xargs -n1 basename | sort | uniq 4059 4060 Options: 4061 -L=false Follow managed object references 4062 -i=false Print the managed object reference 4063 -l=false Long listing format 4064 -t= Object type 4065 ``` 4066 4067 ## metric.change 4068 4069 ``` 4070 Usage: govc metric.change [OPTIONS] NAME... 4071 4072 Change counter NAME levels. 4073 4074 Examples: 4075 govc metric.change -level 1 net.bytesRx.average net.bytesTx.average 4076 4077 Options: 4078 -device-level=0 Level for the per device counter 4079 -i=real Interval ID (real|day|week|month|year) 4080 -level=0 Level for the aggregate counter 4081 ``` 4082 4083 ## metric.info 4084 4085 ``` 4086 Usage: govc metric.info [OPTIONS] PATH [NAME]... 4087 4088 Metric info for NAME. 4089 4090 If PATH is a value other than '-', provider summary and instance list are included 4091 for the given object type. 4092 4093 If NAME is not specified, all available metrics for the given INTERVAL are listed. 4094 An object PATH must be provided in this case. 4095 4096 Examples: 4097 govc metric.info vm/my-vm 4098 govc metric.info -i 300 vm/my-vm 4099 govc metric.info - cpu.usage.average 4100 govc metric.info /dc1/host/cluster cpu.usage.average 4101 4102 Options: 4103 -g= Show info for a specific Group 4104 -i=real Interval ID (real|day|week|month|year) 4105 ``` 4106 4107 ## metric.interval.change 4108 4109 ``` 4110 Usage: govc metric.interval.change [OPTIONS] 4111 4112 Change historical metric intervals. 4113 4114 Examples: 4115 govc metric.interval.change -i 300 -level 2 4116 govc metric.interval.change -i 86400 -enabled=false 4117 4118 Options: 4119 -enabled=<nil> Enable or disable 4120 -i=real Interval ID (real|day|week|month|year) 4121 -level=0 Level 4122 ``` 4123 4124 ## metric.interval.info 4125 4126 ``` 4127 Usage: govc metric.interval.info [OPTIONS] 4128 4129 List historical metric intervals. 4130 4131 Examples: 4132 govc metric.interval.info 4133 govc metric.interval.info -i 300 4134 4135 Options: 4136 -i=real Interval ID (real|day|week|month|year) 4137 ``` 4138 4139 ## metric.ls 4140 4141 ``` 4142 Usage: govc metric.ls [OPTIONS] PATH 4143 4144 List available metrics for PATH. 4145 4146 The default output format is the metric name. 4147 The '-l' flag includes the metric description. 4148 The '-L' flag includes the metric units, instance count (if any) and description. 4149 The instance count is prefixed with a single '@'. 4150 If no aggregate is provided for the metric, instance count is prefixed with two '@@'. 4151 4152 Examples: 4153 govc metric.ls /dc1/host/cluster1 4154 govc metric.ls datastore/* 4155 govc metric.ls -L -g CPU /dc1/host/cluster1/host1 4156 govc metric.ls vm/* | grep mem. | xargs govc metric.sample vm/* 4157 4158 Options: 4159 -L=false Longer listing format 4160 -g= List a specific Group 4161 -i=real Interval ID (real|day|week|month|year) 4162 -l=false Long listing format 4163 ``` 4164 4165 ## metric.reset 4166 4167 ``` 4168 Usage: govc metric.reset [OPTIONS] NAME... 4169 4170 Reset counter NAME to the default level of data collection. 4171 4172 Examples: 4173 govc metric.reset net.bytesRx.average net.bytesTx.average 4174 4175 Options: 4176 -i=real Interval ID (real|day|week|month|year) 4177 ``` 4178 4179 ## metric.sample 4180 4181 ``` 4182 Usage: govc metric.sample [OPTIONS] PATH... NAME... 4183 4184 Sample for object PATH of metric NAME. 4185 4186 Interval ID defaults to 20 (realtime) if supported, otherwise 300 (5m interval). 4187 4188 By default, INSTANCE '*' samples all instances and the aggregate counter. 4189 An INSTANCE value of '-' will only sample the aggregate counter. 4190 An INSTANCE value other than '*' or '-' will only sample the given instance counter. 4191 4192 If PLOT value is set to '-', output a gnuplot script. If non-empty with another 4193 value, PLOT will pipe the script to gnuplot for you. The value is also used to set 4194 the gnuplot 'terminal' variable, unless the value is that of the DISPLAY env var. 4195 Only 1 metric NAME can be specified when the PLOT flag is set. 4196 4197 Examples: 4198 govc metric.sample host/cluster1/* cpu.usage.average 4199 govc metric.sample -plot .png host/cluster1/* cpu.usage.average | xargs open 4200 govc metric.sample vm/* net.bytesTx.average net.bytesTx.average 4201 govc metric.sample -instance vmnic0 vm/* net.bytesTx.average 4202 govc metric.sample -instance - vm/* net.bytesTx.average 4203 4204 Options: 4205 -d=30 Limit object display name to D chars 4206 -i=real Interval ID (real|day|week|month|year) 4207 -instance=* Instance 4208 -n=5 Max number of samples 4209 -plot= Plot data using gnuplot 4210 -t=false Include sample times 4211 ``` 4212 4213 ## namespace.cluster.disable 4214 4215 ``` 4216 Usage: govc namespace.cluster.disable [OPTIONS] 4217 4218 Disables vSphere Namespaces on the specified cluster. 4219 4220 Examples: 4221 govc namespace.cluster.disable -cluster "Workload-Cluster" 4222 4223 Options: 4224 -cluster= Cluster [GOVC_CLUSTER] 4225 ``` 4226 4227 ## namespace.cluster.enable 4228 4229 ``` 4230 Usage: govc namespace.cluster.enable [OPTIONS] 4231 4232 Enable vSphere Namespaces on the cluster. 4233 This operation sets up Kubernetes instance for the cluster along with worker nodes. 4234 4235 Examples: 4236 govc namespace.cluster.enable \ 4237 -cluster "Workload-Cluster" \ 4238 -service-cidr 10.96.0.0/23 \ 4239 -pod-cidrs 10.244.0.0/20 \ 4240 -control-plane-dns 10.10.10.10 \ 4241 -control-plane-dns-names wcp.example.com \ 4242 -workload-network.egress-cidrs 10.0.0.128/26 \ 4243 -workload-network.ingress-cidrs "10.0.0.64/26" \ 4244 -workload-network.switch VDS \ 4245 -workload-network.edge-cluster Edge-Cluster-1 \ 4246 -size TINY \ 4247 -mgmt-network.network "DVPG-Management Network" \ 4248 -mgmt-network.gateway 10.0.0.1 \ 4249 -mgmt-network.starting-address 10.0.0.45 \ 4250 -mgmt-network.subnet-mask 255.255.255.0 \ 4251 -ephemeral-storage-policy "vSAN Default Storage Policy" \ 4252 -control-plane-storage-policy "vSAN Default Storage Policy" \ 4253 -image-storage-policy "vSAN Default Storage Policy" 4254 4255 Options: 4256 -cluster= Cluster [GOVC_CLUSTER] 4257 -control-plane-dns= Comma-separated list of DNS server IP addresses to use on Kubernetes API server, specified in order of preference. 4258 -control-plane-dns-names= Comma-separated list of DNS names to associate with the Kubernetes API server. These DNS names are embedded in the TLS certificate presented by the API server. 4259 -control-plane-dns-search-domains= Comma-separated list of domains to be searched when trying to lookup a host name on Kubernetes API server, specified in order of preference. 4260 -control-plane-ntp-servers= Optional. Comma-separated list of NTP server DNS names or IP addresses to use on Kubernetes API server, specified in order of preference. If unset, VMware Tools based time synchronization is enabled. 4261 -control-plane-storage-policy= Storage Policy associated with Kubernetes API server. 4262 -ephemeral-storage-policy= Storage Policy associated with ephemeral disks of all the Kubernetes Pods in the cluster. 4263 -image-storage-policy= Storage Policy to be used for container images. 4264 -login-banner= Optional. Disclaimer to be displayed prior to login via the Kubectl plugin. 4265 -mgmt-network.address-count=5 The number of IP addresses in the management range. Optional, but required with network mode STATICRANGE. 4266 -mgmt-network.floating-IP= Optional. The Floating IP used by the HA master cluster in the when network Mode is DHCP. 4267 -mgmt-network.gateway= Gateway to be used for the management IP range 4268 -mgmt-network.mode=STATICRANGE IPv4 address assignment modes. Value is one of: DHCP, STATICRANGE 4269 -mgmt-network.network= Identifier for the management network. 4270 -mgmt-network.starting-address= Denotes the start of the IP range to be used. Optional, but required with network mode STATICRANGE. 4271 -mgmt-network.subnet-mask= Subnet mask of the management network. Optional, but required with network mode STATICRANGE. 4272 -network-provider=NSXT_CONTAINER_PLUGIN Optional. Provider of cluster networking for this vSphere Namespaces cluster. Currently only value supported is: NSXT_CONTAINER_PLUGIN. 4273 -pod-cidrs= CIDR blocks from which Kubernetes allocates pod IP addresses. Comma-separated list. Shouldn't overlap with service, ingress or egress CIDRs. 4274 -service-cidr= CIDR block from which Kubernetes allocates service cluster IP addresses. Shouldn't overlap with pod, ingress or egress CIDRs 4275 -size= The size of the Kubernetes API server and the worker nodes. Value is one of: TINY, SMALL, MEDIUM, LARGE. 4276 -worker-dns= Comma-separated list of DNS server IP addresses to use on the worker nodes, specified in order of preference. 4277 -workload-network.edge-cluster= NSX Edge Cluster to be used for Kubernetes Services of type LoadBalancer, Kubernetes Ingresses, and NSX SNAT. 4278 -workload-network.egress-cidrs= CIDR blocks from which NSX assigns IP addresses used for performing SNAT from container IPs to external IPs. Comma-separated list. Shouldn't overlap with pod, service or ingress CIDRs. 4279 -workload-network.ingress-cidrs= CIDR blocks from which NSX assigns IP addresses for Kubernetes Ingresses and Kubernetes Services of type LoadBalancer. Comma-separated list. Shouldn't overlap with pod, service or egress CIDRs. 4280 -workload-network.switch= vSphere Distributed Switch used to connect this cluster. 4281 ``` 4282 4283 ## namespace.cluster.ls 4284 4285 ``` 4286 Usage: govc namespace.cluster.ls [OPTIONS] 4287 4288 List namepace enabled clusters. 4289 4290 Examples: 4291 govc namespace.cluster.ls 4292 govc namespace.cluster.ls -l 4293 govc namespace.cluster.ls -json | jq . 4294 4295 Options: 4296 -l=false Long listing format 4297 ``` 4298 4299 ## namespace.create 4300 4301 ``` 4302 Usage: govc namespace.create [OPTIONS] NAME 4303 4304 Creates a new vSphere Namespace on a Supervisor. 4305 4306 The '-library' and '-vm-class' flags can each be specified multiple times. 4307 4308 Examples: 4309 govc namespace.create -supervisor=domain-c1 test-namespace 4310 govc namespace.create -supervisor=domain-c1 -library=dca9cc16-9460-4da0-802c-4aa148ac6cf7 test-namespace 4311 govc namespace.create -supervisor=domain-c1 -library=dca9cc16-9460-4da0-802c-4aa148ac6cf7 -library=dca9cc16-9460-4da0-802c-4aa148ac6cf7 test-namespace 4312 govc namespace.create -supervisor=domain-c1 -vm-class=best-effort-2xlarge test-namespace 4313 govc namespace.create -supervisor=domain-c1 -vm-class=best-effort-2xlarge -vm-class best-effort-4xlarge test-namespace 4314 govc namespace.create -supervisor=domain-c1 -library=dca9cc16-9460-4da0-802c-4aa148ac6cf7 -library=dca9cc16-9460-4da0-802c-4aa148ac6cf7 -vm-class=best-effort-2xlarge -vm-class=best-effort-4xlarge test-namespace 4315 4316 Options: 4317 -library=[] Content library IDs to associate with the vSphere Namespace. 4318 -supervisor= The identifier of the Supervisor. 4319 -vm-class=[] Virtual machine class IDs to associate with the vSphere Namespace. 4320 ``` 4321 4322 ## namespace.info 4323 4324 ``` 4325 Usage: govc namespace.info [OPTIONS] NAME 4326 4327 Displays the details of a vSphere Namespace. 4328 4329 Examples: 4330 govc namespace.info test-namespace 4331 4332 Options: 4333 ``` 4334 4335 ## namespace.logs.download 4336 4337 ``` 4338 Usage: govc namespace.logs.download [OPTIONS] [NAME] 4339 4340 Download namespace cluster support bundle. 4341 4342 If NAME name is "-", bundle is written to stdout. 4343 4344 See also: govc logs.download 4345 4346 Examples: 4347 govc namespace.logs.download -cluster k8s 4348 govc namespace.logs.download -cluster k8s - | tar -xvf - 4349 govc namespace.logs.download -cluster k8s logs.tar 4350 4351 Options: 4352 -cluster= Cluster [GOVC_CLUSTER] 4353 ``` 4354 4355 ## namespace.ls 4356 4357 ``` 4358 Usage: govc namespace.ls [OPTIONS] 4359 4360 Displays the list of vSphere Namespaces. 4361 4362 Examples: 4363 govc namespace.ls 4364 4365 Options: 4366 ``` 4367 4368 ## namespace.rm 4369 4370 ``` 4371 Usage: govc namespace.rm [OPTIONS] NAME 4372 4373 Deletes a vSphere Namespace. 4374 4375 Examples: 4376 govc namespace.rm test-namespace 4377 4378 Options: 4379 ``` 4380 4381 ## namespace.service.activate 4382 4383 ``` 4384 Usage: govc namespace.service.activate [OPTIONS] NAME... 4385 4386 Activates a vSphere Namespace Supervisor Service. 4387 4388 Examples: 4389 govc namespace.service.activate my-supervisor-service other-supervisor-service 4390 4391 Options: 4392 ``` 4393 4394 ## namespace.service.create 4395 4396 ``` 4397 Usage: govc namespace.service.create [OPTIONS] MANIFEST 4398 4399 Creates a vSphere Namespace Supervisor Service. 4400 4401 Examples: 4402 govc namespace.service.create manifest.yaml 4403 4404 Options: 4405 ``` 4406 4407 ## namespace.service.deactivate 4408 4409 ``` 4410 Usage: govc namespace.service.deactivate [OPTIONS] NAME... 4411 4412 Deactivates a vSphere Namespace Supervisor Service. 4413 4414 Examples: 4415 govc namespace.service.deactivate my-supervisor-service other-supervisor-service 4416 4417 Options: 4418 ``` 4419 4420 ## namespace.service.info 4421 4422 ``` 4423 Usage: govc namespace.service.info [OPTIONS] NAME 4424 4425 Gets information of a specific supervisor service. 4426 4427 Examples: 4428 govc namespace.service.info my-supervisor-service 4429 govc namespace.service.info -json my-supervisor-service | jq . 4430 4431 Options: 4432 ``` 4433 4434 ## namespace.service.ls 4435 4436 ``` 4437 Usage: govc namespace.service.ls [OPTIONS] 4438 4439 List namepace registered supervisor services. 4440 4441 Examples: 4442 govc namespace.service.ls 4443 govc namespace.service.ls -l 4444 govc namespace.service.ls -json | jq . 4445 4446 Options: 4447 -l=false Long listing format 4448 ``` 4449 4450 ## namespace.service.rm 4451 4452 ``` 4453 Usage: govc namespace.service.rm [OPTIONS] NAME... 4454 4455 Removes a vSphere Namespace Supervisor Service. 4456 4457 Examples: 4458 govc namespace.service.rm my-supervisor-service other-supervisor-service 4459 4460 Options: 4461 ``` 4462 4463 ## namespace.update 4464 4465 ``` 4466 Usage: govc namespace.update [OPTIONS] NAME 4467 4468 Modifies an existing vSphere Namespace on a Supervisor. 4469 4470 Examples: 4471 govc namespace.update -library=dca9cc16-9460-4da0-802c-4aa148ac6cf7 test-namespace 4472 govc namespace.update -library=dca9cc16-9460-4da0-802c-4aa148ac6cf7 -library=617a3ee3-a2ff-4311-9a7c-0016ccf958bd test-namespace 4473 govc namespace.update -vm-class=best-effort-2xlarge test-namespace 4474 govc namespace.update -vm-class=best-effort-2xlarge -vm-class=best-effort-4xlarge test-namespace 4475 govc namespace.update -library=dca9cc16-9460-4da0-802c-4aa148ac6cf7 -library=617a3ee3-a2ff-4311-9a7c-0016ccf958bd -vm-class=best-effort-2xlarge -vm-class=best-effort-4xlarge test-namespace 4476 4477 Options: 4478 -library=[] Content library IDs to associate with the vSphere Namespace. 4479 -vm-class=[] Virtual machine class IDs to associate with the vSphere Namespace. 4480 ``` 4481 4482 ## namespace.vmclass.create 4483 4484 ``` 4485 Usage: govc namespace.vmclass.create [OPTIONS] NAME 4486 4487 Creates a new virtual machine class. 4488 4489 The name of the virtual machine class has DNS_LABEL restrictions 4490 as specified in "https://tools.ietf.org/html/rfc1123". It 4491 must be an alphanumeric (a-z and 0-9) string and with maximum length 4492 of 63 characters and with the '-' character allowed anywhere except 4493 the first or last character. This name is unique in this vCenter server. 4494 4495 Examples: 4496 govc namespace.vmclass.create -cpus=8 -memory=8192 test-class-01 4497 4498 Options: 4499 -cpus=0 The number of CPUs. 4500 -memory=0 The amount of memory (in MB). 4501 ``` 4502 4503 ## namespace.vmclass.info 4504 4505 ``` 4506 Usage: govc namespace.vmclass.info [OPTIONS] NAME 4507 4508 Displays the details of a virtual machine class. 4509 4510 Examples: 4511 govc namespace.vmclass.info test-class 4512 4513 Options: 4514 ``` 4515 4516 ## namespace.vmclass.ls 4517 4518 ``` 4519 Usage: govc namespace.vmclass.ls [OPTIONS] 4520 4521 Displays the list of virtual machine classes. 4522 4523 Examples: 4524 govc namespace.vmclass.ls 4525 4526 Options: 4527 ``` 4528 4529 ## namespace.vmclass.rm 4530 4531 ``` 4532 Usage: govc namespace.vmclass.rm [OPTIONS] NAME 4533 4534 Deletes a virtual machine class. 4535 4536 Examples: 4537 govc namespace.vmclass.rm test-class 4538 4539 Options: 4540 ``` 4541 4542 ## namespace.vmclass.update 4543 4544 ``` 4545 Usage: govc namespace.vmclass.update [OPTIONS] NAME 4546 4547 Modifies an existing virtual machine class. 4548 4549 Examples: 4550 govc namespace.vmclass.update -cpus=8 -memory=8192 test-class 4551 4552 Options: 4553 -cpus=0 The number of CPUs. 4554 -memory=0 The amount of memory (in MB). 4555 ``` 4556 4557 ## object.collect 4558 4559 ``` 4560 Usage: govc object.collect [OPTIONS] [MOID] [PROPERTY]... 4561 4562 Collect managed object properties. 4563 4564 MOID can be an inventory path or ManagedObjectReference. 4565 MOID defaults to '-', an alias for 'ServiceInstance:ServiceInstance' or the root folder if a '-type' flag is given. 4566 4567 If a '-type' flag is given, properties are collected using a ContainerView object where MOID is the root of the view. 4568 4569 By default only the current property value(s) are collected. To wait for updates, use the '-n' flag or 4570 specify a property filter. A property filter can be specified by prefixing the property name with a '-', 4571 followed by the value to match. 4572 4573 The '-R' flag sets the Filter using the given XML encoded request, which can be captured by 'vcsim -trace' for example. 4574 It can be useful for replaying property filters created by other clients and converting filters to Go code via '-O -dump'. 4575 4576 The '-type' flag value can be a managed entity type or one of the following aliases: 4577 4578 a VirtualApp 4579 c ClusterComputeResource 4580 d Datacenter 4581 f Folder 4582 g DistributedVirtualPortgroup 4583 h HostSystem 4584 m VirtualMachine 4585 n Network 4586 o OpaqueNetwork 4587 p ResourcePool 4588 r ComputeResource 4589 s Datastore 4590 w DistributedVirtualSwitch 4591 4592 Examples: 4593 govc object.collect - content 4594 govc object.collect -s HostSystem:ha-host hardware.systemInfo.uuid 4595 govc object.collect -s /ha-datacenter/vm/foo overallStatus 4596 govc object.collect -s /ha-datacenter/vm/foo -guest.guestOperationsReady true # property filter 4597 govc object.collect -type m / name runtime.powerState # collect properties for multiple objects 4598 govc object.collect -json -n=-1 EventManager:ha-eventmgr latestEvent | jq . 4599 govc object.collect -json -s $(govc object.collect -s - content.perfManager) description.counterType | jq . 4600 govc object.collect -R create-filter-request.xml # replay filter 4601 govc object.collect -R create-filter-request.xml -O # convert filter to Go code 4602 govc object.collect -s vm/my-vm summary.runtime.host | xargs govc ls -L # inventory path of VM's host 4603 govc object.collect -dump -o "network/VM Network" # output Managed Object structure as Go code 4604 govc object.collect -json $vm config | \ # use -json + jq to search array elements 4605 jq -r '.[] | select(.val.hardware.device[].macAddress == "00:0c:29:0c:73:c0") | .val.name' 4606 4607 Options: 4608 -O=false Output the CreateFilter request itself 4609 -R= Raw XML encoded CreateFilter request 4610 -d=, Delimiter for array values 4611 -n=0 Wait for N property updates 4612 -o=false Output the structure of a single Managed Object 4613 -s=false Output property value only 4614 -type=[] Resource type. If specified, MOID is used for a container view root 4615 -wait=0s Max wait time for updates 4616 ``` 4617 4618 ## object.destroy 4619 4620 ``` 4621 Usage: govc object.destroy [OPTIONS] PATH... 4622 4623 Destroy managed objects. 4624 4625 Examples: 4626 govc object.destroy /dc1/network/dvs /dc1/host/cluster 4627 4628 Options: 4629 ``` 4630 4631 ## object.method 4632 4633 ``` 4634 Usage: govc object.method [OPTIONS] PATH... 4635 4636 Enable or disable methods for managed objects. 4637 4638 Examples: 4639 govc object.method -name Destroy_Task -enable=false /dc1/vm/foo 4640 govc object.collect /dc1/vm/foo disabledMethod | grep --color Destroy_Task 4641 govc object.method -name Destroy_Task -enable /dc1/vm/foo 4642 4643 Options: 4644 -enable=true Enable method 4645 -name= Method name 4646 -reason= Reason for disabling method 4647 -source=govc Source ID 4648 ``` 4649 4650 ## object.mv 4651 4652 ``` 4653 Usage: govc object.mv [OPTIONS] PATH... FOLDER 4654 4655 Move managed entities to FOLDER. 4656 4657 Examples: 4658 govc folder.create /dc1/host/example 4659 govc object.mv /dc2/host/*.example.com /dc1/host/example 4660 4661 Options: 4662 ``` 4663 4664 ## object.reload 4665 4666 ``` 4667 Usage: govc object.reload [OPTIONS] PATH... 4668 4669 Reload managed object state. 4670 4671 Examples: 4672 govc datastore.upload $vm.vmx $vm/$vm.vmx 4673 govc object.reload /dc1/vm/$vm 4674 4675 Options: 4676 ``` 4677 4678 ## object.rename 4679 4680 ``` 4681 Usage: govc object.rename [OPTIONS] PATH NAME 4682 4683 Rename managed objects. 4684 4685 Examples: 4686 govc object.rename /dc1/network/dvs1 Switch1 4687 4688 Options: 4689 ``` 4690 4691 ## object.save 4692 4693 ``` 4694 Usage: govc object.save [OPTIONS] [PATH] 4695 4696 Save managed objects. 4697 4698 By default, the object tree and all properties are saved, starting at PATH. 4699 PATH defaults to ServiceContent, but can be specified to save a subset of objects. 4700 The primary use case for this command is to save inventory from a live vCenter and 4701 load it into a vcsim instance. 4702 4703 Examples: 4704 govc object.save -d my-vcenter 4705 vcsim -load my-vcenter 4706 4707 Options: 4708 -1=false Save ROOT only, without its children 4709 -d= Save objects in directory 4710 -f=false Remove existing object directory 4711 -folder= Inventory folder [GOVC_FOLDER] 4712 -r=true Include children of the container view root 4713 -type=[] Resource types to save. Defaults to all types 4714 -v=false Verbose output 4715 ``` 4716 4717 ## option.ls 4718 4719 ``` 4720 Usage: govc option.ls [OPTIONS] [NAME] 4721 4722 List option with the given NAME. 4723 4724 If NAME ends with a dot, all options for that subtree are listed. 4725 4726 Examples: 4727 govc option.ls 4728 govc option.ls config.vpxd.sso. 4729 govc option.ls config.vpxd.sso.sts.uri 4730 4731 Options: 4732 ``` 4733 4734 ## option.set 4735 4736 ``` 4737 Usage: govc option.set [OPTIONS] NAME VALUE 4738 4739 Set option NAME to VALUE. 4740 4741 Examples: 4742 govc option.set log.level info 4743 govc option.set logger.Vsan verbose 4744 4745 Options: 4746 ``` 4747 4748 ## permissions.ls 4749 4750 ``` 4751 Usage: govc permissions.ls [OPTIONS] [PATH]... 4752 4753 List the permissions defined on or effective on managed entities. 4754 4755 Examples: 4756 govc permissions.ls 4757 govc permissions.ls /dc1/host/cluster1 4758 4759 Options: 4760 -a=true Include inherited permissions defined by parent entities 4761 -i=false Use moref instead of inventory path 4762 ``` 4763 4764 ## permissions.remove 4765 4766 ``` 4767 Usage: govc permissions.remove [OPTIONS] [PATH]... 4768 4769 Removes a permission rule from managed entities. 4770 4771 Examples: 4772 govc permissions.remove -principal root 4773 govc permissions.remove -principal $USER@vsphere.local /dc1/host/cluster1 4774 4775 Options: 4776 -f=false Ignore NotFound fault if permission for this entity and user or group does not exist 4777 -group=false True, if principal refers to a group name; false, for a user name 4778 -i=false Use moref instead of inventory path 4779 -principal= User or group for which the permission is defined 4780 ``` 4781 4782 ## permissions.set 4783 4784 ``` 4785 Usage: govc permissions.set [OPTIONS] [PATH]... 4786 4787 Set the permissions managed entities. 4788 4789 Examples: 4790 govc permissions.set -principal root -role Admin 4791 govc permissions.set -principal $USER@vsphere.local -role Admin /dc1/host/cluster1 4792 4793 Options: 4794 -group=false True, if principal refers to a group name; false, for a user name 4795 -i=false Use moref instead of inventory path 4796 -principal= User or group for which the permission is defined 4797 -propagate=true Whether or not this permission propagates down the hierarchy to sub-entities 4798 -role=Admin Permission role name 4799 ``` 4800 4801 ## pool.change 4802 4803 ``` 4804 Usage: govc pool.change [OPTIONS] POOL... 4805 4806 Change the configuration of one or more resource POOLs. 4807 4808 POOL may be an absolute or relative path to a resource pool or a (clustered) 4809 compute host. If it resolves to a compute host, the associated root resource 4810 pool is returned. If a relative path is specified, it is resolved with respect 4811 to the current datacenter's "host" folder (i.e. /ha-datacenter/host). 4812 4813 Paths to nested resource pools must traverse through the root resource pool of 4814 the selected compute host, i.e. "compute-host/Resources/nested-pool". 4815 4816 The same globbing rules that apply to the "ls" command apply here. For example, 4817 POOL may be specified as "*/Resources/*" to expand to all resource pools that 4818 are nested one level under the root resource pool, on all (clustered) compute 4819 hosts in the current datacenter. 4820 4821 Options: 4822 -cpu.expandable=<nil> CPU expandable reservation 4823 -cpu.limit=<nil> CPU limit in MHz 4824 -cpu.reservation=<nil> CPU reservation in MHz 4825 -cpu.shares= CPU shares level or number 4826 -mem.expandable=<nil> Memory expandable reservation 4827 -mem.limit=<nil> Memory limit in MB 4828 -mem.reservation=<nil> Memory reservation in MB 4829 -mem.shares= Memory shares level or number 4830 -name= Resource pool name 4831 ``` 4832 4833 ## pool.create 4834 4835 ``` 4836 Usage: govc pool.create [OPTIONS] POOL... 4837 4838 Create one or more resource POOLs. 4839 4840 POOL may be an absolute or relative path to a resource pool. The parent of the 4841 specified POOL must be an existing resource pool. If a relative path is 4842 specified, it is resolved with respect to the current datacenter's "host" 4843 folder (i.e. /ha-datacenter/host). The basename of the specified POOL is used 4844 as the name for the new resource pool. 4845 4846 The same globbing rules that apply to the "ls" command apply here. For example, 4847 the path to the parent resource pool in POOL may be specified as "*/Resources" 4848 to expand to the root resource pools on all (clustered) compute hosts in the 4849 current datacenter. 4850 4851 For example: 4852 */Resources/test Create resource pool "test" on all (clustered) 4853 compute hosts in the current datacenter. 4854 somehost/Resources/*/nested Create resource pool "nested" in every 4855 resource pool that is a direct descendant of 4856 the root resource pool on "somehost". 4857 4858 Options: 4859 -cpu.expandable=true CPU expandable reservation 4860 -cpu.limit=-1 CPU limit in MHz 4861 -cpu.reservation=0 CPU reservation in MHz 4862 -cpu.shares=normal CPU shares level or number 4863 -mem.expandable=true Memory expandable reservation 4864 -mem.limit=-1 Memory limit in MB 4865 -mem.reservation=0 Memory reservation in MB 4866 -mem.shares=normal Memory shares level or number 4867 ``` 4868 4869 ## pool.destroy 4870 4871 ``` 4872 Usage: govc pool.destroy [OPTIONS] POOL... 4873 4874 Destroy one or more resource POOLs. 4875 4876 POOL may be an absolute or relative path to a resource pool or a (clustered) 4877 compute host. If it resolves to a compute host, the associated root resource 4878 pool is returned. If a relative path is specified, it is resolved with respect 4879 to the current datacenter's "host" folder (i.e. /ha-datacenter/host). 4880 4881 Paths to nested resource pools must traverse through the root resource pool of 4882 the selected compute host, i.e. "compute-host/Resources/nested-pool". 4883 4884 The same globbing rules that apply to the "ls" command apply here. For example, 4885 POOL may be specified as "*/Resources/*" to expand to all resource pools that 4886 are nested one level under the root resource pool, on all (clustered) compute 4887 hosts in the current datacenter. 4888 4889 Options: 4890 -children=false Remove all children pools 4891 ``` 4892 4893 ## pool.info 4894 4895 ``` 4896 Usage: govc pool.info [OPTIONS] POOL... 4897 4898 Retrieve information about one or more resource POOLs. 4899 4900 POOL may be an absolute or relative path to a resource pool or a (clustered) 4901 compute host. If it resolves to a compute host, the associated root resource 4902 pool is returned. If a relative path is specified, it is resolved with respect 4903 to the current datacenter's "host" folder (i.e. /ha-datacenter/host). 4904 4905 Paths to nested resource pools must traverse through the root resource pool of 4906 the selected compute host, i.e. "compute-host/Resources/nested-pool". 4907 4908 The same globbing rules that apply to the "ls" command apply here. For example, 4909 POOL may be specified as "*/Resources/*" to expand to all resource pools that 4910 are nested one level under the root resource pool, on all (clustered) compute 4911 hosts in the current datacenter. 4912 4913 Options: 4914 -a=false List virtual app resource pools 4915 -p=true List resource pools 4916 ``` 4917 4918 ## role.create 4919 4920 ``` 4921 Usage: govc role.create [OPTIONS] NAME [PRIVILEGE]... 4922 4923 Create authorization role. 4924 4925 Optionally populate the role with the given PRIVILEGE(s). 4926 4927 Examples: 4928 govc role.create MyRole 4929 govc role.create NoDC $(govc role.ls Admin | grep -v Datacenter.) 4930 4931 Options: 4932 -i=false Use moref instead of inventory path 4933 ``` 4934 4935 ## role.ls 4936 4937 ``` 4938 Usage: govc role.ls [OPTIONS] [NAME] 4939 4940 List authorization roles. 4941 4942 If NAME is provided, list privileges for the role. 4943 4944 Examples: 4945 govc role.ls 4946 govc role.ls Admin 4947 4948 Options: 4949 -i=false Use moref instead of inventory path 4950 ``` 4951 4952 ## role.remove 4953 4954 ``` 4955 Usage: govc role.remove [OPTIONS] NAME 4956 4957 Remove authorization role. 4958 4959 Examples: 4960 govc role.remove MyRole 4961 govc role.remove MyRole -force 4962 4963 Options: 4964 -force=false Force removal if role is in use 4965 -i=false Use moref instead of inventory path 4966 ``` 4967 4968 ## role.update 4969 4970 ``` 4971 Usage: govc role.update [OPTIONS] NAME [PRIVILEGE]... 4972 4973 Update authorization role. 4974 4975 Set, Add or Remove role PRIVILEGE(s). 4976 4977 Examples: 4978 govc role.update MyRole $(govc role.ls Admin | grep VirtualMachine.) 4979 govc role.update -r MyRole $(govc role.ls Admin | grep VirtualMachine.GuestOperations.) 4980 govc role.update -a MyRole $(govc role.ls Admin | grep Datastore.) 4981 govc role.update -name RockNRole MyRole 4982 4983 Options: 4984 -a=false Add given PRIVILEGE(s) 4985 -i=false Use moref instead of inventory path 4986 -name= Change role name 4987 -r=false Remove given PRIVILEGE(s) 4988 ``` 4989 4990 ## role.usage 4991 4992 ``` 4993 Usage: govc role.usage [OPTIONS] NAME... 4994 4995 List usage for role NAME. 4996 4997 Examples: 4998 govc role.usage 4999 govc role.usage Admin 5000 5001 Options: 5002 -i=false Use moref instead of inventory path 5003 ``` 5004 5005 ## session.login 5006 5007 ``` 5008 Usage: govc session.login [OPTIONS] [PATH] 5009 5010 Session login. 5011 5012 The session.login command is optional, all other govc commands will auto login when given credentials. 5013 The session.login command can be used to: 5014 - Persist a session without writing to disk via the '-cookie' flag 5015 - Acquire a clone ticket 5016 - Login using a clone ticket 5017 - Login using a vCenter Extension certificate 5018 - Issue a SAML token 5019 - Renew a SAML token 5020 - Login using a SAML token 5021 - Avoid passing credentials to other govc commands 5022 - Send an authenticated raw HTTP request 5023 5024 The session.login command can be used for authenticated curl-style HTTP requests when a PATH arg is given. 5025 PATH may also contain a query string. The '-u' flag (GOVC_URL) is used for the URL scheme, host and port. 5026 The request method (-X) defaults to GET. When set to POST, PUT or PATCH, a request body must be provided via stdin. 5027 5028 Examples: 5029 govc session.login -u root:password@host # Creates a cached session in ~/.govmomi/sessions 5030 govc session.ls -u root@host # Use the cached session with another command 5031 ticket=$(govc session.login -u root@host -clone) 5032 govc session.login -u root@host -ticket $ticket 5033 govc session.login -u host -extension com.vmware.vsan.health -cert rui.crt -key rui.key 5034 token=$(govc session.login -u host -cert user.crt -key user.key -issue) # HoK token 5035 bearer=$(govc session.login -u user:pass@host -issue) # Bearer token 5036 token=$(govc session.login -u host -cert user.crt -key user.key -issue -token "$bearer") 5037 govc session.login -u host -cert user.crt -key user.key -token "$token" 5038 token=$(govc session.login -u host -cert user.crt -key user.key -renew -lifetime 24h -token "$token") 5039 # HTTP requests 5040 govc session.login -r -X GET /api/vcenter/namespace-management/clusters | jq . 5041 govc session.login -r -X POST /rest/vcenter/cluster/modules <<<'{"spec": {"cluster": "domain-c9"}}' 5042 5043 Options: 5044 -X= HTTP method 5045 -clone=false Acquire clone ticket 5046 -cookie= Set HTTP cookie for an existing session 5047 -extension= Extension name 5048 -issue=false Issue SAML token 5049 -l=false Output session cookie 5050 -lifetime=10m0s SAML token lifetime 5051 -r=false REST login 5052 -renew=false Renew SAML token 5053 -ticket= Use clone ticket for login 5054 -token= Use SAML token for login or as issue identity 5055 ``` 5056 5057 ## session.logout 5058 5059 ``` 5060 Usage: govc session.logout [OPTIONS] 5061 5062 Logout the current session. 5063 5064 The session.logout command can be used to end the current persisted session. 5065 The session.rm command can be used to remove sessions other than the current session. 5066 5067 Examples: 5068 govc session.logout 5069 5070 Options: 5071 -r=false REST logout 5072 ``` 5073 5074 ## session.ls 5075 5076 ``` 5077 Usage: govc session.ls [OPTIONS] 5078 5079 List active sessions. 5080 5081 All SOAP sessions are listed by default. The '-S' flag will limit this list to the current session. 5082 5083 Examples: 5084 govc session.ls 5085 govc session.ls -json | jq -r .currentSession.key 5086 5087 Options: 5088 -S=false List current SOAP session 5089 -r=false List cached REST session (if any) 5090 ``` 5091 5092 ## session.rm 5093 5094 ``` 5095 Usage: govc session.rm [OPTIONS] KEY... 5096 5097 Remove active sessions. 5098 5099 Examples: 5100 govc session.ls | grep root 5101 govc session.rm 5279e245-e6f1-4533-4455-eb94353b213a 5102 5103 Options: 5104 ``` 5105 5106 ## snapshot.create 5107 5108 ``` 5109 Usage: govc snapshot.create [OPTIONS] NAME 5110 5111 Create snapshot of VM with NAME. 5112 5113 Examples: 5114 govc snapshot.create -vm my-vm happy-vm-state 5115 5116 Options: 5117 -d= Snapshot description 5118 -m=true Include memory state 5119 -q=false Quiesce guest file system 5120 -vm= Virtual machine [GOVC_VM] 5121 ``` 5122 5123 ## snapshot.remove 5124 5125 ``` 5126 Usage: govc snapshot.remove [OPTIONS] NAME 5127 5128 Remove snapshot of VM with given NAME. 5129 5130 NAME can be the snapshot name, tree path, moid or '*' to remove all snapshots. 5131 5132 Examples: 5133 govc snapshot.remove -vm my-vm happy-vm-state 5134 5135 Options: 5136 -c=true Consolidate disks 5137 -r=false Remove snapshot children 5138 -vm= Virtual machine [GOVC_VM] 5139 ``` 5140 5141 ## snapshot.revert 5142 5143 ``` 5144 Usage: govc snapshot.revert [OPTIONS] [NAME] 5145 5146 Revert to snapshot of VM with given NAME. 5147 5148 If NAME is not provided, revert to the current snapshot. 5149 Otherwise, NAME can be the snapshot name, tree path or moid. 5150 5151 Examples: 5152 govc snapshot.revert -vm my-vm happy-vm-state 5153 5154 Options: 5155 -s=false Suppress power on 5156 -vm= Virtual machine [GOVC_VM] 5157 ``` 5158 5159 ## snapshot.tree 5160 5161 ``` 5162 Usage: govc snapshot.tree [OPTIONS] 5163 5164 List VM snapshots in a tree-like format. 5165 5166 The command will exit 0 with no output if VM does not have any snapshots. 5167 5168 Examples: 5169 govc snapshot.tree -vm my-vm 5170 govc snapshot.tree -vm my-vm -D -i -d 5171 5172 Options: 5173 -C=false Print the current snapshot name only 5174 -D=false Print the snapshot creation date 5175 -c=true Print the current snapshot 5176 -d=false Print the snapshot description 5177 -f=false Print the full path prefix for snapshot 5178 -i=false Print the snapshot id 5179 -s=false Print the snapshot size 5180 -vm= Virtual machine [GOVC_VM] 5181 ``` 5182 5183 ## sso.group.create 5184 5185 ``` 5186 Usage: govc sso.group.create [OPTIONS] NAME 5187 5188 Create SSO group. 5189 5190 Examples: 5191 govc sso.group.create NAME 5192 5193 Options: 5194 -d= Group description 5195 ``` 5196 5197 ## sso.group.ls 5198 5199 ``` 5200 Usage: govc sso.group.ls [OPTIONS] [NAME] 5201 5202 List SSO groups. 5203 5204 Examples: 5205 govc sso.group.ls 5206 govc sso.group.ls group-name # list groups in group-name 5207 govc sso.group.ls -search Admin # search for groups 5208 5209 Options: 5210 -search= Search 5211 ``` 5212 5213 ## sso.group.rm 5214 5215 ``` 5216 Usage: govc sso.group.rm [OPTIONS] NAME 5217 5218 Remove SSO group. 5219 5220 Examples: 5221 govc sso.group.rm NAME 5222 5223 Options: 5224 ``` 5225 5226 ## sso.group.update 5227 5228 ``` 5229 Usage: govc sso.group.update [OPTIONS] 5230 5231 Update SSO group. 5232 5233 Examples: 5234 govc sso.group.update -d "Group description" NAME 5235 govc sso.group.update -a user1 NAME 5236 govc sso.group.update -r user2 NAME 5237 govc sso.group.update -g -a group1 NAME 5238 govc sso.group.update -g -r group2 NAME 5239 5240 Options: 5241 -a= Add user/group to group 5242 -d= Group description 5243 -g=false Add/Remove group from group 5244 -r= Remove user/group from group 5245 ``` 5246 5247 ## sso.idp.default.ls 5248 5249 ``` 5250 Usage: govc sso.idp.default.ls [OPTIONS] 5251 5252 List SSO default identity provider sources. 5253 5254 Examples: 5255 govc sso.idp.default.ls 5256 govc sso.idp.default.ls -json 5257 5258 Options: 5259 ``` 5260 5261 ## sso.idp.default.update 5262 5263 ``` 5264 Usage: govc sso.idp.default.update [OPTIONS] NAME 5265 5266 Set SSO default identity provider source. 5267 5268 Examples: 5269 govc sso.idp.default.update NAME 5270 5271 Options: 5272 ``` 5273 5274 ## sso.idp.ldap.update 5275 5276 ``` 5277 Usage: govc sso.idp.ldap.update [OPTIONS] NAME 5278 5279 Update SSO ldap identity provider source. 5280 5281 Examples: 5282 govc sso.idp.ldap.update -FriendlyName CORPLOCAL corp.local 5283 5284 Options: 5285 -AuthPassword= Password 5286 -AuthUsername= Username 5287 -DomainAlias= DomainAlias 5288 -FailoverUrl= FailoverUrl 5289 -FriendlyName= FriendlyName 5290 -GroupBaseDn= GroupBaseDn 5291 -PrimaryUrl= PrimaryUrl 5292 -ServerType=ActiveDirectory ServerType 5293 -UserBaseDn= UserBaseDn 5294 ``` 5295 5296 ## sso.idp.ls 5297 5298 ``` 5299 Usage: govc sso.idp.ls [OPTIONS] 5300 5301 List SSO identity provider sources. 5302 5303 Examples: 5304 govc sso.idp.ls 5305 govc sso.idp.ls -json 5306 5307 Options: 5308 ``` 5309 5310 ## sso.lpp.info 5311 5312 ``` 5313 Usage: govc sso.lpp.info [OPTIONS] 5314 5315 Get SSO local password policy. 5316 5317 Examples: 5318 govc sso.lpp.info 5319 govc sso.lpp.info -json 5320 5321 Options: 5322 ``` 5323 5324 ## sso.lpp.update 5325 5326 ``` 5327 Usage: govc sso.lpp.update [OPTIONS] NAME 5328 5329 Update SSO local password policy. 5330 5331 Examples: 5332 govc sso.lpp.update -PasswordLifetimeDays 0 5333 5334 Options: 5335 -Description= Description 5336 -MaxIdenticalAdjacentCharacters=0 Maximum identical adjacent characters 5337 -MaxLength=0 Maximum length 5338 -MinAlphabeticCount=<nil> Minimum alphabetic count 5339 -MinLength=<nil> Minimim length 5340 -MinLowercaseCount=<nil> Minimum lowercase count 5341 -MinNumericCount=<nil> Minimum numeric count 5342 -MinSpecialCharCount=<nil> Minimum special characters count 5343 -MinUppercaseCount=<nil> Minimum uppercase count 5344 -PasswordLifetimeDays=<nil> Password lifetime days 5345 -ProhibitedPreviousPasswordsCount=0 Prohibited previous passwords count 5346 ``` 5347 5348 ## sso.service.ls 5349 5350 ``` 5351 Usage: govc sso.service.ls [OPTIONS] 5352 5353 List platform services. 5354 5355 Examples: 5356 govc sso.service.ls 5357 govc sso.service.ls -t vcenterserver -P vmomi 5358 govc sso.service.ls -t cs.identity 5359 govc sso.service.ls -t cs.identity -P wsTrust -U 5360 govc sso.service.ls -t cs.identity -json | jq -r .[].ServiceEndpoints[].Url 5361 5362 Options: 5363 -P= Endpoint protocol 5364 -T= Endpoint type 5365 -U=false List endpoint URL(s) only 5366 -l=false Long listing format 5367 -n= Node ID 5368 -p= Service product 5369 -s= Site ID 5370 -t= Service type 5371 ``` 5372 5373 ## sso.user.create 5374 5375 ``` 5376 Usage: govc sso.user.create [OPTIONS] NAME 5377 5378 Create SSO users. 5379 5380 Examples: 5381 govc sso.user.create -C "$(cat cert.pem)" -A -R Administrator NAME # solution user 5382 govc sso.user.create -p password NAME # person user 5383 5384 Options: 5385 -A=<nil> ActAsUser role for solution user WSTrust 5386 -C= Certificate for solution user 5387 -R= Role for solution user (RegularUser|Administrator) 5388 -d= User description 5389 -f= First name 5390 -l= Last name 5391 -m= Email address 5392 -p= Password 5393 ``` 5394 5395 ## sso.user.id 5396 5397 ``` 5398 Usage: govc sso.user.id [OPTIONS] NAME 5399 5400 Print SSO user and group IDs. 5401 5402 Examples: 5403 govc sso.user.id 5404 govc sso.user.id Administrator 5405 govc sso.user.id -json Administrator 5406 5407 Options: 5408 ``` 5409 5410 ## sso.user.ls 5411 5412 ``` 5413 Usage: govc sso.user.ls [OPTIONS] 5414 5415 List SSO users. 5416 5417 Examples: 5418 govc sso.user.ls -s 5419 govc sso.user.ls -group group-name 5420 5421 Options: 5422 -group=false List users in group 5423 -s=false List solution users 5424 -search= Search users in group 5425 ``` 5426 5427 ## sso.user.rm 5428 5429 ``` 5430 Usage: govc sso.user.rm [OPTIONS] NAME 5431 5432 Remove SSO users. 5433 5434 Examples: 5435 govc sso.user.rm NAME 5436 5437 Options: 5438 ``` 5439 5440 ## sso.user.update 5441 5442 ``` 5443 Usage: govc sso.user.update [OPTIONS] NAME 5444 5445 Update SSO users. 5446 5447 Examples: 5448 govc sso.user.update -C "$(cat cert.pem)" NAME 5449 govc sso.user.update -p password NAME 5450 5451 Options: 5452 -A=<nil> ActAsUser role for solution user WSTrust 5453 -C= Certificate for solution user 5454 -R= Role for solution user (RegularUser|Administrator) 5455 -d= User description 5456 -f= First name 5457 -l= Last name 5458 -m= Email address 5459 -p= Password 5460 ``` 5461 5462 ## storage.policy.create 5463 5464 ``` 5465 Usage: govc storage.policy.create [OPTIONS] NAME 5466 5467 Create VM Storage Policy. 5468 5469 Examples: 5470 govc storage.policy.create -category my_cat -tag my_tag MyStoragePolicy # Tag based placement 5471 5472 Options: 5473 -category= Category 5474 -d= Description 5475 -tag= Tag 5476 ``` 5477 5478 ## storage.policy.info 5479 5480 ``` 5481 Usage: govc storage.policy.info [OPTIONS] [NAME] 5482 5483 VM Storage Policy info. 5484 5485 Examples: 5486 govc storage.policy.info 5487 govc storage.policy.info "vSAN Default Storage Policy" 5488 govc storage.policy.info -c -s 5489 5490 Options: 5491 -c=false Check VM Compliance 5492 -s=false Check Storage Compatibility 5493 ``` 5494 5495 ## storage.policy.ls 5496 5497 ``` 5498 Usage: govc storage.policy.ls [OPTIONS] [NAME] 5499 5500 VM Storage Policy listing. 5501 5502 Examples: 5503 govc storage.policy.ls 5504 govc storage.policy.ls "vSAN Default Storage Policy" 5505 govc storage.policy.ls -i "vSAN Default Storage Policy" 5506 5507 Options: 5508 -i=false List policy ID only 5509 ``` 5510 5511 ## storage.policy.rm 5512 5513 ``` 5514 Usage: govc storage.policy.rm [OPTIONS] ID 5515 5516 Remove Storage Policy ID. 5517 5518 Examples: 5519 govc storage.policy.rm "my policy name" 5520 govc storage.policy.rm af7935ab-466d-4b0e-af3c-4ec6bce2112f 5521 5522 Options: 5523 ``` 5524 5525 ## tags.attach 5526 5527 ``` 5528 Usage: govc tags.attach [OPTIONS] NAME PATH 5529 5530 Attach tag NAME to object PATH. 5531 5532 Examples: 5533 govc tags.attach k8s-region-us /dc1 5534 govc tags.attach -c k8s-region us-ca1 /dc1/host/cluster1 5535 5536 Options: 5537 -c= Tag category 5538 ``` 5539 5540 ## tags.attached.ls 5541 5542 ``` 5543 Usage: govc tags.attached.ls [OPTIONS] NAME 5544 5545 List attached tags or objects. 5546 5547 Examples: 5548 govc tags.attached.ls k8s-region-us 5549 govc tags.attached.ls -json k8s-zone-us-ca1 | jq . 5550 govc tags.attached.ls -r /dc1/host/cluster1 5551 govc tags.attached.ls -json -r /dc1 | jq . 5552 5553 Options: 5554 -l=false Long listing format 5555 -r=false List tags attached to resource 5556 ``` 5557 5558 ## tags.category.create 5559 5560 ``` 5561 Usage: govc tags.category.create [OPTIONS] NAME 5562 5563 Create tag category. 5564 5565 This command will output the ID of the new tag category. 5566 5567 Examples: 5568 govc tags.category.create -d "Kubernetes region" -t Datacenter k8s-region 5569 govc tags.category.create -d "Kubernetes zone" k8s-zone 5570 5571 Options: 5572 -d= Description 5573 -m=false Allow multiple tags per object 5574 -t=[] Object types 5575 ``` 5576 5577 ## tags.category.info 5578 5579 ``` 5580 Usage: govc tags.category.info [OPTIONS] [NAME] 5581 5582 Display category info. 5583 5584 If NAME is provided, display info for only that category. 5585 Otherwise display info for all categories. 5586 5587 Examples: 5588 govc tags.category.info 5589 govc tags.category.info k8s-zone 5590 5591 Options: 5592 ``` 5593 5594 ## tags.category.ls 5595 5596 ``` 5597 Usage: govc tags.category.ls [OPTIONS] 5598 5599 List all categories. 5600 5601 Examples: 5602 govc tags.category.ls 5603 govc tags.category.ls -json | jq . 5604 5605 Options: 5606 ``` 5607 5608 ## tags.category.rm 5609 5610 ``` 5611 Usage: govc tags.category.rm [OPTIONS] NAME 5612 5613 Delete category NAME. 5614 5615 Fails if category is used by any tag, unless the '-f' flag is provided. 5616 5617 Examples: 5618 govc tags.category.rm k8s-region 5619 govc tags.category.rm -f k8s-zone 5620 5621 Options: 5622 -f=false Delete tag regardless of attached objects 5623 ``` 5624 5625 ## tags.category.update 5626 5627 ``` 5628 Usage: govc tags.category.update [OPTIONS] NAME 5629 5630 Update category. 5631 5632 The '-t' flag can only be used to add new object types. Removing category types is not supported by vCenter. 5633 5634 Examples: 5635 govc tags.category.update -n k8s-vcp-region -d "Kubernetes VCP region" k8s-region 5636 govc tags.category.update -t ClusterComputeResource k8s-zone 5637 5638 Options: 5639 -d= Description 5640 -m=<nil> Allow multiple tags per object 5641 -n= Name of category 5642 -t=[] Object types 5643 ``` 5644 5645 ## tags.create 5646 5647 ``` 5648 Usage: govc tags.create [OPTIONS] NAME 5649 5650 Create tag. 5651 5652 The '-c' option to specify a tag category is required. 5653 This command will output the ID of the new tag. 5654 5655 Examples: 5656 govc tags.create -d "Kubernetes Zone US CA1" -c k8s-zone k8s-zone-us-ca1 5657 5658 Options: 5659 -c= Category name 5660 -d= Description of tag 5661 ``` 5662 5663 ## tags.detach 5664 5665 ``` 5666 Usage: govc tags.detach [OPTIONS] NAME PATH 5667 5668 Detach tag NAME from object PATH. 5669 5670 Examples: 5671 govc tags.detach k8s-region-us /dc1 5672 govc tags.detach -c k8s-region us-ca1 /dc1/host/cluster1 5673 5674 Options: 5675 -c= Tag category 5676 ``` 5677 5678 ## tags.info 5679 5680 ``` 5681 Usage: govc tags.info [OPTIONS] NAME 5682 5683 Display tags info. 5684 5685 If NAME is provided, display info for only that tag. Otherwise display info for all tags. 5686 5687 Examples: 5688 govc tags.info 5689 govc tags.info k8s-zone-us-ca1 5690 govc tags.info -c k8s-zone 5691 5692 Options: 5693 -C=true Display category name instead of ID 5694 -c= Category name 5695 ``` 5696 5697 ## tags.ls 5698 5699 ``` 5700 Usage: govc tags.ls [OPTIONS] 5701 5702 List tags. 5703 5704 Examples: 5705 govc tags.ls 5706 govc tags.ls -c k8s-zone 5707 govc tags.ls -json | jq . 5708 govc tags.ls -c k8s-region -json | jq . 5709 5710 Options: 5711 -c= Category name 5712 ``` 5713 5714 ## tags.rm 5715 5716 ``` 5717 Usage: govc tags.rm [OPTIONS] NAME 5718 5719 Delete tag NAME. 5720 5721 Fails if tag is attached to any object, unless the '-f' flag is provided. 5722 5723 Examples: 5724 govc tags.rm k8s-zone-us-ca1 5725 govc tags.rm -f -c k8s-zone us-ca2 5726 5727 Options: 5728 -c= Tag category 5729 -f=false Delete tag regardless of attached objects 5730 ``` 5731 5732 ## tags.update 5733 5734 ``` 5735 Usage: govc tags.update [OPTIONS] NAME 5736 5737 Update tag. 5738 5739 Examples: 5740 govc tags.update -d "K8s zone US-CA1" k8s-zone-us-ca1 5741 govc tags.update -d "K8s zone US-CA1" -c k8s-zone us-ca1 5742 5743 Options: 5744 -c= Tag category 5745 -d= Description of tag 5746 -n= Name of tag 5747 ``` 5748 5749 ## task.cancel 5750 5751 ``` 5752 Usage: govc task.cancel [OPTIONS] ID... 5753 5754 Cancel tasks. 5755 5756 Examples: 5757 govc task.cancel task-759 5758 5759 Options: 5760 ``` 5761 5762 ## tasks 5763 5764 ``` 5765 Usage: govc tasks [OPTIONS] [PATH] 5766 5767 Display info for recent tasks. 5768 5769 When a task has completed, the result column includes the task duration on success or 5770 error message on failure. If a task is still in progress, the result column displays 5771 the completion percentage and the task ID. The task ID can be used as an argument to 5772 the 'task.cancel' command. 5773 5774 By default, all recent tasks are included (via TaskManager), but can be limited by PATH 5775 to a specific inventory object. 5776 5777 Examples: 5778 govc tasks # tasks completed within the past 10 minutes 5779 govc tasks -b 24h # tasks completed within the past 24 hours 5780 govc tasks -s queued -s running # incomplete tasks 5781 govc tasks -s error -s success # completed tasks 5782 govc tasks -r /dc1/vm/Namespaces # tasks for VMs in this Folder only 5783 govc tasks -f 5784 govc tasks -f /dc1/host/cluster1 5785 5786 Options: 5787 -b=0s Begin time of task history 5788 -e=0s End time of task history 5789 -f=false Follow recent task updates 5790 -l=false Use long task description 5791 -n=25 Output the last N tasks 5792 -r=false Include child entities when PATH is specified 5793 -s=[] Task states 5794 ``` 5795 5796 ## tree 5797 5798 ``` 5799 Usage: govc tree [OPTIONS] [PATH] 5800 5801 List contents of the inventory in a tree-like format. 5802 5803 Examples: 5804 govc tree -C / 5805 govc tree /datacenter/vm 5806 5807 Options: 5808 -C=false Colorize output 5809 -L=0 Max display depth of the inventory tree 5810 -l=false Follow runtime references (e.g. HostSystem VMs) 5811 -p=false Print the object type 5812 ``` 5813 5814 ## vapp.destroy 5815 5816 ``` 5817 Usage: govc vapp.destroy [OPTIONS] VAPP... 5818 5819 Options: 5820 ``` 5821 5822 ## vapp.power 5823 5824 ``` 5825 Usage: govc vapp.power [OPTIONS] 5826 5827 Options: 5828 -force=false Force (If force is false, the shutdown order in the vApp is executed. If force is true, all virtual machines are powered-off (regardless of shutdown order)) 5829 -off=false Power off 5830 -on=false Power on 5831 -suspend=false Power suspend 5832 -vapp.ipath= Find vapp by inventory path 5833 ``` 5834 5835 ## vcsa.access.consolecli.get 5836 5837 ``` 5838 Usage: govc vcsa.access.consolecli.get [OPTIONS] 5839 5840 Get enabled state of the console-based controlled CLI (TTY1). 5841 5842 Note: This command requires vCenter 7.0.2 or higher. 5843 5844 Examples: 5845 govc vcsa.access.consolecli.get 5846 5847 Options: 5848 ``` 5849 5850 ## vcsa.access.consolecli.set 5851 5852 ``` 5853 Usage: govc vcsa.access.consolecli.set [OPTIONS] 5854 5855 Set enabled state of the console-based controlled CLI (TTY1). 5856 5857 Note: This command requires vCenter 7.0.2 or higher. 5858 5859 Examples: 5860 # Enable Console CLI 5861 govc vcsa.access.consolecli.set -enabled=true 5862 5863 # Disable Console CLI 5864 govc vcsa.access.consolecli.set -enabled=false 5865 5866 Options: 5867 -enabled=false Enable Console CLI. 5868 ``` 5869 5870 ## vcsa.access.dcui.get 5871 5872 ``` 5873 Usage: govc vcsa.access.dcui.get [OPTIONS] 5874 5875 Get enabled state of Direct Console User Interface (DCUI TTY2). 5876 5877 Note: This command requires vCenter 7.0.2 or higher. 5878 5879 Examples: 5880 govc vcsa.access.dcui.get 5881 5882 Options: 5883 ``` 5884 5885 ## vcsa.access.dcui.set 5886 5887 ``` 5888 Usage: govc vcsa.access.dcui.set [OPTIONS] 5889 5890 Set enabled state of Direct Console User Interface (DCUI TTY2). 5891 5892 Note: This command requires vCenter 7.0.2 or higher. 5893 5894 Examples: 5895 # Enable DCUI 5896 govc vcsa.access.dcui.set -enabled=true 5897 5898 # Disable DCUI 5899 govc vcsa.access.dcui.set -enabled=false 5900 5901 Options: 5902 -enabled=false Enable Direct Console User Interface (DCUI TTY2). 5903 ``` 5904 5905 ## vcsa.access.shell.get 5906 5907 ``` 5908 Usage: govc vcsa.access.shell.get [OPTIONS] 5909 5910 Get enabled state of BASH, that is, access to BASH from within the controlled CLI. 5911 5912 Note: This command requires vCenter 7.0.2 or higher. 5913 5914 Examples: 5915 govc vcsa.access.shell.get 5916 5917 Options: 5918 ``` 5919 5920 ## vcsa.access.shell.set 5921 5922 ``` 5923 Usage: govc vcsa.access.shell.set [OPTIONS] 5924 5925 Set enabled state of BASH, that is, access to BASH from within the controlled CLI. 5926 5927 Note: This command requires vCenter 7.0.2 or higher. 5928 5929 Examples: 5930 # Enable Shell 5931 govc vcsa.access.shell.set -enabled=true -timeout=240 5932 5933 # Disable Shell 5934 govc vcsa.access.shell.set -enabled=false 5935 5936 Options: 5937 -enabled=false Enable BASH, that is, access to BASH from within the controlled CLI. 5938 -timeout=0 The timeout (in seconds) specifies how long you enable the Shell access. The maximum timeout is 86400 seconds(1 day). 5939 ``` 5940 5941 ## vcsa.access.ssh.get 5942 5943 ``` 5944 Usage: govc vcsa.access.ssh.get [OPTIONS] 5945 5946 Get enabled state of the SSH-based controlled CLI. 5947 5948 Note: This command requires vCenter 7.0.2 or higher. 5949 5950 Examples: 5951 govc vcsa.access.ssh.get 5952 5953 Options: 5954 ``` 5955 5956 ## vcsa.access.ssh.set 5957 5958 ``` 5959 Usage: govc vcsa.access.ssh.set [OPTIONS] 5960 5961 Set enabled state of the SSH-based controlled CLI. 5962 5963 Note: This command requires vCenter 7.0.2 or higher. 5964 5965 Examples: 5966 # Enable SSH 5967 govc vcsa.access.ssh.set -enabled=true 5968 5969 # Disable SSH 5970 govc vcsa.access.ssh.set -enabled=false 5971 5972 Options: 5973 -enabled=false Enable SSH-based controlled CLI. 5974 ``` 5975 5976 ## vcsa.log.forwarding.info 5977 5978 ``` 5979 Usage: govc vcsa.log.forwarding.info [OPTIONS] 5980 5981 Retrieve the VC Appliance log forwarding configuration 5982 5983 Examples: 5984 govc vcsa.log.forwarding.info 5985 5986 Options: 5987 ``` 5988 5989 ## vcsa.net.proxy.info 5990 5991 ``` 5992 Usage: govc vcsa.net.proxy.info [OPTIONS] 5993 5994 Retrieve the VC networking proxy configuration 5995 5996 Examples: 5997 govc vcsa.net.proxy.info 5998 5999 Options: 6000 ``` 6001 6002 ## vcsa.shutdown.cancel 6003 6004 ``` 6005 Usage: govc vcsa.shutdown.cancel [OPTIONS] 6006 6007 Cancel pending shutdown action. 6008 6009 Note: This command requires vCenter 7.0.2 or higher. 6010 6011 Examples: 6012 govc vcsa.shutdown.cancel 6013 6014 Options: 6015 ``` 6016 6017 ## vcsa.shutdown.get 6018 6019 ``` 6020 Usage: govc vcsa.shutdown.get [OPTIONS] 6021 6022 Get details about the pending shutdown action. 6023 6024 Note: This command requires vCenter 7.0.2 or higher. 6025 6026 Examples: 6027 govc vcsa.shutdown.get 6028 6029 Options: 6030 ``` 6031 6032 ## vcsa.shutdown.poweroff 6033 6034 ``` 6035 Usage: govc vcsa.shutdown.poweroff [OPTIONS] REASON 6036 6037 Power off the appliance. 6038 6039 Note: This command requires vCenter 7.0.2 or higher. 6040 6041 Examples: 6042 govc vcsa.shutdown.poweroff -delay 10 "powering off for maintenance" 6043 6044 Options: 6045 -delay=0 Minutes after which poweroff should start. 6046 ``` 6047 6048 ## vcsa.shutdown.reboot 6049 6050 ``` 6051 Usage: govc vcsa.shutdown.reboot [OPTIONS] REASON 6052 6053 Reboot the appliance. 6054 6055 Note: This command requires vCenter 7.0.2 or higher. 6056 6057 Examples: 6058 govc vcsa.shutdown.reboot -delay 10 "rebooting for maintenance" 6059 6060 Options: 6061 -delay=0 Minutes after which reboot should start. 6062 ``` 6063 6064 ## version 6065 6066 ``` 6067 Usage: govc version [OPTIONS] 6068 6069 Options: 6070 -l=false Print detailed govc version information 6071 -require= Require govc version >= this value 6072 ``` 6073 6074 ## vlcm.depot.baseimages.ls 6075 6076 ``` 6077 Usage: govc vlcm.depot.baseimages.ls [OPTIONS] VLCM 6078 6079 Displays the list of available ESXi base images. 6080 6081 Examples: 6082 govc vlcm.depot.baseimages.ls 6083 6084 Options: 6085 ``` 6086 6087 ## vlcm.depot.offline.create 6088 6089 ``` 6090 Usage: govc vlcm.depot.offline.create [OPTIONS] VLCM 6091 6092 Creates an offline image depot. 6093 6094 Execution will block the terminal for the duration of the task. 6095 6096 Examples: 6097 govc vlcm.depot.offline.create -l=<https://your.server.com/filepath> 6098 govc vlcm.depot.offline.create -l=<https://your.server.com/filepath> -source-type=PULL 6099 govc vlcm.depot.offline.create -file-id=<your file identifier> -source-type=PUSH 6100 govc vlcm.depot.offline.create -l=<https://your.server.com/filepath> -source-type=PULL -d="This is a depot used for testing" -owner-data="After all, why not? Why shouldn't I keep it?" 6101 6102 Options: 6103 -d= An optional description 6104 -file-id= File identifier. Only used when source-type is PUSH 6105 -l= The URL to the depot contents. Only applicable when source-type is PULL 6106 -owner-data= Optional data about the depot's owner 6107 -source-type=PULL The depot source type. The default is PULL 6108 ``` 6109 6110 ## vlcm.depot.offline.info 6111 6112 ``` 6113 Usage: govc vlcm.depot.offline.info [OPTIONS] VLCM 6114 6115 Displays the contents of an offline image depot. 6116 6117 Examples: 6118 govc vlcm.depot.offline.info -depot-id=<your depot's identifier> 6119 6120 Options: 6121 -depot-id= The identifier of the depot. Use the 'ls' command to see the list of depots. 6122 ``` 6123 6124 ## vlcm.depot.offline.ls 6125 6126 ``` 6127 Usage: govc vlcm.depot.offline.ls [OPTIONS] VLCM 6128 6129 Displays the list of offline image depots. 6130 6131 Examples: 6132 govc vlcm.depot.offline.ls 6133 6134 Options: 6135 ``` 6136 6137 ## vlcm.depot.offline.rm 6138 6139 ``` 6140 Usage: govc vlcm.depot.offline.rm [OPTIONS] VLCM 6141 6142 Deletes an offline image depot. 6143 6144 Execution will block the terminal for the duration of the task. 6145 6146 Examples: 6147 govc vlcm.depot.offline.rm -depot-id=<your depot's identifier> 6148 6149 Options: 6150 -depot-id= The identifier of the depot. Use the 'ls' command to see the list of depots. 6151 ``` 6152 6153 ## vm.change 6154 6155 ``` 6156 Usage: govc vm.change [OPTIONS] 6157 6158 Change VM configuration. 6159 6160 To add ExtraConfig variables that can read within the guest, use the 'guestinfo.' prefix. 6161 6162 Examples: 6163 govc vm.change -vm $vm -mem.reservation 2048 6164 govc vm.change -vm $vm -e smc.present=TRUE -e ich7m.present=TRUE 6165 # Enable both cpu and memory hotplug on a guest: 6166 govc vm.change -vm $vm -cpu-hot-add-enabled -memory-hot-add-enabled 6167 govc vm.change -vm $vm -e guestinfo.vmname $vm 6168 # Read the contents of a file and use them as ExtraConfig value 6169 govc vm.change -vm $vm -f guestinfo.data="$(realpath .)/vmdata.config" 6170 # Read the variable set above inside the guest: 6171 vmware-rpctool "info-get guestinfo.vmname" 6172 govc vm.change -vm $vm -latency high 6173 govc vm.change -vm $vm -latency normal 6174 govc vm.change -vm $vm -uuid 4139c345-7186-4924-a842-36b69a24159b 6175 govc vm.change -vm $vm -scheduled-hw-upgrade-policy always 6176 6177 Options: 6178 -annotation= VM description 6179 -c=0 Number of CPUs 6180 -cpu-hot-add-enabled=<nil> Enable CPU hot add 6181 -cpu.limit=<nil> CPU limit in MHz 6182 -cpu.reservation=<nil> CPU reservation in MHz 6183 -cpu.shares= CPU shares level or number 6184 -e=[] ExtraConfig. <key>=<value> 6185 -f=[] ExtraConfig. <key>=<absolute path to file> 6186 -g= Guest OS 6187 -iommu-enabled=<nil> Enable IOMMU 6188 -latency= Latency sensitivity (low|normal|high) 6189 -m=0 Size in MB of memory 6190 -mem.limit=<nil> Memory limit in MB 6191 -mem.reservation=<nil> Memory reservation in MB 6192 -mem.shares= Memory shares level or number 6193 -memory-hot-add-enabled=<nil> Enable memory hot add 6194 -memory-pin=<nil> Reserve all guest memory 6195 -name= Display name 6196 -nested-hv-enabled=<nil> Enable nested hardware-assisted virtualization 6197 -scheduled-hw-upgrade-policy= Schedule hardware upgrade policy (onSoftPowerOff|never|always) 6198 -sync-time-with-host=<nil> Enable SyncTimeWithHost 6199 -uuid= BIOS UUID 6200 -vm= Virtual machine [GOVC_VM] 6201 -vpmc-enabled=<nil> Enable CPU performance counters 6202 ``` 6203 6204 ## vm.clone 6205 6206 ``` 6207 Usage: govc vm.clone [OPTIONS] NAME 6208 6209 Clone VM or template to NAME. 6210 6211 Examples: 6212 govc vm.clone -vm template-vm new-vm 6213 govc vm.clone -vm template-vm -link new-vm 6214 govc vm.clone -vm template-vm -snapshot s-name new-vm 6215 govc vm.clone -vm template-vm -link -snapshot s-name new-vm 6216 govc vm.clone -vm template-vm -cluster cluster1 new-vm # use compute cluster placement 6217 govc vm.clone -vm template-vm -datastore-cluster dscluster new-vm # use datastore cluster placement 6218 govc vm.clone -vm template-vm -snapshot $(govc snapshot.tree -vm template-vm -C) new-vm 6219 govc vm.clone -vm template-vm -template new-template # clone a VM template 6220 govc vm.clone -vm=/ClusterName/vm/FolderName/VM_templateName -on=true -host=myesxi01 -ds=datastore01 myVM_name 6221 6222 Options: 6223 -annotation= VM description 6224 -c=0 Number of CPUs 6225 -cluster= Use cluster for VM placement via DRS 6226 -customization= Customization Specification Name 6227 -datastore-cluster= Datastore cluster [GOVC_DATASTORE_CLUSTER] 6228 -ds= Datastore [GOVC_DATASTORE] 6229 -folder= Inventory folder [GOVC_FOLDER] 6230 -force=false Create VM if vmx already exists 6231 -host= Host system [GOVC_HOST] 6232 -link=false Creates a linked clone from snapshot or source VM 6233 -m=0 Size in MB of memory 6234 -net= Network [GOVC_NETWORK] 6235 -net.adapter=e1000 Network adapter type 6236 -net.address= Network hardware address 6237 -net.protocol= Network device protocol. Applicable to vmxnet3vrdma. Default to 'rocev2' 6238 -on=true Power on VM 6239 -pool= Resource pool [GOVC_RESOURCE_POOL] 6240 -snapshot= Snapshot name to clone from 6241 -template=false Create a Template 6242 -vm= Virtual machine [GOVC_VM] 6243 -waitip=false Wait for VM to acquire IP address 6244 ``` 6245 6246 ## vm.console 6247 6248 ``` 6249 Usage: govc vm.console [OPTIONS] VM 6250 6251 Generate console URL or screen capture for VM. 6252 6253 One of VMRC, VMware Player, VMware Fusion or VMware Workstation must be installed to 6254 open VMRC console URLs. 6255 6256 Examples: 6257 govc vm.console my-vm 6258 govc vm.console -capture screen.png my-vm # screen capture 6259 govc vm.console -capture - my-vm | display # screen capture to stdout 6260 open $(govc vm.console my-vm) # MacOSX VMRC 6261 open $(govc vm.console -h5 my-vm) # MacOSX H5 6262 xdg-open $(govc vm.console my-vm) # Linux VMRC 6263 xdg-open $(govc vm.console -h5 my-vm) # Linux H5 6264 6265 Options: 6266 -capture= Capture console screen shot to file 6267 -h5=false Generate HTML5 UI console link 6268 -vm= Virtual machine [GOVC_VM] 6269 -wss=false Generate WebSocket console link 6270 ``` 6271 6272 ## vm.create 6273 6274 ``` 6275 Usage: govc vm.create [OPTIONS] NAME 6276 6277 Create VM. 6278 6279 For a list of possible '-g' IDs, use 'govc vm.option.info' or see: 6280 https://code.vmware.com/apis/358/vsphere/doc/vim.vm.GuestOsDescriptor.GuestOsIdentifier.html 6281 6282 Examples: 6283 govc vm.create -on=false vm-name 6284 govc vm.create -cluster cluster1 vm-name # use compute cluster placement 6285 govc vm.create -datastore-cluster dscluster vm-name # use datastore cluster placement 6286 govc vm.create -m 2048 -c 2 -g freebsd64Guest -net.adapter vmxnet3 -disk.controller pvscsi vm-name 6287 6288 Options: 6289 -annotation= VM description 6290 -c=1 Number of CPUs 6291 -cluster= Use cluster for VM placement via DRS 6292 -datastore-cluster= Datastore cluster [GOVC_DATASTORE_CLUSTER] 6293 -disk= Disk path (to use existing) OR size (to create new, e.g. 20GB) 6294 -disk-datastore= Datastore for disk file 6295 -disk.controller=scsi Disk controller type 6296 -ds= Datastore [GOVC_DATASTORE] 6297 -firmware=bios Firmware type [bios|efi] 6298 -folder= Inventory folder [GOVC_FOLDER] 6299 -force=false Create VM if vmx already exists 6300 -g=otherGuest Guest OS ID 6301 -host= Host system [GOVC_HOST] 6302 -iso= ISO path 6303 -iso-datastore= Datastore for ISO file 6304 -link=true Link specified disk 6305 -m=1024 Size in MB of memory 6306 -net= Network [GOVC_NETWORK] 6307 -net.adapter=e1000 Network adapter type 6308 -net.address= Network hardware address 6309 -net.protocol= Network device protocol. Applicable to vmxnet3vrdma. Default to 'rocev2' 6310 -on=true Power on VM 6311 -pool= Resource pool [GOVC_RESOURCE_POOL] 6312 -version= ESXi hardware version [2|3|4|5.0|5.1|5.5|6.0|6.5|6.7|6.7.2|7.0|7.0.1|7.0.2|8.0|8.0.1|8.0.2] 6313 ``` 6314 6315 ## vm.customize 6316 6317 ``` 6318 Usage: govc vm.customize [OPTIONS] [NAME] 6319 6320 Customize VM. 6321 6322 Optionally specify a customization spec NAME. 6323 6324 The '-ip', '-netmask' and '-gateway' flags are for static IP configuration. 6325 If the VM has multiple NICs, an '-ip' and '-netmask' must be specified for each. 6326 6327 The '-dns-server' and '-dns-suffix' flags can be specified multiple times. 6328 6329 Windows -tz value requires the Index (hex): https://support.microsoft.com/en-us/help/973627/microsoft-time-zone-index-values 6330 6331 Examples: 6332 govc vm.customize -vm VM NAME 6333 govc vm.customize -vm VM -name my-hostname -ip dhcp 6334 govc vm.customize -vm VM -gateway GATEWAY -ip NEWIP -netmask NETMASK -dns-server DNS1,DNS2 NAME 6335 # Multiple -ip without -mac are applied by vCenter in the order in which the NICs appear on the bus 6336 govc vm.customize -vm VM -ip 10.0.0.178 -netmask 255.255.255.0 -ip 10.0.0.162 -netmask 255.255.255.0 6337 # Multiple -ip with -mac are applied by vCenter to the NIC with the given MAC address 6338 govc vm.customize -vm VM -mac 00:50:56:be:dd:f8 -ip 10.0.0.178 -netmask 255.255.255.0 -mac 00:50:56:be:60:cf -ip 10.0.0.162 -netmask 255.255.255.0 6339 # Dual stack IPv4/IPv6, single NIC 6340 govc vm.customize -vm VM -ip 10.0.0.1 -netmask 255.255.255.0 -ip6 '2001:db8::1/64' -name my-hostname NAME 6341 # DHCPv6, single NIC 6342 govc vm.customize -vm VM -ip6 dhcp6 NAME 6343 # Static IPv6, three NICs, last one with two addresses 6344 govc vm.customize -vm VM -ip6 2001:db8::1/64 -ip6 2001:db8::2/64 -ip6 2001:db8::3/64,2001:db8::4/64 NAME 6345 govc vm.customize -vm VM -auto-login 3 NAME 6346 govc vm.customize -vm VM -prefix demo NAME 6347 govc vm.customize -vm VM -tz America/New_York NAME 6348 6349 Options: 6350 -auto-login=0 Number of times the VM should automatically login as an administrator 6351 -dns-server=[] DNS server list 6352 -dns-suffix=[] DNS suffix list 6353 -domain= Domain name 6354 -gateway=[] Gateway 6355 -ip=[] IPv4 address 6356 -ip6=[] IPv6 addresses with optional netmask (defaults to /64), separated by comma 6357 -mac=[] MAC address 6358 -name= Host name 6359 -netmask=[] Netmask 6360 -prefix= Host name generator prefix 6361 -type=Linux Customization type if spec NAME is not specified (Linux|Windows) 6362 -tz= Time zone 6363 -vm= Virtual machine [GOVC_VM] 6364 ``` 6365 6366 ## vm.dataset.create 6367 6368 ``` 6369 Usage: govc vm.dataset.create [OPTIONS] NAME 6370 6371 Create data set on a VM. 6372 6373 This command will output the ID of the new data set. 6374 6375 Examples: 6376 govc vm.dataset.create -vm $vm -d "Data set for project 2" -host-access READ_WRITE -guest-access READ_ONLY com.example.project2 6377 govc vm.dataset.create -vm $vm -d "Data set for project 3" -omit-from-snapshot=false com.example.project3 6378 6379 Options: 6380 -d= Description 6381 -guest-access=READ_WRITE Access to the data set entries from the VM guest OS (NONE|READ_ONLY|READ_WRITE) 6382 -host-access=READ_WRITE Access to the data set entries from the ESXi host and the vCenter (NONE|READ_ONLY|READ_WRITE) 6383 -omit-from-snapshot=<nil> Omit the data set from snapshots and clones of the VM (defaults to false) 6384 -vm= Virtual machine [GOVC_VM] 6385 ``` 6386 6387 ## vm.dataset.entry.get 6388 6389 ``` 6390 Usage: govc vm.dataset.entry.get [OPTIONS] KEY 6391 6392 Read the value of a data set entry. 6393 6394 Examples: 6395 govc vm.dataset.entry.get -vm $vm -dataset com.example.project2 somekey 6396 6397 Options: 6398 -dataset= Data set name or ID 6399 -vm= Virtual machine [GOVC_VM] 6400 ``` 6401 6402 ## vm.dataset.entry.ls 6403 6404 ``` 6405 Usage: govc vm.dataset.entry.ls [OPTIONS] 6406 6407 List the keys of the entries in a data set. 6408 6409 Examples: 6410 govc vm.dataset.entry.ls -vm $vm -dataset com.example.project2 6411 6412 Options: 6413 -dataset= Data set name or ID 6414 -vm= Virtual machine [GOVC_VM] 6415 ``` 6416 6417 ## vm.dataset.entry.rm 6418 6419 ``` 6420 Usage: govc vm.dataset.entry.rm [OPTIONS] KEY 6421 6422 Delete data set entry. 6423 6424 Examples: 6425 govc vm.dataset.entry.rm -vm $vm -dataset com.example.project2 somekey 6426 6427 Options: 6428 -dataset= Data set name or ID 6429 -vm= Virtual machine [GOVC_VM] 6430 ``` 6431 6432 ## vm.dataset.entry.set 6433 6434 ``` 6435 Usage: govc vm.dataset.entry.set [OPTIONS] KEY VALUE 6436 6437 Set the value of a data set entry. 6438 6439 Examples: 6440 govc vm.dataset.entry.set -vm $vm -dataset com.example.project2 somekey somevalue 6441 6442 Options: 6443 -dataset= Data set name or ID 6444 -vm= Virtual machine [GOVC_VM] 6445 ``` 6446 6447 ## vm.dataset.info 6448 6449 ``` 6450 Usage: govc vm.dataset.info [OPTIONS] NAME 6451 6452 Display data set information. 6453 6454 Examples: 6455 govc vm.dataset.info -vm $vm 6456 govc vm.dataset.info -vm $vm com.example.project2 6457 6458 Options: 6459 -vm= Virtual machine [GOVC_VM] 6460 ``` 6461 6462 ## vm.dataset.ls 6463 6464 ``` 6465 Usage: govc vm.dataset.ls [OPTIONS] 6466 6467 List datasets. 6468 6469 Examples: 6470 govc vm.dataset.ls -vm $vm 6471 govc vm.dataset.ls -vm $vm -json | jq '.[].description' 6472 6473 Options: 6474 -vm= Virtual machine [GOVC_VM] 6475 ``` 6476 6477 ## vm.dataset.rm 6478 6479 ``` 6480 Usage: govc vm.dataset.rm [OPTIONS] NAME 6481 6482 Delete data set. 6483 6484 Fails if the data set has entries, unless the '-force' flag is set. 6485 6486 Examples: 6487 govc vm.dataset.rm -vm $vm com.example.project2 6488 govc vm.dataset.rm -vm $vm -force=true com.example.project3 6489 6490 Options: 6491 -force=false Delete the data set even if it has entries 6492 -vm= Virtual machine [GOVC_VM] 6493 ``` 6494 6495 ## vm.dataset.update 6496 6497 ``` 6498 Usage: govc vm.dataset.update [OPTIONS] NAME 6499 6500 Update data set. 6501 6502 Examples: 6503 govc vm.dataset.update -vm $vm -d "New description." -guest-access READ_ONLY com.example.project2 6504 govc vm.dataset.update -vm $vm -omit-from-snapshot=false com.example.project3 6505 6506 Options: 6507 -d= Description 6508 -guest-access= Access to the data set entries from the VM guest OS (NONE|READ_ONLY|READ_WRITE) 6509 -host-access= Access to the data set entries from the ESXi host and the vCenter (NONE|READ_ONLY|READ_WRITE) 6510 -omit-from-snapshot=<nil> Omit the data set from snapshots and clones of the VM 6511 -vm= Virtual machine [GOVC_VM] 6512 ``` 6513 6514 ## vm.destroy 6515 6516 ``` 6517 Usage: govc vm.destroy [OPTIONS] VM... 6518 6519 Power off and delete VM. 6520 6521 When a VM is destroyed, any attached virtual disks are also deleted. 6522 Use the 'device.remove -vm VM -keep disk-*' command to detach and 6523 keep disks if needed, prior to calling vm.destroy. 6524 6525 Examples: 6526 govc vm.destroy my-vm 6527 6528 Options: 6529 ``` 6530 6531 ## vm.disk.attach 6532 6533 ``` 6534 Usage: govc vm.disk.attach [OPTIONS] 6535 6536 Attach existing disk to VM. 6537 6538 A delta disk is created by default, where changes are persisted. Specifying '-link=false' will persist to the same disk. 6539 6540 Examples: 6541 govc vm.disk.attach -vm $name -disk $name/disk1.vmdk 6542 govc device.info -vm $name disk-* # 'File' field is where changes are persisted. 'Parent' field is set when '-link=true' 6543 govc vm.disk.attach -vm $name -disk $name/shared.vmdk -link=false -sharing sharingMultiWriter 6544 govc device.remove -vm $name -keep disk-* # detach disk(s) 6545 6546 Options: 6547 -controller= Disk controller 6548 -disk= Disk path name 6549 -ds= Datastore [GOVC_DATASTORE] 6550 -link=true Link specified disk 6551 -mode= Disk mode (persistent|nonpersistent|undoable|independent_persistent|independent_nonpersistent|append) 6552 -persist=true Persist attached disk 6553 -sharing= Sharing (sharingNone|sharingMultiWriter) 6554 -vm= Virtual machine [GOVC_VM] 6555 ``` 6556 6557 ## vm.disk.change 6558 6559 ``` 6560 Usage: govc vm.disk.change [OPTIONS] 6561 6562 Change some properties of a VM's DISK 6563 6564 In particular, you can change the DISK mode, and the size (as long as it is bigger) 6565 6566 Examples: 6567 govc vm.disk.change -vm VM -disk.key 2001 -size 10G 6568 govc vm.disk.change -vm VM -disk.label "BDD disk" -size 10G 6569 govc vm.disk.change -vm VM -disk.name "hard-1000-0" -size 12G 6570 govc vm.disk.change -vm VM -disk.filePath "[DS] VM/VM-1.vmdk" -mode nonpersistent 6571 6572 Options: 6573 -disk.filePath= Disk file name 6574 -disk.io.limit=<nil> Disk storage IO per seconds limit (-1 for unlimited) 6575 -disk.key=0 Disk unique key 6576 -disk.label= Disk label 6577 -disk.name= Disk name 6578 -mode= Disk mode (persistent|nonpersistent|undoable|independent_persistent|independent_nonpersistent|append) 6579 -sharing= Sharing (sharingNone|sharingMultiWriter) 6580 -size=0B New disk size 6581 -vm= Virtual machine [GOVC_VM] 6582 ``` 6583 6584 ## vm.disk.create 6585 6586 ``` 6587 Usage: govc vm.disk.create [OPTIONS] 6588 6589 Create disk and attach to VM. 6590 6591 Examples: 6592 govc vm.disk.create -vm $name -name $name/disk1 -size 10G 6593 govc vm.disk.create -vm $name -name $name/disk2 -size 10G -eager -thick -sharing sharingMultiWriter 6594 6595 Options: 6596 -controller= Disk controller 6597 -ds= Datastore [GOVC_DATASTORE] 6598 -eager=false Eagerly scrub new disk 6599 -mode=persistent Disk mode (persistent|nonpersistent|undoable|independent_persistent|independent_nonpersistent|append) 6600 -name= Name for new disk 6601 -sharing= Sharing (sharingNone|sharingMultiWriter) 6602 -size=10.0GB Size of new disk 6603 -thick=false Thick provision new disk 6604 -vm= Virtual machine [GOVC_VM] 6605 ``` 6606 6607 ## vm.guest.tools 6608 6609 ``` 6610 Usage: govc vm.guest.tools [OPTIONS] VM... 6611 6612 Manage guest tools in VM. 6613 6614 Examples: 6615 govc vm.guest.tools -mount VM 6616 govc vm.guest.tools -unmount VM 6617 govc vm.guest.tools -upgrade -options "opt1 opt2" VM 6618 6619 Options: 6620 -mount=false Mount tools CD installer in the guest 6621 -options= Installer options 6622 -unmount=false Unmount tools CD installer in the guest 6623 -upgrade=false Upgrade tools in the guest 6624 ``` 6625 6626 ## vm.info 6627 6628 ``` 6629 Usage: govc vm.info [OPTIONS] VM... 6630 6631 Display info for VM. 6632 6633 The '-r' flag displays additional info for CPU, memory and storage usage, 6634 along with the VM's Datastores, Networks and PortGroups. 6635 6636 Examples: 6637 govc vm.info $vm 6638 govc vm.info -r $vm | grep Network: 6639 govc vm.info -json $vm 6640 govc find . -type m -runtime.powerState poweredOn | xargs govc vm.info 6641 6642 Options: 6643 -e=false Show ExtraConfig 6644 -g=true Show general summary 6645 -r=false Show resource summary 6646 -t=false Show ToolsConfigInfo 6647 -waitip=false Wait for VM to acquire IP address 6648 ``` 6649 6650 ## vm.instantclone 6651 6652 ``` 6653 Usage: govc vm.instantclone [OPTIONS] NAME 6654 6655 Instant Clone VM to NAME. 6656 6657 Examples: 6658 govc vm.instantclone -vm source-vm new-vm 6659 # Configure ExtraConfig variables on a guest VM: 6660 govc vm.instantclone -vm source-vm -e guestinfo.ipaddress=192.168.0.1 -e guestinfo.netmask=255.255.255.0 new-vm 6661 # Read the variable set above inside the guest: 6662 vmware-rpctool "info-get guestinfo.ipaddress" 6663 vmware-rpctool "info-get guestinfo.netmask" 6664 6665 Options: 6666 -ds= Datastore [GOVC_DATASTORE] 6667 -e=[] ExtraConfig. <key>=<value> 6668 -folder= Inventory folder [GOVC_FOLDER] 6669 -net= Network [GOVC_NETWORK] 6670 -net.adapter=e1000 Network adapter type 6671 -net.address= Network hardware address 6672 -net.protocol= Network device protocol. Applicable to vmxnet3vrdma. Default to 'rocev2' 6673 -pool= Resource pool [GOVC_RESOURCE_POOL] 6674 -vm= Virtual machine [GOVC_VM] 6675 ``` 6676 6677 ## vm.ip 6678 6679 ``` 6680 Usage: govc vm.ip [OPTIONS] VM... 6681 6682 List IPs for VM. 6683 6684 By default the vm.ip command depends on vmware-tools to report the 'guest.ipAddress' field and will 6685 wait until it has done so. This value can also be obtained using: 6686 6687 govc vm.info -json $vm | jq -r .virtualMachines[].guest.ipAddress 6688 6689 When given the '-a' flag, only IP addresses for which there is a corresponding virtual nic are listed. 6690 If there are multiple nics, the listed addresses will be comma delimited. The '-a' flag depends on 6691 vmware-tools to report the 'guest.net' field and will wait until it has done so for all nics. 6692 Note that this list includes IPv6 addresses if any, use '-v4' to filter them out. IP addresses reported 6693 by tools for which there is no virtual nic are not included, for example that of the 'docker0' interface. 6694 6695 These values can also be obtained using: 6696 6697 govc vm.info -json $vm | jq -r .virtualMachines[].guest.net[].ipConfig.ipAddress[].ipAddress 6698 6699 When given the '-n' flag, filters '-a' behavior to the nic specified by MAC address or device name. 6700 6701 The 'esxcli' flag does not require vmware-tools to be installed, but does require the ESX host to 6702 have the /Net/GuestIPHack setting enabled. 6703 6704 The 'wait' flag default to 1hr (original default was infinite). If a VM does not obtain an IP within 6705 the wait time, the command will still exit with status 0. 6706 6707 Examples: 6708 govc vm.ip $vm 6709 govc vm.ip -wait 5m $vm 6710 govc vm.ip -a -v4 $vm 6711 govc vm.ip -n 00:0c:29:57:7b:c3 $vm 6712 govc vm.ip -n ethernet-0 $vm 6713 govc host.esxcli system settings advanced set -o /Net/GuestIPHack -i 1 6714 govc vm.ip -esxcli $vm 6715 6716 Options: 6717 -a=false Wait for an IP address on all NICs 6718 -esxcli=false Use esxcli instead of guest tools 6719 -n= Wait for IP address on NIC, specified by device name or MAC 6720 -v4=false Only report IPv4 addresses 6721 -wait=1h0m0s Wait time for the VM obtain an IP address 6722 ``` 6723 6724 ## vm.keystrokes 6725 6726 ``` 6727 Usage: govc vm.keystrokes [OPTIONS] VM 6728 6729 Send Keystrokes to VM. 6730 6731 Examples: 6732 Default Scenario 6733 govc vm.keystrokes -vm $vm -s "root" # writes 'root' to the console 6734 govc vm.keystrokes -vm $vm -c 0x15 # writes an 'r' to the console 6735 govc vm.keystrokes -vm $vm -r 1376263 # writes an 'r' to the console 6736 govc vm.keystrokes -vm $vm -c 0x28 # presses ENTER on the console 6737 govc vm.keystrokes -vm $vm -c 0x4c -la=true -lc=true # sends CTRL+ALT+DEL to console 6738 govc vm.keystrokes -vm $vm -c 0x15,KEY_ENTER # writes an 'r' to the console and press ENTER 6739 6740 List of available aliases: 6741 KEY_0, KEY_1, KEY_102ND, KEY_2, KEY_3, KEY_4, KEY_5, KEY_6, KEY_7, KEY_8, KEY_9, KEY_A, KEY_AGAIN, KEY_APOSTROPHE, KEY_B, KEY_BACKSLASH, KEY_BACKSPACE, KEY_C, KEY_CAPSLOCK, KEY_COMMA, KEY_COMPOSE, KEY_COPY, KEY_CUT, KEY_D, KEY_DELETE, KEY_DOT, KEY_DOWN, KEY_E, KEY_END, KEY_ENTER, KEY_EQUAL, KEY_ERR_OVF, KEY_ESC, KEY_F, KEY_F1, KEY_F10, KEY_F11, KEY_F12, KEY_F13, KEY_F14, KEY_F15, KEY_F16, KEY_F17, KEY_F18, KEY_F19, KEY_F2, KEY_F20, KEY_F21, KEY_F22, KEY_F23, KEY_F24, KEY_F3, KEY_F4, KEY_F5, KEY_F6, KEY_F7, KEY_F8, KEY_F9, KEY_FIND, KEY_FRONT, KEY_G, KEY_GRAVE, KEY_H, KEY_HANGEUL, KEY_HANJA, KEY_HASHTILDE, KEY_HELP, KEY_HENKAN, KEY_HIRAGANA, KEY_HOME, KEY_I, KEY_INSERT, KEY_J, KEY_K, KEY_KATAKANA, KEY_KATAKANAHIRAGANA, KEY_KP0, KEY_KP1, KEY_KP2, KEY_KP3, KEY_KP4, KEY_KP5, KEY_KP6, KEY_KP7, KEY_KP8, KEY_KP9, KEY_KPASTERISK, KEY_KPCOMMA, KEY_KPDOT, KEY_KPENTER, KEY_KPEQUAL, KEY_KPJPCOMMA, KEY_KPLEFTPAREN, KEY_KPMINUS, KEY_KPPLUS, KEY_KPRIGHTPAREN, KEY_KPSLASH, KEY_L, KEY_LEFT, KEY_LEFTALT, KEY_LEFTBRACE, KEY_LEFTCTRL, KEY_LEFTMETA, KEY_LEFTSHIFT, KEY_M, KEY_MEDIA_BACK, KEY_MEDIA_CALC, KEY_MEDIA_COFFEE, KEY_MEDIA_EDIT, KEY_MEDIA_EJECTCD, KEY_MEDIA_FIND, KEY_MEDIA_FORWARD, KEY_MEDIA_MUTE, KEY_MEDIA_NEXTSONG, KEY_MEDIA_PLAYPAUSE, KEY_MEDIA_PREVIOUSSONG, KEY_MEDIA_REFRESH, KEY_MEDIA_SCROLLDOWN, KEY_MEDIA_SCROLLUP, KEY_MEDIA_SLEEP, KEY_MEDIA_STOP, KEY_MEDIA_STOPCD, KEY_MEDIA_VOLUMEDOWN, KEY_MEDIA_VOLUMEUP, KEY_MEDIA_WWW, KEY_MINUS, KEY_MOD_LALT, KEY_MOD_LCTRL, KEY_MOD_LMETA, KEY_MOD_LSHIFT, KEY_MOD_RALT, KEY_MOD_RCTRL, KEY_MOD_RMETA, KEY_MOD_RSHIFT, KEY_MUHENKAN, KEY_MUTE, KEY_N, KEY_NONE, KEY_NUMLOCK, KEY_O, KEY_OPEN, KEY_P, KEY_PAGEDOWN, KEY_PAGEUP, KEY_PASTE, KEY_PAUSE, KEY_POWER, KEY_PROPS, KEY_Q, KEY_R, KEY_RIGHT, KEY_RIGHTALT, KEY_RIGHTBRACE, KEY_RIGHTCTRL, KEY_RIGHTMETA, KEY_RIGHTSHIFT, KEY_RO, KEY_S, KEY_SCROLLLOCK, KEY_SEMICOLON, KEY_SLASH, KEY_SPACE, KEY_STOP, KEY_SYSRQ, KEY_T, KEY_TAB, KEY_U, KEY_UNDO, KEY_UP, KEY_V, KEY_VOLUMEDOWN, KEY_VOLUMEUP, KEY_W, KEY_X, KEY_Y, KEY_YEN, KEY_Z, KEY_ZENKAKUHANKAKU 6742 6743 6744 Options: 6745 -c= USB HID Codes (hex) or aliases, comma separated 6746 -la=false Enable/Disable Left Alt 6747 -lc=false Enable/Disable Left Control 6748 -lg=false Enable/Disable Left Gui 6749 -ls=false Enable/Disable Left Shift 6750 -r=0 Raw USB HID Code Value (int32) 6751 -ra=false Enable/Disable Right Alt 6752 -rc=false Enable/Disable Right Control 6753 -rg=false Enable/Disable Right Gui 6754 -rs=false Enable/Disable Right Shift 6755 -s= Raw String to Send 6756 -vm= Virtual machine [GOVC_VM] 6757 ``` 6758 6759 ## vm.markastemplate 6760 6761 ``` 6762 Usage: govc vm.markastemplate [OPTIONS] VM... 6763 6764 Mark VM as a virtual machine template. 6765 6766 Examples: 6767 govc vm.markastemplate $name 6768 6769 Options: 6770 ``` 6771 6772 ## vm.markasvm 6773 6774 ``` 6775 Usage: govc vm.markasvm [OPTIONS] VM... 6776 6777 Mark VM template as a virtual machine. 6778 6779 Examples: 6780 govc vm.markasvm -host host1 $name 6781 govc vm.markasvm -host host1 $name 6782 6783 Options: 6784 -host= Host system [GOVC_HOST] 6785 -pool= Resource pool [GOVC_RESOURCE_POOL] 6786 ``` 6787 6788 ## vm.migrate 6789 6790 ``` 6791 Usage: govc vm.migrate [OPTIONS] VM... 6792 6793 Migrates VM to a specific resource pool, host or datastore. 6794 6795 Examples: 6796 govc vm.migrate -host another-host vm-1 vm-2 vm-3 6797 govc vm.migrate -pool another-pool vm-1 vm-2 vm-3 6798 govc vm.migrate -ds another-ds vm-1 vm-2 vm-3 6799 6800 Options: 6801 -ds= Datastore [GOVC_DATASTORE] 6802 -folder= Inventory folder [GOVC_FOLDER] 6803 -host= Host system [GOVC_HOST] 6804 -pool= Resource pool [GOVC_RESOURCE_POOL] 6805 -priority=defaultPriority The task priority 6806 -vm= Virtual machine [GOVC_VM] 6807 ``` 6808 6809 ## vm.network.add 6810 6811 ``` 6812 Usage: govc vm.network.add [OPTIONS] 6813 6814 Add network adapter to VM. 6815 6816 Examples: 6817 govc vm.network.add -vm $vm -net "VM Network" -net.adapter e1000e 6818 govc vm.network.add -vm $vm -net SwitchName/PortgroupName 6819 govc device.info -vm $vm ethernet-* 6820 6821 Options: 6822 -net= Network [GOVC_NETWORK] 6823 -net.adapter=e1000 Network adapter type 6824 -net.address= Network hardware address 6825 -net.protocol= Network device protocol. Applicable to vmxnet3vrdma. Default to 'rocev2' 6826 -vm= Virtual machine [GOVC_VM] 6827 ``` 6828 6829 ## vm.network.change 6830 6831 ``` 6832 Usage: govc vm.network.change [OPTIONS] DEVICE 6833 6834 Change network DEVICE configuration. 6835 6836 Note that '-net' is currently required with '-net.address', even when not changing the VM network. 6837 6838 Examples: 6839 govc vm.network.change -vm $vm -net PG2 ethernet-0 6840 govc vm.network.change -vm $vm -net PG2 -net.address 00:00:0f:2e:5d:69 ethernet-0 # set to manual MAC address 6841 govc vm.network.change -vm $vm -net PG2 -net.address - ethernet-0 # set to generated MAC address 6842 govc device.info -vm $vm ethernet-* 6843 6844 Options: 6845 -net= Network [GOVC_NETWORK] 6846 -net.adapter=e1000 Network adapter type 6847 -net.address= Network hardware address 6848 -net.protocol= Network device protocol. Applicable to vmxnet3vrdma. Default to 'rocev2' 6849 -vm= Virtual machine [GOVC_VM] 6850 ``` 6851 6852 ## vm.option.info 6853 6854 ``` 6855 Usage: govc vm.option.info [OPTIONS] [GUEST_ID]... 6856 6857 VM config options for CLUSTER. 6858 6859 The config option data contains information about the execution environment for a VM 6860 in the given CLUSTER, and optionally for a specific HOST. 6861 6862 By default, supported guest OS IDs and full name are listed. 6863 6864 Examples: 6865 govc vm.option.info -cluster C0 6866 govc vm.option.info -cluster C0 -dump ubuntu64Guest 6867 govc vm.option.info -cluster C0 -json | jq .guestOSDescriptor[].id 6868 govc vm.option.info -host my_hostname 6869 govc vm.option.info -vm my_vm 6870 6871 Options: 6872 -cluster= Cluster [GOVC_CLUSTER] 6873 -host= Host system [GOVC_HOST] 6874 -id= Option descriptor key 6875 -vm= Virtual machine [GOVC_VM] 6876 ``` 6877 6878 ## vm.option.ls 6879 6880 ``` 6881 Usage: govc vm.option.ls [OPTIONS] 6882 6883 List VM config option keys for CLUSTER. 6884 6885 Examples: 6886 govc vm.option.ls -cluster C0 6887 6888 Options: 6889 -cluster= Cluster [GOVC_CLUSTER] 6890 -host= Host system [GOVC_HOST] 6891 -vm= Virtual machine [GOVC_VM] 6892 ``` 6893 6894 ## vm.power 6895 6896 ``` 6897 Usage: govc vm.power [OPTIONS] NAME... 6898 6899 Invoke VM power operations. 6900 6901 Examples: 6902 govc vm.power -on VM1 VM2 VM3 6903 govc vm.power -on -M VM1 VM2 VM3 6904 govc vm.power -off -force VM1 6905 6906 Options: 6907 -M=false Use Datacenter.PowerOnMultiVM method instead of VirtualMachine.PowerOnVM 6908 -force=false Force (ignore state error and hard shutdown/reboot if tools unavailable) 6909 -off=false Power off 6910 -on=false Power on 6911 -r=false Reboot guest 6912 -reset=false Power reset 6913 -s=false Shutdown guest 6914 -standby=false Standby guest 6915 -suspend=false Power suspend 6916 -wait=true Wait for the operation to complete 6917 ``` 6918 6919 ## vm.question 6920 6921 ``` 6922 Usage: govc vm.question [OPTIONS] 6923 6924 Options: 6925 -answer= Answer to question 6926 -vm= Virtual machine [GOVC_VM] 6927 ``` 6928 6929 ## vm.rdm.attach 6930 6931 ``` 6932 Usage: govc vm.rdm.attach [OPTIONS] 6933 6934 Attach DEVICE to VM with RDM. 6935 6936 Examples: 6937 govc vm.rdm.attach -vm VM -device /vmfs/devices/disks/naa.000000000000000000000000000000000 6938 6939 Options: 6940 -device= Device Name 6941 -vm= Virtual machine [GOVC_VM] 6942 ``` 6943 6944 ## vm.rdm.ls 6945 6946 ``` 6947 Usage: govc vm.rdm.ls [OPTIONS] 6948 6949 List available devices that could be attach to VM with RDM. 6950 6951 Examples: 6952 govc vm.rdm.ls -vm VM 6953 6954 Options: 6955 -vm= Virtual machine [GOVC_VM] 6956 ``` 6957 6958 ## vm.register 6959 6960 ``` 6961 Usage: govc vm.register [OPTIONS] VMX 6962 6963 Add an existing VM to the inventory. 6964 6965 VMX is a path to the vm config file, relative to DATASTORE. 6966 6967 Examples: 6968 govc vm.register path/name.vmx 6969 govc vm.register -template -host $host path/name.vmx 6970 6971 Options: 6972 -ds= Datastore [GOVC_DATASTORE] 6973 -folder= Inventory folder [GOVC_FOLDER] 6974 -host= Host system [GOVC_HOST] 6975 -name= Name of the VM 6976 -pool= Resource pool [GOVC_RESOURCE_POOL] 6977 -template=false Mark VM as template 6978 ``` 6979 6980 ## vm.target.cap.ls 6981 6982 ``` 6983 Usage: govc vm.target.cap.ls [OPTIONS] 6984 6985 List VM config target capabilities. 6986 6987 The config target data contains capabilities about the execution environment for a VM 6988 in the given CLUSTER, and optionally for a specific HOST. 6989 6990 Examples: 6991 govc vm.target.cap.ls -cluster C0 6992 govc vm.target.cap.ls -host my_hostname 6993 govc vm.target.cap.ls -vm my_vm 6994 6995 Options: 6996 -cluster= Cluster [GOVC_CLUSTER] 6997 -host= Host system [GOVC_HOST] 6998 -vm= Virtual machine [GOVC_VM] 6999 ``` 7000 7001 ## vm.target.info 7002 7003 ``` 7004 Usage: govc vm.target.info [OPTIONS] 7005 7006 VM config target info. 7007 7008 The config target data contains information about the execution environment for a VM 7009 in the given CLUSTER, and optionally for a specific HOST. 7010 7011 Examples: 7012 govc vm.target.info -cluster C0 7013 govc vm.target.info -host my_hostname 7014 govc vm.target.info -vm my_vm 7015 7016 Options: 7017 -cluster= Cluster [GOVC_CLUSTER] 7018 -datastore=true Include Datastores 7019 -device=true Include Devices 7020 -disk=false Include Disks 7021 -host= Host system [GOVC_HOST] 7022 -network=true Include Networks 7023 -vm= Virtual machine [GOVC_VM] 7024 ``` 7025 7026 ## vm.unregister 7027 7028 ``` 7029 Usage: govc vm.unregister [OPTIONS] VM... 7030 7031 Remove VM from inventory without removing any of the VM files on disk. 7032 7033 Options: 7034 ``` 7035 7036 ## vm.upgrade 7037 7038 ``` 7039 Usage: govc vm.upgrade [OPTIONS] 7040 7041 Upgrade VMs to latest hardware version 7042 7043 Examples: 7044 govc vm.upgrade -vm $vm_name 7045 govc vm.upgrade -version=$version -vm $vm_name 7046 govc vm.upgrade -version=$version -vm.uuid $vm_uuid 7047 7048 Options: 7049 -version=0 Target vm hardware version, by default -- latest available 7050 -vm= Virtual machine [GOVC_VM] 7051 ``` 7052 7053 ## vm.vnc 7054 7055 ``` 7056 Usage: govc vm.vnc [OPTIONS] VM... 7057 7058 Enable or disable VNC for VM. 7059 7060 Port numbers are automatically chosen if not specified. 7061 7062 If neither -enable or -disable is specified, the current state is returned. 7063 7064 Examples: 7065 govc vm.vnc -enable -password 1234 $vm | awk '{print $2}' | xargs open 7066 7067 Options: 7068 -disable=false Disable VNC 7069 -enable=false Enable VNC 7070 -password= VNC password 7071 -port=-1 VNC port (-1 for auto-select) 7072 -port-range=5900-5999 VNC port auto-select range 7073 ``` 7074 7075 ## volume.ls 7076 7077 ``` 7078 Usage: govc volume.ls [OPTIONS] [ID...] 7079 7080 List CNS volumes. 7081 7082 Examples: 7083 govc volume.ls 7084 govc volume.ls -l 7085 govc volume.ls -ds vsanDatastore 7086 govc volume.ls df86393b-5ae0-4fca-87d0-b692dbc67d45 7087 govc disk.ls -l $(govc volume.ls -L pvc-9744a4ff-07f4-43c4-b8ed-48ea7a528734) 7088 7089 Options: 7090 -L=false List volume disk or file backing ID only 7091 -ds= Datastore [GOVC_DATASTORE] 7092 -i=false List volume ID only 7093 -l=false Long listing format 7094 ``` 7095 7096 ## volume.rm 7097 7098 ``` 7099 Usage: govc volume.rm [OPTIONS] ID 7100 7101 Remove CNS volume. 7102 7103 Note: if volume.rm returns not found errors, 7104 consider using 'govc disk.ls -R' to reconcile the datastore inventory. 7105 7106 Examples: 7107 govc volume.rm f75989dc-95b9-4db7-af96-8583f24bc59d 7108 7109 Options: 7110 ``` 7111 7112 ## volume.snapshot.create 7113 7114 ``` 7115 Usage: govc volume.snapshot.create [OPTIONS] [ID] [DESC] 7116 7117 Create snapshot of volume ID with description DESC. 7118 7119 Examples: 7120 govc volume.snapshot.create df86393b-5ae0-4fca-87d0-b692dbc67d45 my-snapshot 7121 govc volume.snapshot.create -i df86393b-5ae0-4fca-87d0-b692dbc67d45 my-snapshot 7122 7123 Options: 7124 -i=false Output snapshot ID and volume ID only 7125 ``` 7126 7127 ## volume.snapshot.ls 7128 7129 ``` 7130 Usage: govc volume.snapshot.ls [OPTIONS] [ID]... 7131 7132 List all snapshots of volume ID. 7133 7134 Use a list of volume IDs to list all snapshots of multiple volumes at once. 7135 7136 Examples: 7137 govc volume.snapshot.ls df86393b-5ae0-4fca-87d0-b692dbc67d45 7138 govc volume.snapshot.ls -i df86393b-5ae0-4fca-87d0-b692dbc67d45 7139 govc volume.snapshot.ls -l df86393b-5ae0-4fca-87d0-b692dbc67d45 7140 govc volume.snapshot.ls -l $(govc volume.ls -i) 7141 7142 Options: 7143 -i=false List snapshot ID and volume ID only 7144 -l=false Long listing format 7145 ``` 7146 7147 ## volume.snapshot.rm 7148 7149 ``` 7150 Usage: govc volume.snapshot.rm [OPTIONS] [SNAP_ID VOL_ID]... 7151 7152 Remove snapshot SNAP_ID from volume VOL_ID. 7153 7154 Use a list of [SNAP_ID VOL_ID] pairs to remove multiple snapshots at once. 7155 7156 Examples: 7157 govc volume.snapshot.rm f75989dc-95b9-4db7-af96-8583f24bc59d df86393b-5ae0-4fca-87d0-b692dbc67d45 7158 govc volume.snapshot.rm $(govc volume.snapshot.ls -i df86393b-5ae0-4fca-87d0-b692dbc67d45) 7159 govc volume.snapshot.rm $(govc volume.snapshot.create -i df86393b-5ae0-4fca-87d0-b692dbc67d45 my-snapshot) 7160 govc volume.snapshot.rm $(govc volume.snapshot.ls -i $(govc volume.ls -i)) 7161 7162 Options: 7163 ``` 7164 7165 ## vsan.change 7166 7167 ``` 7168 Usage: govc vsan.change [OPTIONS] CLUSTER 7169 7170 Change vSAN configuration. 7171 7172 Examples: 7173 govc vsan.change -unmap-enabled ClusterA # enable unmap 7174 govc vsan.change -unmap-enabled=false ClusterA # disable unmap 7175 7176 Options: 7177 -unmap-enabled=<nil> Enable Unmap 7178 ``` 7179 7180 ## vsan.info 7181 7182 ``` 7183 Usage: govc vsan.info [OPTIONS] CLUSTER... 7184 7185 Display vSAN configuration. 7186 7187 Examples: 7188 govc vsan.info 7189 govc vsan.info ClusterA 7190 govc vsan.info -json 7191 7192 Options: 7193 ``` 7194