github.com/vmware/govmomi@v0.37.2/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 govc library.import -pull -c=<checksum> -a=<SHA1|MD5|SHA256|SHA512> library_name http://example.com/file.ova # direct pull from vCenter with checksum validation 3617 3618 Options: 3619 -a=SHA256 Algorithm used to calculate the checksum. Possible values are: SHA1, MD5, SHA256 (default), SHA512 3620 -c= Checksum value to verify the pulled library item 3621 -m=false Require ova manifest 3622 -n= Library item name 3623 -pull=false Pull library item from http endpoint 3624 -t= Library item type 3625 ``` 3626 3627 ## library.info 3628 3629 ``` 3630 Usage: govc library.info [OPTIONS] 3631 3632 Display library information. 3633 3634 Examples: 3635 govc library.info 3636 govc library.info /lib1 3637 govc library.info -l /lib1 | grep Size: 3638 govc library.info /lib1/item1 3639 govc library.info /lib1/item1/ 3640 govc library.info */ 3641 govc device.cdrom.insert -vm $vm -device cdrom-3000 $(govc library.info -L /lib1/item1/file1) 3642 govc library.info -json | jq . 3643 govc library.info -json /lib1/item1 | jq . 3644 3645 Options: 3646 -L=false List Datastore path only 3647 -U=false List pub/sub URL(s) only 3648 -l=false Long listing format 3649 ``` 3650 3651 ## library.ls 3652 3653 ``` 3654 Usage: govc library.ls [OPTIONS] 3655 3656 List libraries, items, and files. 3657 3658 Examples: 3659 govc library.ls 3660 govc library.ls /lib1 3661 govc library.ls /lib1/item1 3662 govc library.ls /lib1/item1/ 3663 govc library.ls */ 3664 govc library.ls -json | jq . 3665 govc library.ls /lib1/item1 -json | jq . 3666 3667 Options: 3668 ``` 3669 3670 ## library.policy.ls 3671 3672 ``` 3673 Usage: govc library.policy.ls [OPTIONS] 3674 3675 List security policies for content libraries. 3676 3677 Examples: 3678 govc library.policy.ls 3679 3680 3681 Options: 3682 ``` 3683 3684 ## library.publish 3685 3686 ``` 3687 Usage: govc library.publish [OPTIONS] NAME|ITEM [SUBSCRIPTION-ID]... 3688 3689 Publish library NAME or ITEM to subscribers. 3690 3691 If no subscriptions are specified, then publishes the library to all its subscribers. 3692 See 'govc library.subscriber.ls' to get a list of subscription IDs. 3693 3694 Examples: 3695 govc library.publish /my-library 3696 govc library.publish /my-library subscription-id1 subscription-id2 3697 govc library.publish /my-library/my-item 3698 govc library.publish /my-library/my-item subscription-id1 subscription-id2 3699 3700 Options: 3701 ``` 3702 3703 ## library.rm 3704 3705 ``` 3706 Usage: govc library.rm [OPTIONS] NAME 3707 3708 Delete library or item NAME. 3709 3710 Examples: 3711 govc library.rm /library_name 3712 govc library.rm library_id # Use library id if multiple libraries have the same name 3713 govc library.rm /library_name/item_name 3714 3715 Options: 3716 ``` 3717 3718 ## library.session.ls 3719 3720 ``` 3721 Usage: govc library.session.ls [OPTIONS] 3722 3723 List library item update sessions. 3724 3725 Examples: 3726 govc library.session.ls 3727 govc library.session.ls -json | jq . 3728 3729 Options: 3730 -i=false List session item files (with -json only) 3731 ``` 3732 3733 ## library.session.rm 3734 3735 ``` 3736 Usage: govc library.session.rm [OPTIONS] 3737 3738 Remove a library item update session. 3739 3740 Examples: 3741 govc library.session.rm session_id 3742 govc library.session.rm -i session_id foo.ovf 3743 3744 Options: 3745 -f=false Cancel session if active 3746 -i=false Remove session item file 3747 ``` 3748 3749 ## library.subscriber.create 3750 3751 ``` 3752 Usage: govc library.subscriber.create [OPTIONS] PUBLISHED-LIBRARY SUBSCRIPTION-LIBRARY 3753 3754 Create library subscriber. 3755 3756 Examples: 3757 govc library.subscriber.create -cluster my-cluster published-library subscription-library 3758 3759 Options: 3760 -cluster= Cluster [GOVC_CLUSTER] 3761 -folder= Inventory folder [GOVC_FOLDER] 3762 -host= Host system [GOVC_HOST] 3763 -net= Network [GOVC_NETWORK] 3764 -net.adapter=e1000 Network adapter type 3765 -net.address= Network hardware address 3766 -net.protocol= Network device protocol. Applicable to vmxnet3vrdma. Default to 'rocev2' 3767 -pool= Resource pool [GOVC_RESOURCE_POOL] 3768 ``` 3769 3770 ## library.subscriber.info 3771 3772 ``` 3773 Usage: govc library.subscriber.info [OPTIONS] PUBLISHED-LIBRARY SUBSCRIPTION-ID 3774 3775 Library subscriber info. 3776 3777 Examples: 3778 id=$(govc library.subscriber.ls | grep my-library-name | awk '{print $1}') 3779 govc library.subscriber.info published-library-name $id 3780 3781 Options: 3782 ``` 3783 3784 ## library.subscriber.ls 3785 3786 ``` 3787 Usage: govc library.subscriber.ls [OPTIONS] 3788 3789 List library subscriptions. 3790 3791 Examples: 3792 govc library.subscriber.ls library-name 3793 3794 Options: 3795 ``` 3796 3797 ## library.subscriber.rm 3798 3799 ``` 3800 Usage: govc library.subscriber.rm [OPTIONS] SUBSCRIPTION-ID 3801 3802 Delete subscription of the published library. 3803 3804 The subscribed library associated with the subscription will not be deleted. 3805 3806 Examples: 3807 id=$(govc library-subscriber.ls | grep my-library-name | awk '{print $1}') 3808 govc library.subscriber.rm $id 3809 3810 Options: 3811 ``` 3812 3813 ## library.sync 3814 3815 ``` 3816 Usage: govc library.sync [OPTIONS] NAME|ITEM 3817 3818 Sync library NAME or ITEM. 3819 3820 Examples: 3821 govc library.sync subscribed-library 3822 govc library.sync subscribed-library/item 3823 govc library.sync -vmtx local-library subscribed-library # convert subscribed OVFs to local VMTX 3824 3825 Options: 3826 -folder= Inventory folder [GOVC_FOLDER] 3827 -pool= Resource pool [GOVC_RESOURCE_POOL] 3828 -vmtx= Sync subscribed library to local library as VM Templates 3829 ``` 3830 3831 ## library.trust.create 3832 3833 ``` 3834 Usage: govc library.trust.create [OPTIONS] FILE 3835 3836 Add a certificate to content library trust store. 3837 3838 If FILE name is "-", read certificate from stdin. 3839 3840 Examples: 3841 govc library.trust.create cert.pem 3842 govc about.cert -show -u wp-content-int.vmware.com | govc library.trust.create - 3843 3844 Options: 3845 ``` 3846 3847 ## library.trust.info 3848 3849 ``` 3850 Usage: govc library.trust.info [OPTIONS] ID 3851 3852 Display trusted certificate info. 3853 3854 Examples: 3855 govc library.trust.info vmware_signed 3856 3857 Options: 3858 ``` 3859 3860 ## library.trust.ls 3861 3862 ``` 3863 Usage: govc library.trust.ls [OPTIONS] 3864 3865 List trusted certificates for content libraries. 3866 3867 Examples: 3868 govc library.trust.ls 3869 govc library.trust.ls -json 3870 3871 Options: 3872 ``` 3873 3874 ## library.trust.rm 3875 3876 ``` 3877 Usage: govc library.trust.rm [OPTIONS] ID 3878 3879 Remove certificate ID from trusted certificates. 3880 3881 Examples: 3882 govc library.trust.rm $id 3883 3884 Options: 3885 ``` 3886 3887 ## library.update 3888 3889 ``` 3890 Usage: govc library.update [OPTIONS] PATH 3891 3892 Update library or item PATH. 3893 3894 Examples: 3895 govc library.update -d "new library description" -n "new-name" my-library 3896 govc library.update -d "new item description" -n "new-item-name" my-library/my-item 3897 3898 Options: 3899 -d=<nil> Library or item description 3900 -n= Library or item name 3901 ``` 3902 3903 ## library.vmtx.info 3904 3905 ``` 3906 Usage: govc library.vmtx.info [OPTIONS] 3907 3908 Display VMTX template details 3909 3910 Examples: 3911 govc library.vmtx.info /library_name/vmtx_template_name 3912 3913 Options: 3914 ``` 3915 3916 ## license.add 3917 3918 ``` 3919 Usage: govc license.add [OPTIONS] KEY... 3920 3921 Options: 3922 ``` 3923 3924 ## license.assign 3925 3926 ``` 3927 Usage: govc license.assign [OPTIONS] KEY 3928 3929 Assign licenses to HOST or CLUSTER. 3930 3931 Examples: 3932 govc license.assign $VCSA_LICENSE_KEY 3933 govc license.assign -host a_host.example.com $ESX_LICENSE_KEY 3934 govc license.assign -cluster a_cluster $VSAN_LICENSE_KEY 3935 3936 Options: 3937 -cluster= Cluster [GOVC_CLUSTER] 3938 -host= Host system [GOVC_HOST] 3939 -name= Display name 3940 -remove=false Remove assignment 3941 ``` 3942 3943 ## license.assigned.ls 3944 3945 ``` 3946 Usage: govc license.assigned.ls [OPTIONS] 3947 3948 Options: 3949 -id= Entity ID 3950 ``` 3951 3952 ## license.decode 3953 3954 ``` 3955 Usage: govc license.decode [OPTIONS] KEY... 3956 3957 Options: 3958 -feature= List licenses with given feature 3959 ``` 3960 3961 ## license.label.set 3962 3963 ``` 3964 Usage: govc license.label.set [OPTIONS] LICENSE KEY VAL 3965 3966 Set license labels. 3967 3968 Examples: 3969 govc license.label.set 00000-00000-00000-00000-00000 team cnx # add/set label 3970 govc license.label.set 00000-00000-00000-00000-00000 team "" # remove label 3971 govc license.ls -json | jq '.[] | select(.labels[].key == "team") | .licenseKey' 3972 3973 Options: 3974 ``` 3975 3976 ## license.ls 3977 3978 ``` 3979 Usage: govc license.ls [OPTIONS] 3980 3981 Options: 3982 -feature= List licenses with given feature 3983 ``` 3984 3985 ## license.remove 3986 3987 ``` 3988 Usage: govc license.remove [OPTIONS] KEY... 3989 3990 Options: 3991 ``` 3992 3993 ## logs 3994 3995 ``` 3996 Usage: govc logs [OPTIONS] 3997 3998 View VPX and ESX logs. 3999 4000 The '-log' option defaults to "hostd" when connected directly to a host or 4001 when connected to VirtualCenter and a '-host' option is given. Otherwise, 4002 the '-log' option defaults to "vpxd:vpxd.log". The '-host' option is ignored 4003 when connected directly to a host. See 'govc logs.ls' for other '-log' options. 4004 4005 Examples: 4006 govc logs -n 1000 -f 4007 govc logs -host esx1 4008 govc logs -host esx1 -log vmkernel 4009 4010 Options: 4011 -f=false Follow log file changes 4012 -host= Host system [GOVC_HOST] 4013 -log= Log file key 4014 -n=25 Output the last N log lines 4015 ``` 4016 4017 ## logs.download 4018 4019 ``` 4020 Usage: govc logs.download [OPTIONS] [PATH]... 4021 4022 Generate diagnostic bundles. 4023 4024 A diagnostic bundle includes log files and other configuration information. 4025 4026 Use PATH to include a specific set of hosts to include. 4027 4028 Examples: 4029 govc logs.download 4030 govc logs.download host-a host-b 4031 4032 Options: 4033 -default=false Specifies if the bundle should include the default server 4034 ``` 4035 4036 ## logs.ls 4037 4038 ``` 4039 Usage: govc logs.ls [OPTIONS] 4040 4041 List diagnostic log keys. 4042 4043 Examples: 4044 govc logs.ls 4045 govc logs.ls -host host-a 4046 4047 Options: 4048 -host= Host system [GOVC_HOST] 4049 ``` 4050 4051 ## ls 4052 4053 ``` 4054 Usage: govc ls [OPTIONS] [PATH]... 4055 4056 List inventory items. 4057 4058 Examples: 4059 govc ls -l '*' 4060 govc ls -t ClusterComputeResource host 4061 govc ls -t Datastore host/ClusterA/* | grep -v local | xargs -n1 basename | sort | uniq 4062 4063 Options: 4064 -L=false Follow managed object references 4065 -i=false Print the managed object reference 4066 -l=false Long listing format 4067 -t= Object type 4068 ``` 4069 4070 ## metric.change 4071 4072 ``` 4073 Usage: govc metric.change [OPTIONS] NAME... 4074 4075 Change counter NAME levels. 4076 4077 Examples: 4078 govc metric.change -level 1 net.bytesRx.average net.bytesTx.average 4079 4080 Options: 4081 -device-level=0 Level for the per device counter 4082 -i=real Interval ID (real|day|week|month|year) 4083 -level=0 Level for the aggregate counter 4084 ``` 4085 4086 ## metric.info 4087 4088 ``` 4089 Usage: govc metric.info [OPTIONS] PATH [NAME]... 4090 4091 Metric info for NAME. 4092 4093 If PATH is a value other than '-', provider summary and instance list are included 4094 for the given object type. 4095 4096 If NAME is not specified, all available metrics for the given INTERVAL are listed. 4097 An object PATH must be provided in this case. 4098 4099 Examples: 4100 govc metric.info vm/my-vm 4101 govc metric.info -i 300 vm/my-vm 4102 govc metric.info - cpu.usage.average 4103 govc metric.info /dc1/host/cluster cpu.usage.average 4104 4105 Options: 4106 -g= Show info for a specific Group 4107 -i=real Interval ID (real|day|week|month|year) 4108 ``` 4109 4110 ## metric.interval.change 4111 4112 ``` 4113 Usage: govc metric.interval.change [OPTIONS] 4114 4115 Change historical metric intervals. 4116 4117 Examples: 4118 govc metric.interval.change -i 300 -level 2 4119 govc metric.interval.change -i 86400 -enabled=false 4120 4121 Options: 4122 -enabled=<nil> Enable or disable 4123 -i=real Interval ID (real|day|week|month|year) 4124 -level=0 Level 4125 ``` 4126 4127 ## metric.interval.info 4128 4129 ``` 4130 Usage: govc metric.interval.info [OPTIONS] 4131 4132 List historical metric intervals. 4133 4134 Examples: 4135 govc metric.interval.info 4136 govc metric.interval.info -i 300 4137 4138 Options: 4139 -i=real Interval ID (real|day|week|month|year) 4140 ``` 4141 4142 ## metric.ls 4143 4144 ``` 4145 Usage: govc metric.ls [OPTIONS] PATH 4146 4147 List available metrics for PATH. 4148 4149 The default output format is the metric name. 4150 The '-l' flag includes the metric description. 4151 The '-L' flag includes the metric units, instance count (if any) and description. 4152 The instance count is prefixed with a single '@'. 4153 If no aggregate is provided for the metric, instance count is prefixed with two '@@'. 4154 4155 Examples: 4156 govc metric.ls /dc1/host/cluster1 4157 govc metric.ls datastore/* 4158 govc metric.ls -L -g CPU /dc1/host/cluster1/host1 4159 govc metric.ls vm/* | grep mem. | xargs govc metric.sample vm/* 4160 4161 Options: 4162 -L=false Longer listing format 4163 -g= List a specific Group 4164 -i=real Interval ID (real|day|week|month|year) 4165 -l=false Long listing format 4166 ``` 4167 4168 ## metric.reset 4169 4170 ``` 4171 Usage: govc metric.reset [OPTIONS] NAME... 4172 4173 Reset counter NAME to the default level of data collection. 4174 4175 Examples: 4176 govc metric.reset net.bytesRx.average net.bytesTx.average 4177 4178 Options: 4179 -i=real Interval ID (real|day|week|month|year) 4180 ``` 4181 4182 ## metric.sample 4183 4184 ``` 4185 Usage: govc metric.sample [OPTIONS] PATH... NAME... 4186 4187 Sample for object PATH of metric NAME. 4188 4189 Interval ID defaults to 20 (realtime) if supported, otherwise 300 (5m interval). 4190 4191 By default, INSTANCE '*' samples all instances and the aggregate counter. 4192 An INSTANCE value of '-' will only sample the aggregate counter. 4193 An INSTANCE value other than '*' or '-' will only sample the given instance counter. 4194 4195 If PLOT value is set to '-', output a gnuplot script. If non-empty with another 4196 value, PLOT will pipe the script to gnuplot for you. The value is also used to set 4197 the gnuplot 'terminal' variable, unless the value is that of the DISPLAY env var. 4198 Only 1 metric NAME can be specified when the PLOT flag is set. 4199 4200 Examples: 4201 govc metric.sample host/cluster1/* cpu.usage.average 4202 govc metric.sample -plot .png host/cluster1/* cpu.usage.average | xargs open 4203 govc metric.sample vm/* net.bytesTx.average net.bytesTx.average 4204 govc metric.sample -instance vmnic0 vm/* net.bytesTx.average 4205 govc metric.sample -instance - vm/* net.bytesTx.average 4206 4207 Options: 4208 -d=30 Limit object display name to D chars 4209 -i=real Interval ID (real|day|week|month|year) 4210 -instance=* Instance 4211 -n=5 Max number of samples 4212 -plot= Plot data using gnuplot 4213 -t=false Include sample times 4214 ``` 4215 4216 ## namespace.cluster.disable 4217 4218 ``` 4219 Usage: govc namespace.cluster.disable [OPTIONS] 4220 4221 Disables vSphere Namespaces on the specified cluster. 4222 4223 Examples: 4224 govc namespace.cluster.disable -cluster "Workload-Cluster" 4225 4226 Options: 4227 -cluster= Cluster [GOVC_CLUSTER] 4228 ``` 4229 4230 ## namespace.cluster.enable 4231 4232 ``` 4233 Usage: govc namespace.cluster.enable [OPTIONS] 4234 4235 Enable vSphere Namespaces on the cluster. 4236 This operation sets up Kubernetes instance for the cluster along with worker nodes. 4237 4238 Examples: 4239 govc namespace.cluster.enable \ 4240 -cluster "Workload-Cluster" \ 4241 -service-cidr 10.96.0.0/23 \ 4242 -pod-cidrs 10.244.0.0/20 \ 4243 -control-plane-dns 10.10.10.10 \ 4244 -control-plane-dns-names wcp.example.com \ 4245 -workload-network.egress-cidrs 10.0.0.128/26 \ 4246 -workload-network.ingress-cidrs "10.0.0.64/26" \ 4247 -workload-network.switch VDS \ 4248 -workload-network.edge-cluster Edge-Cluster-1 \ 4249 -size TINY \ 4250 -mgmt-network.network "DVPG-Management Network" \ 4251 -mgmt-network.gateway 10.0.0.1 \ 4252 -mgmt-network.starting-address 10.0.0.45 \ 4253 -mgmt-network.subnet-mask 255.255.255.0 \ 4254 -ephemeral-storage-policy "vSAN Default Storage Policy" \ 4255 -control-plane-storage-policy "vSAN Default Storage Policy" \ 4256 -image-storage-policy "vSAN Default Storage Policy" 4257 4258 Options: 4259 -cluster= Cluster [GOVC_CLUSTER] 4260 -control-plane-dns= Comma-separated list of DNS server IP addresses to use on Kubernetes API server, specified in order of preference. 4261 -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. 4262 -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. 4263 -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. 4264 -control-plane-storage-policy= Storage Policy associated with Kubernetes API server. 4265 -ephemeral-storage-policy= Storage Policy associated with ephemeral disks of all the Kubernetes Pods in the cluster. 4266 -image-storage-policy= Storage Policy to be used for container images. 4267 -login-banner= Optional. Disclaimer to be displayed prior to login via the Kubectl plugin. 4268 -mgmt-network.address-count=5 The number of IP addresses in the management range. Optional, but required with network mode STATICRANGE. 4269 -mgmt-network.floating-IP= Optional. The Floating IP used by the HA master cluster in the when network Mode is DHCP. 4270 -mgmt-network.gateway= Gateway to be used for the management IP range 4271 -mgmt-network.mode=STATICRANGE IPv4 address assignment modes. Value is one of: DHCP, STATICRANGE 4272 -mgmt-network.network= Identifier for the management network. 4273 -mgmt-network.starting-address= Denotes the start of the IP range to be used. Optional, but required with network mode STATICRANGE. 4274 -mgmt-network.subnet-mask= Subnet mask of the management network. Optional, but required with network mode STATICRANGE. 4275 -network-provider=NSXT_CONTAINER_PLUGIN Optional. Provider of cluster networking for this vSphere Namespaces cluster. Currently only value supported is: NSXT_CONTAINER_PLUGIN. 4276 -pod-cidrs= CIDR blocks from which Kubernetes allocates pod IP addresses. Comma-separated list. Shouldn't overlap with service, ingress or egress CIDRs. 4277 -service-cidr= CIDR block from which Kubernetes allocates service cluster IP addresses. Shouldn't overlap with pod, ingress or egress CIDRs 4278 -size= The size of the Kubernetes API server and the worker nodes. Value is one of: TINY, SMALL, MEDIUM, LARGE. 4279 -worker-dns= Comma-separated list of DNS server IP addresses to use on the worker nodes, specified in order of preference. 4280 -workload-network.edge-cluster= NSX Edge Cluster to be used for Kubernetes Services of type LoadBalancer, Kubernetes Ingresses, and NSX SNAT. 4281 -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. 4282 -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. 4283 -workload-network.switch= vSphere Distributed Switch used to connect this cluster. 4284 ``` 4285 4286 ## namespace.cluster.ls 4287 4288 ``` 4289 Usage: govc namespace.cluster.ls [OPTIONS] 4290 4291 List namepace enabled clusters. 4292 4293 Examples: 4294 govc namespace.cluster.ls 4295 govc namespace.cluster.ls -l 4296 govc namespace.cluster.ls -json | jq . 4297 4298 Options: 4299 -l=false Long listing format 4300 ``` 4301 4302 ## namespace.create 4303 4304 ``` 4305 Usage: govc namespace.create [OPTIONS] NAME 4306 4307 Creates a new vSphere Namespace on a Supervisor. 4308 4309 The '-library' and '-vm-class' flags can each be specified multiple times. 4310 4311 Examples: 4312 govc namespace.create -supervisor=domain-c1 test-namespace 4313 govc namespace.create -supervisor=domain-c1 -library=dca9cc16-9460-4da0-802c-4aa148ac6cf7 test-namespace 4314 govc namespace.create -supervisor=domain-c1 -library=dca9cc16-9460-4da0-802c-4aa148ac6cf7 -library=dca9cc16-9460-4da0-802c-4aa148ac6cf7 test-namespace 4315 govc namespace.create -supervisor=domain-c1 -vm-class=best-effort-2xlarge test-namespace 4316 govc namespace.create -supervisor=domain-c1 -vm-class=best-effort-2xlarge -vm-class best-effort-4xlarge test-namespace 4317 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 4318 4319 Options: 4320 -library=[] Content library IDs to associate with the vSphere Namespace. 4321 -supervisor= The identifier of the Supervisor. 4322 -vm-class=[] Virtual machine class IDs to associate with the vSphere Namespace. 4323 ``` 4324 4325 ## namespace.info 4326 4327 ``` 4328 Usage: govc namespace.info [OPTIONS] NAME 4329 4330 Displays the details of a vSphere Namespace. 4331 4332 Examples: 4333 govc namespace.info test-namespace 4334 4335 Options: 4336 ``` 4337 4338 ## namespace.logs.download 4339 4340 ``` 4341 Usage: govc namespace.logs.download [OPTIONS] [NAME] 4342 4343 Download namespace cluster support bundle. 4344 4345 If NAME name is "-", bundle is written to stdout. 4346 4347 See also: govc logs.download 4348 4349 Examples: 4350 govc namespace.logs.download -cluster k8s 4351 govc namespace.logs.download -cluster k8s - | tar -xvf - 4352 govc namespace.logs.download -cluster k8s logs.tar 4353 4354 Options: 4355 -cluster= Cluster [GOVC_CLUSTER] 4356 ``` 4357 4358 ## namespace.ls 4359 4360 ``` 4361 Usage: govc namespace.ls [OPTIONS] 4362 4363 Displays the list of vSphere Namespaces. 4364 4365 Examples: 4366 govc namespace.ls 4367 4368 Options: 4369 ``` 4370 4371 ## namespace.rm 4372 4373 ``` 4374 Usage: govc namespace.rm [OPTIONS] NAME 4375 4376 Deletes a vSphere Namespace. 4377 4378 Examples: 4379 govc namespace.rm test-namespace 4380 4381 Options: 4382 ``` 4383 4384 ## namespace.service.activate 4385 4386 ``` 4387 Usage: govc namespace.service.activate [OPTIONS] NAME... 4388 4389 Activates a vSphere Namespace Supervisor Service. 4390 4391 Examples: 4392 govc namespace.service.activate my-supervisor-service other-supervisor-service 4393 4394 Options: 4395 ``` 4396 4397 ## namespace.service.create 4398 4399 ``` 4400 Usage: govc namespace.service.create [OPTIONS] MANIFEST 4401 4402 Creates a vSphere Namespace Supervisor Service. 4403 4404 Examples: 4405 govc namespace.service.create manifest.yaml 4406 4407 Options: 4408 ``` 4409 4410 ## namespace.service.deactivate 4411 4412 ``` 4413 Usage: govc namespace.service.deactivate [OPTIONS] NAME... 4414 4415 Deactivates a vSphere Namespace Supervisor Service. 4416 4417 Examples: 4418 govc namespace.service.deactivate my-supervisor-service other-supervisor-service 4419 4420 Options: 4421 ``` 4422 4423 ## namespace.service.info 4424 4425 ``` 4426 Usage: govc namespace.service.info [OPTIONS] NAME 4427 4428 Gets information of a specific supervisor service. 4429 4430 Examples: 4431 govc namespace.service.info my-supervisor-service 4432 govc namespace.service.info -json my-supervisor-service | jq . 4433 4434 Options: 4435 ``` 4436 4437 ## namespace.service.ls 4438 4439 ``` 4440 Usage: govc namespace.service.ls [OPTIONS] 4441 4442 List namepace registered supervisor services. 4443 4444 Examples: 4445 govc namespace.service.ls 4446 govc namespace.service.ls -l 4447 govc namespace.service.ls -json | jq . 4448 4449 Options: 4450 -l=false Long listing format 4451 ``` 4452 4453 ## namespace.service.rm 4454 4455 ``` 4456 Usage: govc namespace.service.rm [OPTIONS] NAME... 4457 4458 Removes a vSphere Namespace Supervisor Service. 4459 4460 Examples: 4461 govc namespace.service.rm my-supervisor-service other-supervisor-service 4462 4463 Options: 4464 ``` 4465 4466 ## namespace.update 4467 4468 ``` 4469 Usage: govc namespace.update [OPTIONS] NAME 4470 4471 Modifies an existing vSphere Namespace on a Supervisor. 4472 4473 Examples: 4474 govc namespace.update -library=dca9cc16-9460-4da0-802c-4aa148ac6cf7 test-namespace 4475 govc namespace.update -library=dca9cc16-9460-4da0-802c-4aa148ac6cf7 -library=617a3ee3-a2ff-4311-9a7c-0016ccf958bd test-namespace 4476 govc namespace.update -vm-class=best-effort-2xlarge test-namespace 4477 govc namespace.update -vm-class=best-effort-2xlarge -vm-class=best-effort-4xlarge test-namespace 4478 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 4479 4480 Options: 4481 -library=[] Content library IDs to associate with the vSphere Namespace. 4482 -vm-class=[] Virtual machine class IDs to associate with the vSphere Namespace. 4483 ``` 4484 4485 ## namespace.vmclass.create 4486 4487 ``` 4488 Usage: govc namespace.vmclass.create [OPTIONS] NAME 4489 4490 Creates a new virtual machine class. 4491 4492 The name of the virtual machine class has DNS_LABEL restrictions 4493 as specified in "https://tools.ietf.org/html/rfc1123". It 4494 must be an alphanumeric (a-z and 0-9) string and with maximum length 4495 of 63 characters and with the '-' character allowed anywhere except 4496 the first or last character. This name is unique in this vCenter server. 4497 4498 Examples: 4499 govc namespace.vmclass.create -cpus=8 -memory=8192 test-class-01 4500 4501 Options: 4502 -cpus=0 The number of CPUs. 4503 -memory=0 The amount of memory (in MB). 4504 ``` 4505 4506 ## namespace.vmclass.info 4507 4508 ``` 4509 Usage: govc namespace.vmclass.info [OPTIONS] NAME 4510 4511 Displays the details of a virtual machine class. 4512 4513 Examples: 4514 govc namespace.vmclass.info test-class 4515 4516 Options: 4517 ``` 4518 4519 ## namespace.vmclass.ls 4520 4521 ``` 4522 Usage: govc namespace.vmclass.ls [OPTIONS] 4523 4524 Displays the list of virtual machine classes. 4525 4526 Examples: 4527 govc namespace.vmclass.ls 4528 4529 Options: 4530 ``` 4531 4532 ## namespace.vmclass.rm 4533 4534 ``` 4535 Usage: govc namespace.vmclass.rm [OPTIONS] NAME 4536 4537 Deletes a virtual machine class. 4538 4539 Examples: 4540 govc namespace.vmclass.rm test-class 4541 4542 Options: 4543 ``` 4544 4545 ## namespace.vmclass.update 4546 4547 ``` 4548 Usage: govc namespace.vmclass.update [OPTIONS] NAME 4549 4550 Modifies an existing virtual machine class. 4551 4552 Examples: 4553 govc namespace.vmclass.update -cpus=8 -memory=8192 test-class 4554 4555 Options: 4556 -cpus=0 The number of CPUs. 4557 -memory=0 The amount of memory (in MB). 4558 ``` 4559 4560 ## object.collect 4561 4562 ``` 4563 Usage: govc object.collect [OPTIONS] [MOID] [PROPERTY]... 4564 4565 Collect managed object properties. 4566 4567 MOID can be an inventory path or ManagedObjectReference. 4568 MOID defaults to '-', an alias for 'ServiceInstance:ServiceInstance' or the root folder if a '-type' flag is given. 4569 4570 If a '-type' flag is given, properties are collected using a ContainerView object where MOID is the root of the view. 4571 4572 By default only the current property value(s) are collected. To wait for updates, use the '-n' flag or 4573 specify a property filter. A property filter can be specified by prefixing the property name with a '-', 4574 followed by the value to match. 4575 4576 The '-R' flag sets the Filter using the given XML encoded request, which can be captured by 'vcsim -trace' for example. 4577 It can be useful for replaying property filters created by other clients and converting filters to Go code via '-O -dump'. 4578 4579 The '-type' flag value can be a managed entity type or one of the following aliases: 4580 4581 a VirtualApp 4582 c ClusterComputeResource 4583 d Datacenter 4584 f Folder 4585 g DistributedVirtualPortgroup 4586 h HostSystem 4587 m VirtualMachine 4588 n Network 4589 o OpaqueNetwork 4590 p ResourcePool 4591 r ComputeResource 4592 s Datastore 4593 w DistributedVirtualSwitch 4594 4595 Examples: 4596 govc object.collect - content 4597 govc object.collect -s HostSystem:ha-host hardware.systemInfo.uuid 4598 govc object.collect -s /ha-datacenter/vm/foo overallStatus 4599 govc object.collect -s /ha-datacenter/vm/foo -guest.guestOperationsReady true # property filter 4600 govc object.collect -type m / name runtime.powerState # collect properties for multiple objects 4601 govc object.collect -json -n=-1 EventManager:ha-eventmgr latestEvent | jq . 4602 govc object.collect -json -s $(govc object.collect -s - content.perfManager) description.counterType | jq . 4603 govc object.collect -R create-filter-request.xml # replay filter 4604 govc object.collect -R create-filter-request.xml -O # convert filter to Go code 4605 govc object.collect -s vm/my-vm summary.runtime.host | xargs govc ls -L # inventory path of VM's host 4606 govc object.collect -dump -o "network/VM Network" # output Managed Object structure as Go code 4607 govc object.collect -json $vm config | \ # use -json + jq to search array elements 4608 jq -r '.[] | select(.val.hardware.device[].macAddress == "00:0c:29:0c:73:c0") | .val.name' 4609 4610 Options: 4611 -O=false Output the CreateFilter request itself 4612 -R= Raw XML encoded CreateFilter request 4613 -d=, Delimiter for array values 4614 -n=0 Wait for N property updates 4615 -o=false Output the structure of a single Managed Object 4616 -s=false Output property value only 4617 -type=[] Resource type. If specified, MOID is used for a container view root 4618 -wait=0s Max wait time for updates 4619 ``` 4620 4621 ## object.destroy 4622 4623 ``` 4624 Usage: govc object.destroy [OPTIONS] PATH... 4625 4626 Destroy managed objects. 4627 4628 Examples: 4629 govc object.destroy /dc1/network/dvs /dc1/host/cluster 4630 4631 Options: 4632 ``` 4633 4634 ## object.method 4635 4636 ``` 4637 Usage: govc object.method [OPTIONS] PATH... 4638 4639 Enable or disable methods for managed objects. 4640 4641 Examples: 4642 govc object.method -name Destroy_Task -enable=false /dc1/vm/foo 4643 govc object.collect /dc1/vm/foo disabledMethod | grep --color Destroy_Task 4644 govc object.method -name Destroy_Task -enable /dc1/vm/foo 4645 4646 Options: 4647 -enable=true Enable method 4648 -name= Method name 4649 -reason= Reason for disabling method 4650 -source=govc Source ID 4651 ``` 4652 4653 ## object.mv 4654 4655 ``` 4656 Usage: govc object.mv [OPTIONS] PATH... FOLDER 4657 4658 Move managed entities to FOLDER. 4659 4660 Examples: 4661 govc folder.create /dc1/host/example 4662 govc object.mv /dc2/host/*.example.com /dc1/host/example 4663 4664 Options: 4665 ``` 4666 4667 ## object.reload 4668 4669 ``` 4670 Usage: govc object.reload [OPTIONS] PATH... 4671 4672 Reload managed object state. 4673 4674 Examples: 4675 govc datastore.upload $vm.vmx $vm/$vm.vmx 4676 govc object.reload /dc1/vm/$vm 4677 4678 Options: 4679 ``` 4680 4681 ## object.rename 4682 4683 ``` 4684 Usage: govc object.rename [OPTIONS] PATH NAME 4685 4686 Rename managed objects. 4687 4688 Examples: 4689 govc object.rename /dc1/network/dvs1 Switch1 4690 4691 Options: 4692 ``` 4693 4694 ## object.save 4695 4696 ``` 4697 Usage: govc object.save [OPTIONS] [PATH] 4698 4699 Save managed objects. 4700 4701 By default, the object tree and all properties are saved, starting at PATH. 4702 PATH defaults to ServiceContent, but can be specified to save a subset of objects. 4703 The primary use case for this command is to save inventory from a live vCenter and 4704 load it into a vcsim instance. 4705 4706 Examples: 4707 govc object.save -d my-vcenter 4708 vcsim -load my-vcenter 4709 4710 Options: 4711 -1=false Save ROOT only, without its children 4712 -d= Save objects in directory 4713 -f=false Remove existing object directory 4714 -folder= Inventory folder [GOVC_FOLDER] 4715 -r=true Include children of the container view root 4716 -type=[] Resource types to save. Defaults to all types 4717 -v=false Verbose output 4718 ``` 4719 4720 ## option.ls 4721 4722 ``` 4723 Usage: govc option.ls [OPTIONS] [NAME] 4724 4725 List option with the given NAME. 4726 4727 If NAME ends with a dot, all options for that subtree are listed. 4728 4729 Examples: 4730 govc option.ls 4731 govc option.ls config.vpxd.sso. 4732 govc option.ls config.vpxd.sso.sts.uri 4733 4734 Options: 4735 ``` 4736 4737 ## option.set 4738 4739 ``` 4740 Usage: govc option.set [OPTIONS] NAME VALUE 4741 4742 Set option NAME to VALUE. 4743 4744 Examples: 4745 govc option.set log.level info 4746 govc option.set logger.Vsan verbose 4747 4748 Options: 4749 ``` 4750 4751 ## permissions.ls 4752 4753 ``` 4754 Usage: govc permissions.ls [OPTIONS] [PATH]... 4755 4756 List the permissions defined on or effective on managed entities. 4757 4758 Examples: 4759 govc permissions.ls 4760 govc permissions.ls /dc1/host/cluster1 4761 4762 Options: 4763 -a=true Include inherited permissions defined by parent entities 4764 -i=false Use moref instead of inventory path 4765 ``` 4766 4767 ## permissions.remove 4768 4769 ``` 4770 Usage: govc permissions.remove [OPTIONS] [PATH]... 4771 4772 Removes a permission rule from managed entities. 4773 4774 Examples: 4775 govc permissions.remove -principal root 4776 govc permissions.remove -principal $USER@vsphere.local /dc1/host/cluster1 4777 4778 Options: 4779 -f=false Ignore NotFound fault if permission for this entity and user or group does not exist 4780 -group=false True, if principal refers to a group name; false, for a user name 4781 -i=false Use moref instead of inventory path 4782 -principal= User or group for which the permission is defined 4783 ``` 4784 4785 ## permissions.set 4786 4787 ``` 4788 Usage: govc permissions.set [OPTIONS] [PATH]... 4789 4790 Set the permissions managed entities. 4791 4792 Examples: 4793 govc permissions.set -principal root -role Admin 4794 govc permissions.set -principal $USER@vsphere.local -role Admin /dc1/host/cluster1 4795 4796 Options: 4797 -group=false True, if principal refers to a group name; false, for a user name 4798 -i=false Use moref instead of inventory path 4799 -principal= User or group for which the permission is defined 4800 -propagate=true Whether or not this permission propagates down the hierarchy to sub-entities 4801 -role=Admin Permission role name 4802 ``` 4803 4804 ## pool.change 4805 4806 ``` 4807 Usage: govc pool.change [OPTIONS] POOL... 4808 4809 Change the configuration of one or more resource POOLs. 4810 4811 POOL may be an absolute or relative path to a resource pool or a (clustered) 4812 compute host. If it resolves to a compute host, the associated root resource 4813 pool is returned. If a relative path is specified, it is resolved with respect 4814 to the current datacenter's "host" folder (i.e. /ha-datacenter/host). 4815 4816 Paths to nested resource pools must traverse through the root resource pool of 4817 the selected compute host, i.e. "compute-host/Resources/nested-pool". 4818 4819 The same globbing rules that apply to the "ls" command apply here. For example, 4820 POOL may be specified as "*/Resources/*" to expand to all resource pools that 4821 are nested one level under the root resource pool, on all (clustered) compute 4822 hosts in the current datacenter. 4823 4824 Options: 4825 -cpu.expandable=<nil> CPU expandable reservation 4826 -cpu.limit=<nil> CPU limit in MHz 4827 -cpu.reservation=<nil> CPU reservation in MHz 4828 -cpu.shares= CPU shares level or number 4829 -mem.expandable=<nil> Memory expandable reservation 4830 -mem.limit=<nil> Memory limit in MB 4831 -mem.reservation=<nil> Memory reservation in MB 4832 -mem.shares= Memory shares level or number 4833 -name= Resource pool name 4834 ``` 4835 4836 ## pool.create 4837 4838 ``` 4839 Usage: govc pool.create [OPTIONS] POOL... 4840 4841 Create one or more resource POOLs. 4842 4843 POOL may be an absolute or relative path to a resource pool. The parent of the 4844 specified POOL must be an existing resource pool. If a relative path is 4845 specified, it is resolved with respect to the current datacenter's "host" 4846 folder (i.e. /ha-datacenter/host). The basename of the specified POOL is used 4847 as the name for the new resource pool. 4848 4849 The same globbing rules that apply to the "ls" command apply here. For example, 4850 the path to the parent resource pool in POOL may be specified as "*/Resources" 4851 to expand to the root resource pools on all (clustered) compute hosts in the 4852 current datacenter. 4853 4854 For example: 4855 */Resources/test Create resource pool "test" on all (clustered) 4856 compute hosts in the current datacenter. 4857 somehost/Resources/*/nested Create resource pool "nested" in every 4858 resource pool that is a direct descendant of 4859 the root resource pool on "somehost". 4860 4861 Options: 4862 -cpu.expandable=true CPU expandable reservation 4863 -cpu.limit=-1 CPU limit in MHz 4864 -cpu.reservation=0 CPU reservation in MHz 4865 -cpu.shares=normal CPU shares level or number 4866 -mem.expandable=true Memory expandable reservation 4867 -mem.limit=-1 Memory limit in MB 4868 -mem.reservation=0 Memory reservation in MB 4869 -mem.shares=normal Memory shares level or number 4870 ``` 4871 4872 ## pool.destroy 4873 4874 ``` 4875 Usage: govc pool.destroy [OPTIONS] POOL... 4876 4877 Destroy one or more resource POOLs. 4878 4879 POOL may be an absolute or relative path to a resource pool or a (clustered) 4880 compute host. If it resolves to a compute host, the associated root resource 4881 pool is returned. If a relative path is specified, it is resolved with respect 4882 to the current datacenter's "host" folder (i.e. /ha-datacenter/host). 4883 4884 Paths to nested resource pools must traverse through the root resource pool of 4885 the selected compute host, i.e. "compute-host/Resources/nested-pool". 4886 4887 The same globbing rules that apply to the "ls" command apply here. For example, 4888 POOL may be specified as "*/Resources/*" to expand to all resource pools that 4889 are nested one level under the root resource pool, on all (clustered) compute 4890 hosts in the current datacenter. 4891 4892 Options: 4893 -children=false Remove all children pools 4894 ``` 4895 4896 ## pool.info 4897 4898 ``` 4899 Usage: govc pool.info [OPTIONS] POOL... 4900 4901 Retrieve information about one or more resource POOLs. 4902 4903 POOL may be an absolute or relative path to a resource pool or a (clustered) 4904 compute host. If it resolves to a compute host, the associated root resource 4905 pool is returned. If a relative path is specified, it is resolved with respect 4906 to the current datacenter's "host" folder (i.e. /ha-datacenter/host). 4907 4908 Paths to nested resource pools must traverse through the root resource pool of 4909 the selected compute host, i.e. "compute-host/Resources/nested-pool". 4910 4911 The same globbing rules that apply to the "ls" command apply here. For example, 4912 POOL may be specified as "*/Resources/*" to expand to all resource pools that 4913 are nested one level under the root resource pool, on all (clustered) compute 4914 hosts in the current datacenter. 4915 4916 Options: 4917 -a=false List virtual app resource pools 4918 -p=true List resource pools 4919 ``` 4920 4921 ## role.create 4922 4923 ``` 4924 Usage: govc role.create [OPTIONS] NAME [PRIVILEGE]... 4925 4926 Create authorization role. 4927 4928 Optionally populate the role with the given PRIVILEGE(s). 4929 4930 Examples: 4931 govc role.create MyRole 4932 govc role.create NoDC $(govc role.ls Admin | grep -v Datacenter.) 4933 4934 Options: 4935 -i=false Use moref instead of inventory path 4936 ``` 4937 4938 ## role.ls 4939 4940 ``` 4941 Usage: govc role.ls [OPTIONS] [NAME] 4942 4943 List authorization roles. 4944 4945 If NAME is provided, list privileges for the role. 4946 4947 Examples: 4948 govc role.ls 4949 govc role.ls Admin 4950 4951 Options: 4952 -i=false Use moref instead of inventory path 4953 ``` 4954 4955 ## role.remove 4956 4957 ``` 4958 Usage: govc role.remove [OPTIONS] NAME 4959 4960 Remove authorization role. 4961 4962 Examples: 4963 govc role.remove MyRole 4964 govc role.remove MyRole -force 4965 4966 Options: 4967 -force=false Force removal if role is in use 4968 -i=false Use moref instead of inventory path 4969 ``` 4970 4971 ## role.update 4972 4973 ``` 4974 Usage: govc role.update [OPTIONS] NAME [PRIVILEGE]... 4975 4976 Update authorization role. 4977 4978 Set, Add or Remove role PRIVILEGE(s). 4979 4980 Examples: 4981 govc role.update MyRole $(govc role.ls Admin | grep VirtualMachine.) 4982 govc role.update -r MyRole $(govc role.ls Admin | grep VirtualMachine.GuestOperations.) 4983 govc role.update -a MyRole $(govc role.ls Admin | grep Datastore.) 4984 govc role.update -name RockNRole MyRole 4985 4986 Options: 4987 -a=false Add given PRIVILEGE(s) 4988 -i=false Use moref instead of inventory path 4989 -name= Change role name 4990 -r=false Remove given PRIVILEGE(s) 4991 ``` 4992 4993 ## role.usage 4994 4995 ``` 4996 Usage: govc role.usage [OPTIONS] NAME... 4997 4998 List usage for role NAME. 4999 5000 Examples: 5001 govc role.usage 5002 govc role.usage Admin 5003 5004 Options: 5005 -i=false Use moref instead of inventory path 5006 ``` 5007 5008 ## session.login 5009 5010 ``` 5011 Usage: govc session.login [OPTIONS] [PATH] 5012 5013 Session login. 5014 5015 The session.login command is optional, all other govc commands will auto login when given credentials. 5016 The session.login command can be used to: 5017 - Persist a session without writing to disk via the '-cookie' flag 5018 - Acquire a clone ticket 5019 - Login using a clone ticket 5020 - Login using a vCenter Extension certificate 5021 - Issue a SAML token 5022 - Renew a SAML token 5023 - Login using a SAML token 5024 - Avoid passing credentials to other govc commands 5025 - Send an authenticated raw HTTP request 5026 5027 The session.login command can be used for authenticated curl-style HTTP requests when a PATH arg is given. 5028 PATH may also contain a query string. The '-u' flag (GOVC_URL) is used for the URL scheme, host and port. 5029 The request method (-X) defaults to GET. When set to POST, PUT or PATCH, a request body must be provided via stdin. 5030 5031 Examples: 5032 govc session.login -u root:password@host # Creates a cached session in ~/.govmomi/sessions 5033 govc session.ls -u root@host # Use the cached session with another command 5034 ticket=$(govc session.login -u root@host -clone) 5035 govc session.login -u root@host -ticket $ticket 5036 govc session.login -u host -extension com.vmware.vsan.health -cert rui.crt -key rui.key 5037 token=$(govc session.login -u host -cert user.crt -key user.key -issue) # HoK token 5038 bearer=$(govc session.login -u user:pass@host -issue) # Bearer token 5039 token=$(govc session.login -u host -cert user.crt -key user.key -issue -token "$bearer") 5040 govc session.login -u host -cert user.crt -key user.key -token "$token" 5041 token=$(govc session.login -u host -cert user.crt -key user.key -renew -lifetime 24h -token "$token") 5042 # HTTP requests 5043 govc session.login -r -X GET /api/vcenter/namespace-management/clusters | jq . 5044 govc session.login -r -X POST /rest/vcenter/cluster/modules <<<'{"spec": {"cluster": "domain-c9"}}' 5045 5046 Options: 5047 -X= HTTP method 5048 -clone=false Acquire clone ticket 5049 -cookie= Set HTTP cookie for an existing session 5050 -extension= Extension name 5051 -issue=false Issue SAML token 5052 -l=false Output session cookie 5053 -lifetime=10m0s SAML token lifetime 5054 -r=false REST login 5055 -renew=false Renew SAML token 5056 -ticket= Use clone ticket for login 5057 -token= Use SAML token for login or as issue identity 5058 ``` 5059 5060 ## session.logout 5061 5062 ``` 5063 Usage: govc session.logout [OPTIONS] 5064 5065 Logout the current session. 5066 5067 The session.logout command can be used to end the current persisted session. 5068 The session.rm command can be used to remove sessions other than the current session. 5069 5070 Examples: 5071 govc session.logout 5072 5073 Options: 5074 -r=false REST logout 5075 ``` 5076 5077 ## session.ls 5078 5079 ``` 5080 Usage: govc session.ls [OPTIONS] 5081 5082 List active sessions. 5083 5084 All SOAP sessions are listed by default. The '-S' flag will limit this list to the current session. 5085 5086 Examples: 5087 govc session.ls 5088 govc session.ls -json | jq -r .currentSession.key 5089 5090 Options: 5091 -S=false List current SOAP session 5092 -r=false List cached REST session (if any) 5093 ``` 5094 5095 ## session.rm 5096 5097 ``` 5098 Usage: govc session.rm [OPTIONS] KEY... 5099 5100 Remove active sessions. 5101 5102 Examples: 5103 govc session.ls | grep root 5104 govc session.rm 5279e245-e6f1-4533-4455-eb94353b213a 5105 5106 Options: 5107 ``` 5108 5109 ## snapshot.create 5110 5111 ``` 5112 Usage: govc snapshot.create [OPTIONS] NAME 5113 5114 Create snapshot of VM with NAME. 5115 5116 Examples: 5117 govc snapshot.create -vm my-vm happy-vm-state 5118 5119 Options: 5120 -d= Snapshot description 5121 -m=true Include memory state 5122 -q=false Quiesce guest file system 5123 -vm= Virtual machine [GOVC_VM] 5124 ``` 5125 5126 ## snapshot.remove 5127 5128 ``` 5129 Usage: govc snapshot.remove [OPTIONS] NAME 5130 5131 Remove snapshot of VM with given NAME. 5132 5133 NAME can be the snapshot name, tree path, moid or '*' to remove all snapshots. 5134 5135 Examples: 5136 govc snapshot.remove -vm my-vm happy-vm-state 5137 5138 Options: 5139 -c=true Consolidate disks 5140 -r=false Remove snapshot children 5141 -vm= Virtual machine [GOVC_VM] 5142 ``` 5143 5144 ## snapshot.revert 5145 5146 ``` 5147 Usage: govc snapshot.revert [OPTIONS] [NAME] 5148 5149 Revert to snapshot of VM with given NAME. 5150 5151 If NAME is not provided, revert to the current snapshot. 5152 Otherwise, NAME can be the snapshot name, tree path or moid. 5153 5154 Examples: 5155 govc snapshot.revert -vm my-vm happy-vm-state 5156 5157 Options: 5158 -s=false Suppress power on 5159 -vm= Virtual machine [GOVC_VM] 5160 ``` 5161 5162 ## snapshot.tree 5163 5164 ``` 5165 Usage: govc snapshot.tree [OPTIONS] 5166 5167 List VM snapshots in a tree-like format. 5168 5169 The command will exit 0 with no output if VM does not have any snapshots. 5170 5171 Examples: 5172 govc snapshot.tree -vm my-vm 5173 govc snapshot.tree -vm my-vm -D -i -d 5174 5175 Options: 5176 -C=false Print the current snapshot name only 5177 -D=false Print the snapshot creation date 5178 -c=true Print the current snapshot 5179 -d=false Print the snapshot description 5180 -f=false Print the full path prefix for snapshot 5181 -i=false Print the snapshot id 5182 -s=false Print the snapshot size 5183 -vm= Virtual machine [GOVC_VM] 5184 ``` 5185 5186 ## sso.group.create 5187 5188 ``` 5189 Usage: govc sso.group.create [OPTIONS] NAME 5190 5191 Create SSO group. 5192 5193 Examples: 5194 govc sso.group.create NAME 5195 5196 Options: 5197 -d= Group description 5198 ``` 5199 5200 ## sso.group.ls 5201 5202 ``` 5203 Usage: govc sso.group.ls [OPTIONS] [NAME] 5204 5205 List SSO groups. 5206 5207 Examples: 5208 govc sso.group.ls 5209 govc sso.group.ls group-name # list groups in group-name 5210 govc sso.group.ls -search Admin # search for groups 5211 5212 Options: 5213 -search= Search 5214 ``` 5215 5216 ## sso.group.rm 5217 5218 ``` 5219 Usage: govc sso.group.rm [OPTIONS] NAME 5220 5221 Remove SSO group. 5222 5223 Examples: 5224 govc sso.group.rm NAME 5225 5226 Options: 5227 ``` 5228 5229 ## sso.group.update 5230 5231 ``` 5232 Usage: govc sso.group.update [OPTIONS] 5233 5234 Update SSO group. 5235 5236 Examples: 5237 govc sso.group.update -d "Group description" NAME 5238 govc sso.group.update -a user1 NAME 5239 govc sso.group.update -r user2 NAME 5240 govc sso.group.update -g -a group1 NAME 5241 govc sso.group.update -g -r group2 NAME 5242 5243 Options: 5244 -a= Add user/group to group 5245 -d= Group description 5246 -g=false Add/Remove group from group 5247 -r= Remove user/group from group 5248 ``` 5249 5250 ## sso.idp.default.ls 5251 5252 ``` 5253 Usage: govc sso.idp.default.ls [OPTIONS] 5254 5255 List SSO default identity provider sources. 5256 5257 Examples: 5258 govc sso.idp.default.ls 5259 govc sso.idp.default.ls -json 5260 5261 Options: 5262 ``` 5263 5264 ## sso.idp.default.update 5265 5266 ``` 5267 Usage: govc sso.idp.default.update [OPTIONS] NAME 5268 5269 Set SSO default identity provider source. 5270 5271 Examples: 5272 govc sso.idp.default.update NAME 5273 5274 Options: 5275 ``` 5276 5277 ## sso.idp.ldap.update 5278 5279 ``` 5280 Usage: govc sso.idp.ldap.update [OPTIONS] NAME 5281 5282 Update SSO ldap identity provider source. 5283 5284 Examples: 5285 govc sso.idp.ldap.update -FriendlyName CORPLOCAL corp.local 5286 5287 Options: 5288 -AuthPassword= Password 5289 -AuthUsername= Username 5290 -DomainAlias= DomainAlias 5291 -FailoverUrl= FailoverUrl 5292 -FriendlyName= FriendlyName 5293 -GroupBaseDn= GroupBaseDn 5294 -PrimaryUrl= PrimaryUrl 5295 -ServerType=ActiveDirectory ServerType 5296 -UserBaseDn= UserBaseDn 5297 ``` 5298 5299 ## sso.idp.ls 5300 5301 ``` 5302 Usage: govc sso.idp.ls [OPTIONS] 5303 5304 List SSO identity provider sources. 5305 5306 Examples: 5307 govc sso.idp.ls 5308 govc sso.idp.ls -json 5309 5310 Options: 5311 ``` 5312 5313 ## sso.lpp.info 5314 5315 ``` 5316 Usage: govc sso.lpp.info [OPTIONS] 5317 5318 Get SSO local password policy. 5319 5320 Examples: 5321 govc sso.lpp.info 5322 govc sso.lpp.info -json 5323 5324 Options: 5325 ``` 5326 5327 ## sso.lpp.update 5328 5329 ``` 5330 Usage: govc sso.lpp.update [OPTIONS] NAME 5331 5332 Update SSO local password policy. 5333 5334 Examples: 5335 govc sso.lpp.update -PasswordLifetimeDays 0 5336 5337 Options: 5338 -Description= Description 5339 -MaxIdenticalAdjacentCharacters=0 Maximum identical adjacent characters 5340 -MaxLength=0 Maximum length 5341 -MinAlphabeticCount=<nil> Minimum alphabetic count 5342 -MinLength=<nil> Minimim length 5343 -MinLowercaseCount=<nil> Minimum lowercase count 5344 -MinNumericCount=<nil> Minimum numeric count 5345 -MinSpecialCharCount=<nil> Minimum special characters count 5346 -MinUppercaseCount=<nil> Minimum uppercase count 5347 -PasswordLifetimeDays=<nil> Password lifetime days 5348 -ProhibitedPreviousPasswordsCount=0 Prohibited previous passwords count 5349 ``` 5350 5351 ## sso.service.ls 5352 5353 ``` 5354 Usage: govc sso.service.ls [OPTIONS] 5355 5356 List platform services. 5357 5358 Examples: 5359 govc sso.service.ls 5360 govc sso.service.ls -t vcenterserver -P vmomi 5361 govc sso.service.ls -t cs.identity 5362 govc sso.service.ls -t cs.identity -P wsTrust -U 5363 govc sso.service.ls -t cs.identity -json | jq -r .[].ServiceEndpoints[].Url 5364 5365 Options: 5366 -P= Endpoint protocol 5367 -T= Endpoint type 5368 -U=false List endpoint URL(s) only 5369 -l=false Long listing format 5370 -n= Node ID 5371 -p= Service product 5372 -s= Site ID 5373 -t= Service type 5374 ``` 5375 5376 ## sso.user.create 5377 5378 ``` 5379 Usage: govc sso.user.create [OPTIONS] NAME 5380 5381 Create SSO users. 5382 5383 Examples: 5384 govc sso.user.create -C "$(cat cert.pem)" -A -R Administrator NAME # solution user 5385 govc sso.user.create -p password NAME # person user 5386 5387 Options: 5388 -A=<nil> ActAsUser role for solution user WSTrust 5389 -C= Certificate for solution user 5390 -R= Role for solution user (RegularUser|Administrator) 5391 -d= User description 5392 -f= First name 5393 -l= Last name 5394 -m= Email address 5395 -p= Password 5396 ``` 5397 5398 ## sso.user.id 5399 5400 ``` 5401 Usage: govc sso.user.id [OPTIONS] NAME 5402 5403 Print SSO user and group IDs. 5404 5405 Examples: 5406 govc sso.user.id 5407 govc sso.user.id Administrator 5408 govc sso.user.id -json Administrator 5409 5410 Options: 5411 ``` 5412 5413 ## sso.user.ls 5414 5415 ``` 5416 Usage: govc sso.user.ls [OPTIONS] 5417 5418 List SSO users. 5419 5420 Examples: 5421 govc sso.user.ls -s 5422 govc sso.user.ls -group group-name 5423 5424 Options: 5425 -group=false List users in group 5426 -s=false List solution users 5427 -search= Search users in group 5428 ``` 5429 5430 ## sso.user.rm 5431 5432 ``` 5433 Usage: govc sso.user.rm [OPTIONS] NAME 5434 5435 Remove SSO users. 5436 5437 Examples: 5438 govc sso.user.rm NAME 5439 5440 Options: 5441 ``` 5442 5443 ## sso.user.update 5444 5445 ``` 5446 Usage: govc sso.user.update [OPTIONS] NAME 5447 5448 Update SSO users. 5449 5450 Examples: 5451 govc sso.user.update -C "$(cat cert.pem)" NAME 5452 govc sso.user.update -p password NAME 5453 5454 Options: 5455 -A=<nil> ActAsUser role for solution user WSTrust 5456 -C= Certificate for solution user 5457 -R= Role for solution user (RegularUser|Administrator) 5458 -d= User description 5459 -f= First name 5460 -l= Last name 5461 -m= Email address 5462 -p= Password 5463 ``` 5464 5465 ## storage.policy.create 5466 5467 ``` 5468 Usage: govc storage.policy.create [OPTIONS] NAME 5469 5470 Create VM Storage Policy. 5471 5472 Examples: 5473 govc storage.policy.create -category my_cat -tag my_tag MyStoragePolicy # Tag based placement 5474 5475 Options: 5476 -category= Category 5477 -d= Description 5478 -tag= Tag 5479 ``` 5480 5481 ## storage.policy.info 5482 5483 ``` 5484 Usage: govc storage.policy.info [OPTIONS] [NAME] 5485 5486 VM Storage Policy info. 5487 5488 Examples: 5489 govc storage.policy.info 5490 govc storage.policy.info "vSAN Default Storage Policy" 5491 govc storage.policy.info -c -s 5492 5493 Options: 5494 -c=false Check VM Compliance 5495 -s=false Check Storage Compatibility 5496 ``` 5497 5498 ## storage.policy.ls 5499 5500 ``` 5501 Usage: govc storage.policy.ls [OPTIONS] [NAME] 5502 5503 VM Storage Policy listing. 5504 5505 Examples: 5506 govc storage.policy.ls 5507 govc storage.policy.ls "vSAN Default Storage Policy" 5508 govc storage.policy.ls -i "vSAN Default Storage Policy" 5509 5510 Options: 5511 -i=false List policy ID only 5512 ``` 5513 5514 ## storage.policy.rm 5515 5516 ``` 5517 Usage: govc storage.policy.rm [OPTIONS] ID 5518 5519 Remove Storage Policy ID. 5520 5521 Examples: 5522 govc storage.policy.rm "my policy name" 5523 govc storage.policy.rm af7935ab-466d-4b0e-af3c-4ec6bce2112f 5524 5525 Options: 5526 ``` 5527 5528 ## tags.attach 5529 5530 ``` 5531 Usage: govc tags.attach [OPTIONS] NAME PATH 5532 5533 Attach tag NAME to object PATH. 5534 5535 Examples: 5536 govc tags.attach k8s-region-us /dc1 5537 govc tags.attach -c k8s-region us-ca1 /dc1/host/cluster1 5538 5539 Options: 5540 -c= Tag category 5541 ``` 5542 5543 ## tags.attached.ls 5544 5545 ``` 5546 Usage: govc tags.attached.ls [OPTIONS] NAME 5547 5548 List attached tags or objects. 5549 5550 Examples: 5551 govc tags.attached.ls k8s-region-us 5552 govc tags.attached.ls -json k8s-zone-us-ca1 | jq . 5553 govc tags.attached.ls -r /dc1/host/cluster1 5554 govc tags.attached.ls -json -r /dc1 | jq . 5555 5556 Options: 5557 -l=false Long listing format 5558 -r=false List tags attached to resource 5559 ``` 5560 5561 ## tags.category.create 5562 5563 ``` 5564 Usage: govc tags.category.create [OPTIONS] NAME 5565 5566 Create tag category. 5567 5568 This command will output the ID of the new tag category. 5569 5570 Examples: 5571 govc tags.category.create -d "Kubernetes region" -t Datacenter k8s-region 5572 govc tags.category.create -d "Kubernetes zone" k8s-zone 5573 5574 Options: 5575 -d= Description 5576 -m=false Allow multiple tags per object 5577 -t=[] Object types 5578 ``` 5579 5580 ## tags.category.info 5581 5582 ``` 5583 Usage: govc tags.category.info [OPTIONS] [NAME] 5584 5585 Display category info. 5586 5587 If NAME is provided, display info for only that category. 5588 Otherwise display info for all categories. 5589 5590 Examples: 5591 govc tags.category.info 5592 govc tags.category.info k8s-zone 5593 5594 Options: 5595 ``` 5596 5597 ## tags.category.ls 5598 5599 ``` 5600 Usage: govc tags.category.ls [OPTIONS] 5601 5602 List all categories. 5603 5604 Examples: 5605 govc tags.category.ls 5606 govc tags.category.ls -json | jq . 5607 5608 Options: 5609 ``` 5610 5611 ## tags.category.rm 5612 5613 ``` 5614 Usage: govc tags.category.rm [OPTIONS] NAME 5615 5616 Delete category NAME. 5617 5618 Fails if category is used by any tag, unless the '-f' flag is provided. 5619 5620 Examples: 5621 govc tags.category.rm k8s-region 5622 govc tags.category.rm -f k8s-zone 5623 5624 Options: 5625 -f=false Delete tag regardless of attached objects 5626 ``` 5627 5628 ## tags.category.update 5629 5630 ``` 5631 Usage: govc tags.category.update [OPTIONS] NAME 5632 5633 Update category. 5634 5635 The '-t' flag can only be used to add new object types. Removing category types is not supported by vCenter. 5636 5637 Examples: 5638 govc tags.category.update -n k8s-vcp-region -d "Kubernetes VCP region" k8s-region 5639 govc tags.category.update -t ClusterComputeResource k8s-zone 5640 5641 Options: 5642 -d= Description 5643 -m=<nil> Allow multiple tags per object 5644 -n= Name of category 5645 -t=[] Object types 5646 ``` 5647 5648 ## tags.create 5649 5650 ``` 5651 Usage: govc tags.create [OPTIONS] NAME 5652 5653 Create tag. 5654 5655 The '-c' option to specify a tag category is required. 5656 This command will output the ID of the new tag. 5657 5658 Examples: 5659 govc tags.create -d "Kubernetes Zone US CA1" -c k8s-zone k8s-zone-us-ca1 5660 5661 Options: 5662 -c= Category name 5663 -d= Description of tag 5664 ``` 5665 5666 ## tags.detach 5667 5668 ``` 5669 Usage: govc tags.detach [OPTIONS] NAME PATH 5670 5671 Detach tag NAME from object PATH. 5672 5673 Examples: 5674 govc tags.detach k8s-region-us /dc1 5675 govc tags.detach -c k8s-region us-ca1 /dc1/host/cluster1 5676 5677 Options: 5678 -c= Tag category 5679 ``` 5680 5681 ## tags.info 5682 5683 ``` 5684 Usage: govc tags.info [OPTIONS] NAME 5685 5686 Display tags info. 5687 5688 If NAME is provided, display info for only that tag. Otherwise display info for all tags. 5689 5690 Examples: 5691 govc tags.info 5692 govc tags.info k8s-zone-us-ca1 5693 govc tags.info -c k8s-zone 5694 5695 Options: 5696 -C=true Display category name instead of ID 5697 -c= Category name 5698 ``` 5699 5700 ## tags.ls 5701 5702 ``` 5703 Usage: govc tags.ls [OPTIONS] 5704 5705 List tags. 5706 5707 Examples: 5708 govc tags.ls 5709 govc tags.ls -c k8s-zone 5710 govc tags.ls -json | jq . 5711 govc tags.ls -c k8s-region -json | jq . 5712 5713 Options: 5714 -c= Category name 5715 ``` 5716 5717 ## tags.rm 5718 5719 ``` 5720 Usage: govc tags.rm [OPTIONS] NAME 5721 5722 Delete tag NAME. 5723 5724 Fails if tag is attached to any object, unless the '-f' flag is provided. 5725 5726 Examples: 5727 govc tags.rm k8s-zone-us-ca1 5728 govc tags.rm -f -c k8s-zone us-ca2 5729 5730 Options: 5731 -c= Tag category 5732 -f=false Delete tag regardless of attached objects 5733 ``` 5734 5735 ## tags.update 5736 5737 ``` 5738 Usage: govc tags.update [OPTIONS] NAME 5739 5740 Update tag. 5741 5742 Examples: 5743 govc tags.update -d "K8s zone US-CA1" k8s-zone-us-ca1 5744 govc tags.update -d "K8s zone US-CA1" -c k8s-zone us-ca1 5745 5746 Options: 5747 -c= Tag category 5748 -d= Description of tag 5749 -n= Name of tag 5750 ``` 5751 5752 ## task.cancel 5753 5754 ``` 5755 Usage: govc task.cancel [OPTIONS] ID... 5756 5757 Cancel tasks. 5758 5759 Examples: 5760 govc task.cancel task-759 5761 5762 Options: 5763 ``` 5764 5765 ## tasks 5766 5767 ``` 5768 Usage: govc tasks [OPTIONS] [PATH] 5769 5770 Display info for recent tasks. 5771 5772 When a task has completed, the result column includes the task duration on success or 5773 error message on failure. If a task is still in progress, the result column displays 5774 the completion percentage and the task ID. The task ID can be used as an argument to 5775 the 'task.cancel' command. 5776 5777 By default, all recent tasks are included (via TaskManager), but can be limited by PATH 5778 to a specific inventory object. 5779 5780 Examples: 5781 govc tasks # tasks completed within the past 10 minutes 5782 govc tasks -b 24h # tasks completed within the past 24 hours 5783 govc tasks -s queued -s running # incomplete tasks 5784 govc tasks -s error -s success # completed tasks 5785 govc tasks -r /dc1/vm/Namespaces # tasks for VMs in this Folder only 5786 govc tasks -f 5787 govc tasks -f /dc1/host/cluster1 5788 5789 Options: 5790 -b=0s Begin time of task history 5791 -e=0s End time of task history 5792 -f=false Follow recent task updates 5793 -l=false Use long task description 5794 -n=25 Output the last N tasks 5795 -r=false Include child entities when PATH is specified 5796 -s=[] Task states 5797 ``` 5798 5799 ## tree 5800 5801 ``` 5802 Usage: govc tree [OPTIONS] [PATH] 5803 5804 List contents of the inventory in a tree-like format. 5805 5806 Examples: 5807 govc tree -C / 5808 govc tree /datacenter/vm 5809 5810 Options: 5811 -C=false Colorize output 5812 -L=0 Max display depth of the inventory tree 5813 -l=false Follow runtime references (e.g. HostSystem VMs) 5814 -p=false Print the object type 5815 ``` 5816 5817 ## vapp.destroy 5818 5819 ``` 5820 Usage: govc vapp.destroy [OPTIONS] VAPP... 5821 5822 Options: 5823 ``` 5824 5825 ## vapp.power 5826 5827 ``` 5828 Usage: govc vapp.power [OPTIONS] 5829 5830 Options: 5831 -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)) 5832 -off=false Power off 5833 -on=false Power on 5834 -suspend=false Power suspend 5835 -vapp.ipath= Find vapp by inventory path 5836 ``` 5837 5838 ## vcsa.access.consolecli.get 5839 5840 ``` 5841 Usage: govc vcsa.access.consolecli.get [OPTIONS] 5842 5843 Get enabled state of the console-based controlled CLI (TTY1). 5844 5845 Note: This command requires vCenter 7.0.2 or higher. 5846 5847 Examples: 5848 govc vcsa.access.consolecli.get 5849 5850 Options: 5851 ``` 5852 5853 ## vcsa.access.consolecli.set 5854 5855 ``` 5856 Usage: govc vcsa.access.consolecli.set [OPTIONS] 5857 5858 Set enabled state of the console-based controlled CLI (TTY1). 5859 5860 Note: This command requires vCenter 7.0.2 or higher. 5861 5862 Examples: 5863 # Enable Console CLI 5864 govc vcsa.access.consolecli.set -enabled=true 5865 5866 # Disable Console CLI 5867 govc vcsa.access.consolecli.set -enabled=false 5868 5869 Options: 5870 -enabled=false Enable Console CLI. 5871 ``` 5872 5873 ## vcsa.access.dcui.get 5874 5875 ``` 5876 Usage: govc vcsa.access.dcui.get [OPTIONS] 5877 5878 Get enabled state of Direct Console User Interface (DCUI TTY2). 5879 5880 Note: This command requires vCenter 7.0.2 or higher. 5881 5882 Examples: 5883 govc vcsa.access.dcui.get 5884 5885 Options: 5886 ``` 5887 5888 ## vcsa.access.dcui.set 5889 5890 ``` 5891 Usage: govc vcsa.access.dcui.set [OPTIONS] 5892 5893 Set enabled state of Direct Console User Interface (DCUI TTY2). 5894 5895 Note: This command requires vCenter 7.0.2 or higher. 5896 5897 Examples: 5898 # Enable DCUI 5899 govc vcsa.access.dcui.set -enabled=true 5900 5901 # Disable DCUI 5902 govc vcsa.access.dcui.set -enabled=false 5903 5904 Options: 5905 -enabled=false Enable Direct Console User Interface (DCUI TTY2). 5906 ``` 5907 5908 ## vcsa.access.shell.get 5909 5910 ``` 5911 Usage: govc vcsa.access.shell.get [OPTIONS] 5912 5913 Get enabled state of BASH, that is, access to BASH from within the controlled CLI. 5914 5915 Note: This command requires vCenter 7.0.2 or higher. 5916 5917 Examples: 5918 govc vcsa.access.shell.get 5919 5920 Options: 5921 ``` 5922 5923 ## vcsa.access.shell.set 5924 5925 ``` 5926 Usage: govc vcsa.access.shell.set [OPTIONS] 5927 5928 Set enabled state of BASH, that is, access to BASH from within the controlled CLI. 5929 5930 Note: This command requires vCenter 7.0.2 or higher. 5931 5932 Examples: 5933 # Enable Shell 5934 govc vcsa.access.shell.set -enabled=true -timeout=240 5935 5936 # Disable Shell 5937 govc vcsa.access.shell.set -enabled=false 5938 5939 Options: 5940 -enabled=false Enable BASH, that is, access to BASH from within the controlled CLI. 5941 -timeout=0 The timeout (in seconds) specifies how long you enable the Shell access. The maximum timeout is 86400 seconds(1 day). 5942 ``` 5943 5944 ## vcsa.access.ssh.get 5945 5946 ``` 5947 Usage: govc vcsa.access.ssh.get [OPTIONS] 5948 5949 Get enabled state of the SSH-based controlled CLI. 5950 5951 Note: This command requires vCenter 7.0.2 or higher. 5952 5953 Examples: 5954 govc vcsa.access.ssh.get 5955 5956 Options: 5957 ``` 5958 5959 ## vcsa.access.ssh.set 5960 5961 ``` 5962 Usage: govc vcsa.access.ssh.set [OPTIONS] 5963 5964 Set enabled state of the SSH-based controlled CLI. 5965 5966 Note: This command requires vCenter 7.0.2 or higher. 5967 5968 Examples: 5969 # Enable SSH 5970 govc vcsa.access.ssh.set -enabled=true 5971 5972 # Disable SSH 5973 govc vcsa.access.ssh.set -enabled=false 5974 5975 Options: 5976 -enabled=false Enable SSH-based controlled CLI. 5977 ``` 5978 5979 ## vcsa.log.forwarding.info 5980 5981 ``` 5982 Usage: govc vcsa.log.forwarding.info [OPTIONS] 5983 5984 Retrieve the VC Appliance log forwarding configuration 5985 5986 Examples: 5987 govc vcsa.log.forwarding.info 5988 5989 Options: 5990 ``` 5991 5992 ## vcsa.net.proxy.info 5993 5994 ``` 5995 Usage: govc vcsa.net.proxy.info [OPTIONS] 5996 5997 Retrieve the VC networking proxy configuration 5998 5999 Examples: 6000 govc vcsa.net.proxy.info 6001 6002 Options: 6003 ``` 6004 6005 ## vcsa.shutdown.cancel 6006 6007 ``` 6008 Usage: govc vcsa.shutdown.cancel [OPTIONS] 6009 6010 Cancel pending shutdown action. 6011 6012 Note: This command requires vCenter 7.0.2 or higher. 6013 6014 Examples: 6015 govc vcsa.shutdown.cancel 6016 6017 Options: 6018 ``` 6019 6020 ## vcsa.shutdown.get 6021 6022 ``` 6023 Usage: govc vcsa.shutdown.get [OPTIONS] 6024 6025 Get details about the pending shutdown action. 6026 6027 Note: This command requires vCenter 7.0.2 or higher. 6028 6029 Examples: 6030 govc vcsa.shutdown.get 6031 6032 Options: 6033 ``` 6034 6035 ## vcsa.shutdown.poweroff 6036 6037 ``` 6038 Usage: govc vcsa.shutdown.poweroff [OPTIONS] REASON 6039 6040 Power off the appliance. 6041 6042 Note: This command requires vCenter 7.0.2 or higher. 6043 6044 Examples: 6045 govc vcsa.shutdown.poweroff -delay 10 "powering off for maintenance" 6046 6047 Options: 6048 -delay=0 Minutes after which poweroff should start. 6049 ``` 6050 6051 ## vcsa.shutdown.reboot 6052 6053 ``` 6054 Usage: govc vcsa.shutdown.reboot [OPTIONS] REASON 6055 6056 Reboot the appliance. 6057 6058 Note: This command requires vCenter 7.0.2 or higher. 6059 6060 Examples: 6061 govc vcsa.shutdown.reboot -delay 10 "rebooting for maintenance" 6062 6063 Options: 6064 -delay=0 Minutes after which reboot should start. 6065 ``` 6066 6067 ## version 6068 6069 ``` 6070 Usage: govc version [OPTIONS] 6071 6072 Options: 6073 -l=false Print detailed govc version information 6074 -require= Require govc version >= this value 6075 ``` 6076 6077 ## vlcm.depot.baseimages.ls 6078 6079 ``` 6080 Usage: govc vlcm.depot.baseimages.ls [OPTIONS] VLCM 6081 6082 Displays the list of available ESXi base images. 6083 6084 Examples: 6085 govc vlcm.depot.baseimages.ls 6086 6087 Options: 6088 ``` 6089 6090 ## vlcm.depot.offline.create 6091 6092 ``` 6093 Usage: govc vlcm.depot.offline.create [OPTIONS] VLCM 6094 6095 Creates an offline image depot. 6096 6097 Execution will block the terminal for the duration of the task. 6098 6099 Examples: 6100 govc vlcm.depot.offline.create -l=<https://your.server.com/filepath> 6101 govc vlcm.depot.offline.create -l=<https://your.server.com/filepath> -source-type=PULL 6102 govc vlcm.depot.offline.create -file-id=<your file identifier> -source-type=PUSH 6103 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?" 6104 6105 Options: 6106 -d= An optional description 6107 -file-id= File identifier. Only used when source-type is PUSH 6108 -l= The URL to the depot contents. Only applicable when source-type is PULL 6109 -owner-data= Optional data about the depot's owner 6110 -source-type=PULL The depot source type. The default is PULL 6111 ``` 6112 6113 ## vlcm.depot.offline.info 6114 6115 ``` 6116 Usage: govc vlcm.depot.offline.info [OPTIONS] VLCM 6117 6118 Displays the contents of an offline image depot. 6119 6120 Examples: 6121 govc vlcm.depot.offline.info -depot-id=<your depot's identifier> 6122 6123 Options: 6124 -depot-id= The identifier of the depot. Use the 'ls' command to see the list of depots. 6125 ``` 6126 6127 ## vlcm.depot.offline.ls 6128 6129 ``` 6130 Usage: govc vlcm.depot.offline.ls [OPTIONS] VLCM 6131 6132 Displays the list of offline image depots. 6133 6134 Examples: 6135 govc vlcm.depot.offline.ls 6136 6137 Options: 6138 ``` 6139 6140 ## vlcm.depot.offline.rm 6141 6142 ``` 6143 Usage: govc vlcm.depot.offline.rm [OPTIONS] VLCM 6144 6145 Deletes an offline image depot. 6146 6147 Execution will block the terminal for the duration of the task. 6148 6149 Examples: 6150 govc vlcm.depot.offline.rm -depot-id=<your depot's identifier> 6151 6152 Options: 6153 -depot-id= The identifier of the depot. Use the 'ls' command to see the list of depots. 6154 ``` 6155 6156 ## vm.change 6157 6158 ``` 6159 Usage: govc vm.change [OPTIONS] 6160 6161 Change VM configuration. 6162 6163 To add ExtraConfig variables that can read within the guest, use the 'guestinfo.' prefix. 6164 6165 Examples: 6166 govc vm.change -vm $vm -mem.reservation 2048 6167 govc vm.change -vm $vm -e smc.present=TRUE -e ich7m.present=TRUE 6168 # Enable both cpu and memory hotplug on a guest: 6169 govc vm.change -vm $vm -cpu-hot-add-enabled -memory-hot-add-enabled 6170 govc vm.change -vm $vm -e guestinfo.vmname $vm 6171 # Read the contents of a file and use them as ExtraConfig value 6172 govc vm.change -vm $vm -f guestinfo.data="$(realpath .)/vmdata.config" 6173 # Read the variable set above inside the guest: 6174 vmware-rpctool "info-get guestinfo.vmname" 6175 govc vm.change -vm $vm -latency high 6176 govc vm.change -vm $vm -latency normal 6177 govc vm.change -vm $vm -uuid 4139c345-7186-4924-a842-36b69a24159b 6178 govc vm.change -vm $vm -scheduled-hw-upgrade-policy always 6179 6180 Options: 6181 -annotation= VM description 6182 -c=0 Number of CPUs 6183 -cpu-hot-add-enabled=<nil> Enable CPU hot add 6184 -cpu.limit=<nil> CPU limit in MHz 6185 -cpu.reservation=<nil> CPU reservation in MHz 6186 -cpu.shares= CPU shares level or number 6187 -e=[] ExtraConfig. <key>=<value> 6188 -f=[] ExtraConfig. <key>=<absolute path to file> 6189 -g= Guest OS 6190 -iommu-enabled=<nil> Enable IOMMU 6191 -latency= Latency sensitivity (low|normal|high) 6192 -m=0 Size in MB of memory 6193 -mem.limit=<nil> Memory limit in MB 6194 -mem.reservation=<nil> Memory reservation in MB 6195 -mem.shares= Memory shares level or number 6196 -memory-hot-add-enabled=<nil> Enable memory hot add 6197 -memory-pin=<nil> Reserve all guest memory 6198 -name= Display name 6199 -nested-hv-enabled=<nil> Enable nested hardware-assisted virtualization 6200 -scheduled-hw-upgrade-policy= Schedule hardware upgrade policy (onSoftPowerOff|never|always) 6201 -sync-time-with-host=<nil> Enable SyncTimeWithHost 6202 -uuid= BIOS UUID 6203 -vm= Virtual machine [GOVC_VM] 6204 -vpmc-enabled=<nil> Enable CPU performance counters 6205 ``` 6206 6207 ## vm.clone 6208 6209 ``` 6210 Usage: govc vm.clone [OPTIONS] NAME 6211 6212 Clone VM or template to NAME. 6213 6214 Examples: 6215 govc vm.clone -vm template-vm new-vm 6216 govc vm.clone -vm template-vm -link new-vm 6217 govc vm.clone -vm template-vm -snapshot s-name new-vm 6218 govc vm.clone -vm template-vm -link -snapshot s-name new-vm 6219 govc vm.clone -vm template-vm -cluster cluster1 new-vm # use compute cluster placement 6220 govc vm.clone -vm template-vm -datastore-cluster dscluster new-vm # use datastore cluster placement 6221 govc vm.clone -vm template-vm -snapshot $(govc snapshot.tree -vm template-vm -C) new-vm 6222 govc vm.clone -vm template-vm -template new-template # clone a VM template 6223 govc vm.clone -vm=/ClusterName/vm/FolderName/VM_templateName -on=true -host=myesxi01 -ds=datastore01 myVM_name 6224 6225 Options: 6226 -annotation= VM description 6227 -c=0 Number of CPUs 6228 -cluster= Use cluster for VM placement via DRS 6229 -customization= Customization Specification Name 6230 -datastore-cluster= Datastore cluster [GOVC_DATASTORE_CLUSTER] 6231 -ds= Datastore [GOVC_DATASTORE] 6232 -folder= Inventory folder [GOVC_FOLDER] 6233 -force=false Create VM if vmx already exists 6234 -host= Host system [GOVC_HOST] 6235 -link=false Creates a linked clone from snapshot or source VM 6236 -m=0 Size in MB of memory 6237 -net= Network [GOVC_NETWORK] 6238 -net.adapter=e1000 Network adapter type 6239 -net.address= Network hardware address 6240 -net.protocol= Network device protocol. Applicable to vmxnet3vrdma. Default to 'rocev2' 6241 -on=true Power on VM 6242 -pool= Resource pool [GOVC_RESOURCE_POOL] 6243 -snapshot= Snapshot name to clone from 6244 -template=false Create a Template 6245 -vm= Virtual machine [GOVC_VM] 6246 -waitip=false Wait for VM to acquire IP address 6247 ``` 6248 6249 ## vm.console 6250 6251 ``` 6252 Usage: govc vm.console [OPTIONS] VM 6253 6254 Generate console URL or screen capture for VM. 6255 6256 One of VMRC, VMware Player, VMware Fusion or VMware Workstation must be installed to 6257 open VMRC console URLs. 6258 6259 Examples: 6260 govc vm.console my-vm 6261 govc vm.console -capture screen.png my-vm # screen capture 6262 govc vm.console -capture - my-vm | display # screen capture to stdout 6263 open $(govc vm.console my-vm) # MacOSX VMRC 6264 open $(govc vm.console -h5 my-vm) # MacOSX H5 6265 xdg-open $(govc vm.console my-vm) # Linux VMRC 6266 xdg-open $(govc vm.console -h5 my-vm) # Linux H5 6267 6268 Options: 6269 -capture= Capture console screen shot to file 6270 -h5=false Generate HTML5 UI console link 6271 -vm= Virtual machine [GOVC_VM] 6272 -wss=false Generate WebSocket console link 6273 ``` 6274 6275 ## vm.create 6276 6277 ``` 6278 Usage: govc vm.create [OPTIONS] NAME 6279 6280 Create VM. 6281 6282 For a list of possible '-g' IDs, use 'govc vm.option.info' or see: 6283 https://code.vmware.com/apis/358/vsphere/doc/vim.vm.GuestOsDescriptor.GuestOsIdentifier.html 6284 6285 Examples: 6286 govc vm.create -on=false vm-name 6287 govc vm.create -cluster cluster1 vm-name # use compute cluster placement 6288 govc vm.create -datastore-cluster dscluster vm-name # use datastore cluster placement 6289 govc vm.create -m 2048 -c 2 -g freebsd64Guest -net.adapter vmxnet3 -disk.controller pvscsi vm-name 6290 6291 Options: 6292 -annotation= VM description 6293 -c=1 Number of CPUs 6294 -cluster= Use cluster for VM placement via DRS 6295 -datastore-cluster= Datastore cluster [GOVC_DATASTORE_CLUSTER] 6296 -disk= Disk path (to use existing) OR size (to create new, e.g. 20GB) 6297 -disk-datastore= Datastore for disk file 6298 -disk.controller=scsi Disk controller type 6299 -ds= Datastore [GOVC_DATASTORE] 6300 -firmware=bios Firmware type [bios|efi] 6301 -folder= Inventory folder [GOVC_FOLDER] 6302 -force=false Create VM if vmx already exists 6303 -g=otherGuest Guest OS ID 6304 -host= Host system [GOVC_HOST] 6305 -iso= ISO path 6306 -iso-datastore= Datastore for ISO file 6307 -link=true Link specified disk 6308 -m=1024 Size in MB of memory 6309 -net= Network [GOVC_NETWORK] 6310 -net.adapter=e1000 Network adapter type 6311 -net.address= Network hardware address 6312 -net.protocol= Network device protocol. Applicable to vmxnet3vrdma. Default to 'rocev2' 6313 -on=true Power on VM 6314 -pool= Resource pool [GOVC_RESOURCE_POOL] 6315 -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] 6316 ``` 6317 6318 ## vm.customize 6319 6320 ``` 6321 Usage: govc vm.customize [OPTIONS] [NAME] 6322 6323 Customize VM. 6324 6325 Optionally specify a customization spec NAME. 6326 6327 The '-ip', '-netmask' and '-gateway' flags are for static IP configuration. 6328 If the VM has multiple NICs, an '-ip' and '-netmask' must be specified for each. 6329 6330 The '-dns-server' and '-dns-suffix' flags can be specified multiple times. 6331 6332 Windows -tz value requires the Index (hex): https://support.microsoft.com/en-us/help/973627/microsoft-time-zone-index-values 6333 6334 Examples: 6335 govc vm.customize -vm VM NAME 6336 govc vm.customize -vm VM -name my-hostname -ip dhcp 6337 govc vm.customize -vm VM -gateway GATEWAY -ip NEWIP -netmask NETMASK -dns-server DNS1,DNS2 NAME 6338 # Multiple -ip without -mac are applied by vCenter in the order in which the NICs appear on the bus 6339 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 6340 # Multiple -ip with -mac are applied by vCenter to the NIC with the given MAC address 6341 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 6342 # Dual stack IPv4/IPv6, single NIC 6343 govc vm.customize -vm VM -ip 10.0.0.1 -netmask 255.255.255.0 -ip6 '2001:db8::1/64' -name my-hostname NAME 6344 # DHCPv6, single NIC 6345 govc vm.customize -vm VM -ip6 dhcp6 NAME 6346 # Static IPv6, three NICs, last one with two addresses 6347 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 6348 govc vm.customize -vm VM -auto-login 3 NAME 6349 govc vm.customize -vm VM -prefix demo NAME 6350 govc vm.customize -vm VM -tz America/New_York NAME 6351 6352 Options: 6353 -auto-login=0 Number of times the VM should automatically login as an administrator 6354 -dns-server=[] DNS server list 6355 -dns-suffix=[] DNS suffix list 6356 -domain= Domain name 6357 -gateway=[] Gateway 6358 -ip=[] IPv4 address 6359 -ip6=[] IPv6 addresses with optional netmask (defaults to /64), separated by comma 6360 -mac=[] MAC address 6361 -name= Host name 6362 -netmask=[] Netmask 6363 -prefix= Host name generator prefix 6364 -type=Linux Customization type if spec NAME is not specified (Linux|Windows) 6365 -tz= Time zone 6366 -vm= Virtual machine [GOVC_VM] 6367 ``` 6368 6369 ## vm.dataset.create 6370 6371 ``` 6372 Usage: govc vm.dataset.create [OPTIONS] NAME 6373 6374 Create data set on a VM. 6375 6376 This command will output the ID of the new data set. 6377 6378 Examples: 6379 govc vm.dataset.create -vm $vm -d "Data set for project 2" -host-access READ_WRITE -guest-access READ_ONLY com.example.project2 6380 govc vm.dataset.create -vm $vm -d "Data set for project 3" -omit-from-snapshot=false com.example.project3 6381 6382 Options: 6383 -d= Description 6384 -guest-access=READ_WRITE Access to the data set entries from the VM guest OS (NONE|READ_ONLY|READ_WRITE) 6385 -host-access=READ_WRITE Access to the data set entries from the ESXi host and the vCenter (NONE|READ_ONLY|READ_WRITE) 6386 -omit-from-snapshot=<nil> Omit the data set from snapshots and clones of the VM (defaults to false) 6387 -vm= Virtual machine [GOVC_VM] 6388 ``` 6389 6390 ## vm.dataset.entry.get 6391 6392 ``` 6393 Usage: govc vm.dataset.entry.get [OPTIONS] KEY 6394 6395 Read the value of a data set entry. 6396 6397 Examples: 6398 govc vm.dataset.entry.get -vm $vm -dataset com.example.project2 somekey 6399 6400 Options: 6401 -dataset= Data set name or ID 6402 -vm= Virtual machine [GOVC_VM] 6403 ``` 6404 6405 ## vm.dataset.entry.ls 6406 6407 ``` 6408 Usage: govc vm.dataset.entry.ls [OPTIONS] 6409 6410 List the keys of the entries in a data set. 6411 6412 Examples: 6413 govc vm.dataset.entry.ls -vm $vm -dataset com.example.project2 6414 6415 Options: 6416 -dataset= Data set name or ID 6417 -vm= Virtual machine [GOVC_VM] 6418 ``` 6419 6420 ## vm.dataset.entry.rm 6421 6422 ``` 6423 Usage: govc vm.dataset.entry.rm [OPTIONS] KEY 6424 6425 Delete data set entry. 6426 6427 Examples: 6428 govc vm.dataset.entry.rm -vm $vm -dataset com.example.project2 somekey 6429 6430 Options: 6431 -dataset= Data set name or ID 6432 -vm= Virtual machine [GOVC_VM] 6433 ``` 6434 6435 ## vm.dataset.entry.set 6436 6437 ``` 6438 Usage: govc vm.dataset.entry.set [OPTIONS] KEY VALUE 6439 6440 Set the value of a data set entry. 6441 6442 Examples: 6443 govc vm.dataset.entry.set -vm $vm -dataset com.example.project2 somekey somevalue 6444 6445 Options: 6446 -dataset= Data set name or ID 6447 -vm= Virtual machine [GOVC_VM] 6448 ``` 6449 6450 ## vm.dataset.info 6451 6452 ``` 6453 Usage: govc vm.dataset.info [OPTIONS] NAME 6454 6455 Display data set information. 6456 6457 Examples: 6458 govc vm.dataset.info -vm $vm 6459 govc vm.dataset.info -vm $vm com.example.project2 6460 6461 Options: 6462 -vm= Virtual machine [GOVC_VM] 6463 ``` 6464 6465 ## vm.dataset.ls 6466 6467 ``` 6468 Usage: govc vm.dataset.ls [OPTIONS] 6469 6470 List datasets. 6471 6472 Examples: 6473 govc vm.dataset.ls -vm $vm 6474 govc vm.dataset.ls -vm $vm -json | jq '.[].description' 6475 6476 Options: 6477 -vm= Virtual machine [GOVC_VM] 6478 ``` 6479 6480 ## vm.dataset.rm 6481 6482 ``` 6483 Usage: govc vm.dataset.rm [OPTIONS] NAME 6484 6485 Delete data set. 6486 6487 Fails if the data set has entries, unless the '-force' flag is set. 6488 6489 Examples: 6490 govc vm.dataset.rm -vm $vm com.example.project2 6491 govc vm.dataset.rm -vm $vm -force=true com.example.project3 6492 6493 Options: 6494 -force=false Delete the data set even if it has entries 6495 -vm= Virtual machine [GOVC_VM] 6496 ``` 6497 6498 ## vm.dataset.update 6499 6500 ``` 6501 Usage: govc vm.dataset.update [OPTIONS] NAME 6502 6503 Update data set. 6504 6505 Examples: 6506 govc vm.dataset.update -vm $vm -d "New description." -guest-access READ_ONLY com.example.project2 6507 govc vm.dataset.update -vm $vm -omit-from-snapshot=false com.example.project3 6508 6509 Options: 6510 -d= Description 6511 -guest-access= Access to the data set entries from the VM guest OS (NONE|READ_ONLY|READ_WRITE) 6512 -host-access= Access to the data set entries from the ESXi host and the vCenter (NONE|READ_ONLY|READ_WRITE) 6513 -omit-from-snapshot=<nil> Omit the data set from snapshots and clones of the VM 6514 -vm= Virtual machine [GOVC_VM] 6515 ``` 6516 6517 ## vm.destroy 6518 6519 ``` 6520 Usage: govc vm.destroy [OPTIONS] VM... 6521 6522 Power off and delete VM. 6523 6524 When a VM is destroyed, any attached virtual disks are also deleted. 6525 Use the 'device.remove -vm VM -keep disk-*' command to detach and 6526 keep disks if needed, prior to calling vm.destroy. 6527 6528 Examples: 6529 govc vm.destroy my-vm 6530 6531 Options: 6532 ``` 6533 6534 ## vm.disk.attach 6535 6536 ``` 6537 Usage: govc vm.disk.attach [OPTIONS] 6538 6539 Attach existing disk to VM. 6540 6541 A delta disk is created by default, where changes are persisted. Specifying '-link=false' will persist to the same disk. 6542 6543 Examples: 6544 govc vm.disk.attach -vm $name -disk $name/disk1.vmdk 6545 govc device.info -vm $name disk-* # 'File' field is where changes are persisted. 'Parent' field is set when '-link=true' 6546 govc vm.disk.attach -vm $name -disk $name/shared.vmdk -link=false -sharing sharingMultiWriter 6547 govc device.remove -vm $name -keep disk-* # detach disk(s) 6548 6549 Options: 6550 -controller= Disk controller 6551 -disk= Disk path name 6552 -ds= Datastore [GOVC_DATASTORE] 6553 -link=true Link specified disk 6554 -mode= Disk mode (persistent|nonpersistent|undoable|independent_persistent|independent_nonpersistent|append) 6555 -persist=true Persist attached disk 6556 -sharing= Sharing (sharingNone|sharingMultiWriter) 6557 -vm= Virtual machine [GOVC_VM] 6558 ``` 6559 6560 ## vm.disk.change 6561 6562 ``` 6563 Usage: govc vm.disk.change [OPTIONS] 6564 6565 Change some properties of a VM's DISK 6566 6567 In particular, you can change the DISK mode, and the size (as long as it is bigger) 6568 6569 Examples: 6570 govc vm.disk.change -vm VM -disk.key 2001 -size 10G 6571 govc vm.disk.change -vm VM -disk.label "BDD disk" -size 10G 6572 govc vm.disk.change -vm VM -disk.name "hard-1000-0" -size 12G 6573 govc vm.disk.change -vm VM -disk.filePath "[DS] VM/VM-1.vmdk" -mode nonpersistent 6574 6575 Options: 6576 -disk.filePath= Disk file name 6577 -disk.io.limit=<nil> Disk storage IO per seconds limit (-1 for unlimited) 6578 -disk.key=0 Disk unique key 6579 -disk.label= Disk label 6580 -disk.name= Disk name 6581 -mode= Disk mode (persistent|nonpersistent|undoable|independent_persistent|independent_nonpersistent|append) 6582 -sharing= Sharing (sharingNone|sharingMultiWriter) 6583 -size=0B New disk size 6584 -vm= Virtual machine [GOVC_VM] 6585 ``` 6586 6587 ## vm.disk.create 6588 6589 ``` 6590 Usage: govc vm.disk.create [OPTIONS] 6591 6592 Create disk and attach to VM. 6593 6594 Examples: 6595 govc vm.disk.create -vm $name -name $name/disk1 -size 10G 6596 govc vm.disk.create -vm $name -name $name/disk2 -size 10G -eager -thick -sharing sharingMultiWriter 6597 6598 Options: 6599 -controller= Disk controller 6600 -ds= Datastore [GOVC_DATASTORE] 6601 -eager=false Eagerly scrub new disk 6602 -mode=persistent Disk mode (persistent|nonpersistent|undoable|independent_persistent|independent_nonpersistent|append) 6603 -name= Name for new disk 6604 -sharing= Sharing (sharingNone|sharingMultiWriter) 6605 -size=10.0GB Size of new disk 6606 -thick=false Thick provision new disk 6607 -vm= Virtual machine [GOVC_VM] 6608 ``` 6609 6610 ## vm.guest.tools 6611 6612 ``` 6613 Usage: govc vm.guest.tools [OPTIONS] VM... 6614 6615 Manage guest tools in VM. 6616 6617 Examples: 6618 govc vm.guest.tools -mount VM 6619 govc vm.guest.tools -unmount VM 6620 govc vm.guest.tools -upgrade -options "opt1 opt2" VM 6621 6622 Options: 6623 -mount=false Mount tools CD installer in the guest 6624 -options= Installer options 6625 -unmount=false Unmount tools CD installer in the guest 6626 -upgrade=false Upgrade tools in the guest 6627 ``` 6628 6629 ## vm.info 6630 6631 ``` 6632 Usage: govc vm.info [OPTIONS] VM... 6633 6634 Display info for VM. 6635 6636 The '-r' flag displays additional info for CPU, memory and storage usage, 6637 along with the VM's Datastores, Networks and PortGroups. 6638 6639 Examples: 6640 govc vm.info $vm 6641 govc vm.info -r $vm | grep Network: 6642 govc vm.info -json $vm 6643 govc find . -type m -runtime.powerState poweredOn | xargs govc vm.info 6644 6645 Options: 6646 -e=false Show ExtraConfig 6647 -g=true Show general summary 6648 -r=false Show resource summary 6649 -t=false Show ToolsConfigInfo 6650 -waitip=false Wait for VM to acquire IP address 6651 ``` 6652 6653 ## vm.instantclone 6654 6655 ``` 6656 Usage: govc vm.instantclone [OPTIONS] NAME 6657 6658 Instant Clone VM to NAME. 6659 6660 Examples: 6661 govc vm.instantclone -vm source-vm new-vm 6662 # Configure ExtraConfig variables on a guest VM: 6663 govc vm.instantclone -vm source-vm -e guestinfo.ipaddress=192.168.0.1 -e guestinfo.netmask=255.255.255.0 new-vm 6664 # Read the variable set above inside the guest: 6665 vmware-rpctool "info-get guestinfo.ipaddress" 6666 vmware-rpctool "info-get guestinfo.netmask" 6667 6668 Options: 6669 -ds= Datastore [GOVC_DATASTORE] 6670 -e=[] ExtraConfig. <key>=<value> 6671 -folder= Inventory folder [GOVC_FOLDER] 6672 -net= Network [GOVC_NETWORK] 6673 -net.adapter=e1000 Network adapter type 6674 -net.address= Network hardware address 6675 -net.protocol= Network device protocol. Applicable to vmxnet3vrdma. Default to 'rocev2' 6676 -pool= Resource pool [GOVC_RESOURCE_POOL] 6677 -vm= Virtual machine [GOVC_VM] 6678 ``` 6679 6680 ## vm.ip 6681 6682 ``` 6683 Usage: govc vm.ip [OPTIONS] VM... 6684 6685 List IPs for VM. 6686 6687 By default the vm.ip command depends on vmware-tools to report the 'guest.ipAddress' field and will 6688 wait until it has done so. This value can also be obtained using: 6689 6690 govc vm.info -json $vm | jq -r .virtualMachines[].guest.ipAddress 6691 6692 When given the '-a' flag, only IP addresses for which there is a corresponding virtual nic are listed. 6693 If there are multiple nics, the listed addresses will be comma delimited. The '-a' flag depends on 6694 vmware-tools to report the 'guest.net' field and will wait until it has done so for all nics. 6695 Note that this list includes IPv6 addresses if any, use '-v4' to filter them out. IP addresses reported 6696 by tools for which there is no virtual nic are not included, for example that of the 'docker0' interface. 6697 6698 These values can also be obtained using: 6699 6700 govc vm.info -json $vm | jq -r .virtualMachines[].guest.net[].ipConfig.ipAddress[].ipAddress 6701 6702 When given the '-n' flag, filters '-a' behavior to the nic specified by MAC address or device name. 6703 6704 The 'esxcli' flag does not require vmware-tools to be installed, but does require the ESX host to 6705 have the /Net/GuestIPHack setting enabled. 6706 6707 The 'wait' flag default to 1hr (original default was infinite). If a VM does not obtain an IP within 6708 the wait time, the command will still exit with status 0. 6709 6710 Examples: 6711 govc vm.ip $vm 6712 govc vm.ip -wait 5m $vm 6713 govc vm.ip -a -v4 $vm 6714 govc vm.ip -n 00:0c:29:57:7b:c3 $vm 6715 govc vm.ip -n ethernet-0 $vm 6716 govc host.esxcli system settings advanced set -o /Net/GuestIPHack -i 1 6717 govc vm.ip -esxcli $vm 6718 6719 Options: 6720 -a=false Wait for an IP address on all NICs 6721 -esxcli=false Use esxcli instead of guest tools 6722 -n= Wait for IP address on NIC, specified by device name or MAC 6723 -v4=false Only report IPv4 addresses 6724 -wait=1h0m0s Wait time for the VM obtain an IP address 6725 ``` 6726 6727 ## vm.keystrokes 6728 6729 ``` 6730 Usage: govc vm.keystrokes [OPTIONS] VM 6731 6732 Send Keystrokes to VM. 6733 6734 Examples: 6735 Default Scenario 6736 govc vm.keystrokes -vm $vm -s "root" # writes 'root' to the console 6737 govc vm.keystrokes -vm $vm -c 0x15 # writes an 'r' to the console 6738 govc vm.keystrokes -vm $vm -r 1376263 # writes an 'r' to the console 6739 govc vm.keystrokes -vm $vm -c 0x28 # presses ENTER on the console 6740 govc vm.keystrokes -vm $vm -c 0x4c -la=true -lc=true # sends CTRL+ALT+DEL to console 6741 govc vm.keystrokes -vm $vm -c 0x15,KEY_ENTER # writes an 'r' to the console and press ENTER 6742 6743 List of available aliases: 6744 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 6745 6746 6747 Options: 6748 -c= USB HID Codes (hex) or aliases, comma separated 6749 -la=false Enable/Disable Left Alt 6750 -lc=false Enable/Disable Left Control 6751 -lg=false Enable/Disable Left Gui 6752 -ls=false Enable/Disable Left Shift 6753 -r=0 Raw USB HID Code Value (int32) 6754 -ra=false Enable/Disable Right Alt 6755 -rc=false Enable/Disable Right Control 6756 -rg=false Enable/Disable Right Gui 6757 -rs=false Enable/Disable Right Shift 6758 -s= Raw String to Send 6759 -vm= Virtual machine [GOVC_VM] 6760 ``` 6761 6762 ## vm.markastemplate 6763 6764 ``` 6765 Usage: govc vm.markastemplate [OPTIONS] VM... 6766 6767 Mark VM as a virtual machine template. 6768 6769 Examples: 6770 govc vm.markastemplate $name 6771 6772 Options: 6773 ``` 6774 6775 ## vm.markasvm 6776 6777 ``` 6778 Usage: govc vm.markasvm [OPTIONS] VM... 6779 6780 Mark VM template as a virtual machine. 6781 6782 Examples: 6783 govc vm.markasvm -host host1 $name 6784 govc vm.markasvm -host host1 $name 6785 6786 Options: 6787 -host= Host system [GOVC_HOST] 6788 -pool= Resource pool [GOVC_RESOURCE_POOL] 6789 ``` 6790 6791 ## vm.migrate 6792 6793 ``` 6794 Usage: govc vm.migrate [OPTIONS] VM... 6795 6796 Migrates VM to a specific resource pool, host or datastore. 6797 6798 Examples: 6799 govc vm.migrate -host another-host vm-1 vm-2 vm-3 6800 govc vm.migrate -pool another-pool vm-1 vm-2 vm-3 6801 govc vm.migrate -ds another-ds vm-1 vm-2 vm-3 6802 6803 Options: 6804 -ds= Datastore [GOVC_DATASTORE] 6805 -folder= Inventory folder [GOVC_FOLDER] 6806 -host= Host system [GOVC_HOST] 6807 -pool= Resource pool [GOVC_RESOURCE_POOL] 6808 -priority=defaultPriority The task priority 6809 -vm= Virtual machine [GOVC_VM] 6810 ``` 6811 6812 ## vm.network.add 6813 6814 ``` 6815 Usage: govc vm.network.add [OPTIONS] 6816 6817 Add network adapter to VM. 6818 6819 Examples: 6820 govc vm.network.add -vm $vm -net "VM Network" -net.adapter e1000e 6821 govc vm.network.add -vm $vm -net SwitchName/PortgroupName 6822 govc device.info -vm $vm ethernet-* 6823 6824 Options: 6825 -net= Network [GOVC_NETWORK] 6826 -net.adapter=e1000 Network adapter type 6827 -net.address= Network hardware address 6828 -net.protocol= Network device protocol. Applicable to vmxnet3vrdma. Default to 'rocev2' 6829 -vm= Virtual machine [GOVC_VM] 6830 ``` 6831 6832 ## vm.network.change 6833 6834 ``` 6835 Usage: govc vm.network.change [OPTIONS] DEVICE 6836 6837 Change network DEVICE configuration. 6838 6839 Note that '-net' is currently required with '-net.address', even when not changing the VM network. 6840 6841 Examples: 6842 govc vm.network.change -vm $vm -net PG2 ethernet-0 6843 govc vm.network.change -vm $vm -net PG2 -net.address 00:00:0f:2e:5d:69 ethernet-0 # set to manual MAC address 6844 govc vm.network.change -vm $vm -net PG2 -net.address - ethernet-0 # set to generated MAC address 6845 govc device.info -vm $vm ethernet-* 6846 6847 Options: 6848 -net= Network [GOVC_NETWORK] 6849 -net.adapter=e1000 Network adapter type 6850 -net.address= Network hardware address 6851 -net.protocol= Network device protocol. Applicable to vmxnet3vrdma. Default to 'rocev2' 6852 -vm= Virtual machine [GOVC_VM] 6853 ``` 6854 6855 ## vm.option.info 6856 6857 ``` 6858 Usage: govc vm.option.info [OPTIONS] [GUEST_ID]... 6859 6860 VM config options for CLUSTER. 6861 6862 The config option data contains information about the execution environment for a VM 6863 in the given CLUSTER, and optionally for a specific HOST. 6864 6865 By default, supported guest OS IDs and full name are listed. 6866 6867 Examples: 6868 govc vm.option.info -cluster C0 6869 govc vm.option.info -cluster C0 -dump ubuntu64Guest 6870 govc vm.option.info -cluster C0 -json | jq .guestOSDescriptor[].id 6871 govc vm.option.info -host my_hostname 6872 govc vm.option.info -vm my_vm 6873 6874 Options: 6875 -cluster= Cluster [GOVC_CLUSTER] 6876 -host= Host system [GOVC_HOST] 6877 -id= Option descriptor key 6878 -vm= Virtual machine [GOVC_VM] 6879 ``` 6880 6881 ## vm.option.ls 6882 6883 ``` 6884 Usage: govc vm.option.ls [OPTIONS] 6885 6886 List VM config option keys for CLUSTER. 6887 6888 Examples: 6889 govc vm.option.ls -cluster C0 6890 6891 Options: 6892 -cluster= Cluster [GOVC_CLUSTER] 6893 -host= Host system [GOVC_HOST] 6894 -vm= Virtual machine [GOVC_VM] 6895 ``` 6896 6897 ## vm.power 6898 6899 ``` 6900 Usage: govc vm.power [OPTIONS] NAME... 6901 6902 Invoke VM power operations. 6903 6904 Examples: 6905 govc vm.power -on VM1 VM2 VM3 6906 govc vm.power -on -M VM1 VM2 VM3 6907 govc vm.power -off -force VM1 6908 6909 Options: 6910 -M=false Use Datacenter.PowerOnMultiVM method instead of VirtualMachine.PowerOnVM 6911 -force=false Force (ignore state error and hard shutdown/reboot if tools unavailable) 6912 -off=false Power off 6913 -on=false Power on 6914 -r=false Reboot guest 6915 -reset=false Power reset 6916 -s=false Shutdown guest 6917 -standby=false Standby guest 6918 -suspend=false Power suspend 6919 -wait=true Wait for the operation to complete 6920 ``` 6921 6922 ## vm.question 6923 6924 ``` 6925 Usage: govc vm.question [OPTIONS] 6926 6927 Options: 6928 -answer= Answer to question 6929 -vm= Virtual machine [GOVC_VM] 6930 ``` 6931 6932 ## vm.rdm.attach 6933 6934 ``` 6935 Usage: govc vm.rdm.attach [OPTIONS] 6936 6937 Attach DEVICE to VM with RDM. 6938 6939 Examples: 6940 govc vm.rdm.attach -vm VM -device /vmfs/devices/disks/naa.000000000000000000000000000000000 6941 6942 Options: 6943 -device= Device Name 6944 -vm= Virtual machine [GOVC_VM] 6945 ``` 6946 6947 ## vm.rdm.ls 6948 6949 ``` 6950 Usage: govc vm.rdm.ls [OPTIONS] 6951 6952 List available devices that could be attach to VM with RDM. 6953 6954 Examples: 6955 govc vm.rdm.ls -vm VM 6956 6957 Options: 6958 -vm= Virtual machine [GOVC_VM] 6959 ``` 6960 6961 ## vm.register 6962 6963 ``` 6964 Usage: govc vm.register [OPTIONS] VMX 6965 6966 Add an existing VM to the inventory. 6967 6968 VMX is a path to the vm config file, relative to DATASTORE. 6969 6970 Examples: 6971 govc vm.register path/name.vmx 6972 govc vm.register -template -host $host path/name.vmx 6973 6974 Options: 6975 -ds= Datastore [GOVC_DATASTORE] 6976 -folder= Inventory folder [GOVC_FOLDER] 6977 -host= Host system [GOVC_HOST] 6978 -name= Name of the VM 6979 -pool= Resource pool [GOVC_RESOURCE_POOL] 6980 -template=false Mark VM as template 6981 ``` 6982 6983 ## vm.target.cap.ls 6984 6985 ``` 6986 Usage: govc vm.target.cap.ls [OPTIONS] 6987 6988 List VM config target capabilities. 6989 6990 The config target data contains capabilities about the execution environment for a VM 6991 in the given CLUSTER, and optionally for a specific HOST. 6992 6993 Examples: 6994 govc vm.target.cap.ls -cluster C0 6995 govc vm.target.cap.ls -host my_hostname 6996 govc vm.target.cap.ls -vm my_vm 6997 6998 Options: 6999 -cluster= Cluster [GOVC_CLUSTER] 7000 -host= Host system [GOVC_HOST] 7001 -vm= Virtual machine [GOVC_VM] 7002 ``` 7003 7004 ## vm.target.info 7005 7006 ``` 7007 Usage: govc vm.target.info [OPTIONS] 7008 7009 VM config target info. 7010 7011 The config target data contains information about the execution environment for a VM 7012 in the given CLUSTER, and optionally for a specific HOST. 7013 7014 Examples: 7015 govc vm.target.info -cluster C0 7016 govc vm.target.info -host my_hostname 7017 govc vm.target.info -vm my_vm 7018 7019 Options: 7020 -cluster= Cluster [GOVC_CLUSTER] 7021 -datastore=true Include Datastores 7022 -device=true Include Devices 7023 -disk=false Include Disks 7024 -host= Host system [GOVC_HOST] 7025 -network=true Include Networks 7026 -vm= Virtual machine [GOVC_VM] 7027 ``` 7028 7029 ## vm.unregister 7030 7031 ``` 7032 Usage: govc vm.unregister [OPTIONS] VM... 7033 7034 Remove VM from inventory without removing any of the VM files on disk. 7035 7036 Options: 7037 ``` 7038 7039 ## vm.upgrade 7040 7041 ``` 7042 Usage: govc vm.upgrade [OPTIONS] 7043 7044 Upgrade VMs to latest hardware version 7045 7046 Examples: 7047 govc vm.upgrade -vm $vm_name 7048 govc vm.upgrade -version=$version -vm $vm_name 7049 govc vm.upgrade -version=$version -vm.uuid $vm_uuid 7050 7051 Options: 7052 -version=0 Target vm hardware version, by default -- latest available 7053 -vm= Virtual machine [GOVC_VM] 7054 ``` 7055 7056 ## vm.vnc 7057 7058 ``` 7059 Usage: govc vm.vnc [OPTIONS] VM... 7060 7061 Enable or disable VNC for VM. 7062 7063 Port numbers are automatically chosen if not specified. 7064 7065 If neither -enable or -disable is specified, the current state is returned. 7066 7067 Examples: 7068 govc vm.vnc -enable -password 1234 $vm | awk '{print $2}' | xargs open 7069 7070 Options: 7071 -disable=false Disable VNC 7072 -enable=false Enable VNC 7073 -password= VNC password 7074 -port=-1 VNC port (-1 for auto-select) 7075 -port-range=5900-5999 VNC port auto-select range 7076 ``` 7077 7078 ## volume.ls 7079 7080 ``` 7081 Usage: govc volume.ls [OPTIONS] [ID...] 7082 7083 List CNS volumes. 7084 7085 Examples: 7086 govc volume.ls 7087 govc volume.ls -l 7088 govc volume.ls -ds vsanDatastore 7089 govc volume.ls df86393b-5ae0-4fca-87d0-b692dbc67d45 7090 govc disk.ls -l $(govc volume.ls -L pvc-9744a4ff-07f4-43c4-b8ed-48ea7a528734) 7091 7092 Options: 7093 -L=false List volume disk or file backing ID only 7094 -ds= Datastore [GOVC_DATASTORE] 7095 -i=false List volume ID only 7096 -l=false Long listing format 7097 ``` 7098 7099 ## volume.rm 7100 7101 ``` 7102 Usage: govc volume.rm [OPTIONS] ID 7103 7104 Remove CNS volume. 7105 7106 Note: if volume.rm returns not found errors, 7107 consider using 'govc disk.ls -R' to reconcile the datastore inventory. 7108 7109 Examples: 7110 govc volume.rm f75989dc-95b9-4db7-af96-8583f24bc59d 7111 7112 Options: 7113 ``` 7114 7115 ## volume.snapshot.create 7116 7117 ``` 7118 Usage: govc volume.snapshot.create [OPTIONS] [ID] [DESC] 7119 7120 Create snapshot of volume ID with description DESC. 7121 7122 Examples: 7123 govc volume.snapshot.create df86393b-5ae0-4fca-87d0-b692dbc67d45 my-snapshot 7124 govc volume.snapshot.create -i df86393b-5ae0-4fca-87d0-b692dbc67d45 my-snapshot 7125 7126 Options: 7127 -i=false Output snapshot ID and volume ID only 7128 ``` 7129 7130 ## volume.snapshot.ls 7131 7132 ``` 7133 Usage: govc volume.snapshot.ls [OPTIONS] [ID]... 7134 7135 List all snapshots of volume ID. 7136 7137 Use a list of volume IDs to list all snapshots of multiple volumes at once. 7138 7139 Examples: 7140 govc volume.snapshot.ls df86393b-5ae0-4fca-87d0-b692dbc67d45 7141 govc volume.snapshot.ls -i df86393b-5ae0-4fca-87d0-b692dbc67d45 7142 govc volume.snapshot.ls -l df86393b-5ae0-4fca-87d0-b692dbc67d45 7143 govc volume.snapshot.ls -l $(govc volume.ls -i) 7144 7145 Options: 7146 -i=false List snapshot ID and volume ID only 7147 -l=false Long listing format 7148 ``` 7149 7150 ## volume.snapshot.rm 7151 7152 ``` 7153 Usage: govc volume.snapshot.rm [OPTIONS] [SNAP_ID VOL_ID]... 7154 7155 Remove snapshot SNAP_ID from volume VOL_ID. 7156 7157 Use a list of [SNAP_ID VOL_ID] pairs to remove multiple snapshots at once. 7158 7159 Examples: 7160 govc volume.snapshot.rm f75989dc-95b9-4db7-af96-8583f24bc59d df86393b-5ae0-4fca-87d0-b692dbc67d45 7161 govc volume.snapshot.rm $(govc volume.snapshot.ls -i df86393b-5ae0-4fca-87d0-b692dbc67d45) 7162 govc volume.snapshot.rm $(govc volume.snapshot.create -i df86393b-5ae0-4fca-87d0-b692dbc67d45 my-snapshot) 7163 govc volume.snapshot.rm $(govc volume.snapshot.ls -i $(govc volume.ls -i)) 7164 7165 Options: 7166 ``` 7167 7168 ## vsan.change 7169 7170 ``` 7171 Usage: govc vsan.change [OPTIONS] CLUSTER 7172 7173 Change vSAN configuration. 7174 7175 Examples: 7176 govc vsan.change -unmap-enabled ClusterA # enable unmap 7177 govc vsan.change -unmap-enabled=false ClusterA # disable unmap 7178 7179 Options: 7180 -unmap-enabled=<nil> Enable Unmap 7181 ``` 7182 7183 ## vsan.info 7184 7185 ``` 7186 Usage: govc vsan.info [OPTIONS] CLUSTER... 7187 7188 Display vSAN configuration. 7189 7190 Examples: 7191 govc vsan.info 7192 govc vsan.info ClusterA 7193 govc vsan.info -json 7194 7195 Options: 7196 ``` 7197