{"id":19737153,"url":"https://github.com/lakostis/govc-scripts","last_synced_at":"2026-04-16T18:38:43.885Z","repository":{"id":83167096,"uuid":"131029266","full_name":"LAKostis/govc-scripts","owner":"LAKostis","description":"govc.sh - wrapper which sets VSphere specific settings and runs govc","archived":false,"fork":false,"pushed_at":"2019-09-20T10:04:40.000Z","size":18,"stargazers_count":2,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-31T08:46:04.008Z","etag":null,"topics":["golang","shell-script","vmware","vmware-esxi","vsphere-api"],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/LAKostis.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-04-25T15:45:19.000Z","updated_at":"2019-09-20T10:04:42.000Z","dependencies_parsed_at":null,"dependency_job_id":"883b5a9d-66b4-4da7-a482-badbb3253f92","html_url":"https://github.com/LAKostis/govc-scripts","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/LAKostis/govc-scripts","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LAKostis%2Fgovc-scripts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LAKostis%2Fgovc-scripts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LAKostis%2Fgovc-scripts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LAKostis%2Fgovc-scripts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LAKostis","download_url":"https://codeload.github.com/LAKostis/govc-scripts/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LAKostis%2Fgovc-scripts/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31899968,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-16T18:22:33.417Z","status":"ssl_error","status_checked_at":"2026-04-16T18:21:47.142Z","response_time":69,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["golang","shell-script","vmware","vmware-esxi","vsphere-api"],"created_at":"2024-11-12T01:09:50.947Z","updated_at":"2026-04-16T18:38:43.844Z","avatar_url":"https://github.com/LAKostis.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Simple scripts to manage vsphere from command line\n\n## govc.sh\n\ngovc.sh - wrapper which sets VSphere specific settings and runs govc.\n\nOther things to install:\n- libshell (http://git.altlinux.org/people/legion/packages/?p=libshell.git;a=summary)\n- jq\n- govc (https://github.com/vmware/govmomi/tree/master/govc)\n\n### Installation\n- git clone libshell, install shell-* files to /usr/local/bin or somewhere in $PATH\n- install govc binary to dir within $PATH\n- install govc.sh wrapper to dir within $PATH\n- create minimal cofiguration with vsphere login/passwd:\n\n```\ncat ~/.terraformware.conf\n....\nvsphere_username = \u003cuser\u003e@\u003cdomain\u003e\n\nvsphere_password = \u003cbase64 encoded password string\u003e\n```\n- create Vsphere DC layout:\n\n```\ncat ~/.vs-dc.ini\n# global settings are not really needed\n# but ease the usage\n[global]\nlocation=ams\n\n[ams]\nurl=ams-prd-vc01.xxxxx\ndc=AMS-PRD-DC01\n\n[brq]\nurl=brq-prd-vc02.xxxxx\ndc=BRQ-PRD-DC01\n```\n\n### Example of use:\n```\n$ govc.sh --help\nUsage: Usage: govc.sh [-l DC] [options] \u003ccmd\u003e \u003cvm\u003e\n\nOptions:\n\n  -l, --location=\u003cFRA|PAR\u003e      VSphere DC location (FRA or PAR);\n  -V, --version                 print program version and exit;\n  -h, --help                    show this text and exit;\n  -j, --json                    use json output.\n\nCommand shortcuts (takes VM as last argument):\n\n  poweron\n  poweroff\n  suspend\n  pstate                        Shows current VM power state\n  info\n  disk_info\n  disk_shrink\n  disk_extend \u003csize\u003e\n  disk_change \u003cmode\u003e\n  memory_extend \u003csize\u003eMb\n  memory_hotadd_check\n  memory_hotadd_enable\n  cpu_add \u003cnr\u003e\n  cpu_remove \u003cnr\u003e\n  cpu_hotadd_check\n  cpu_hotadd_enable\n  cpu_hotremove_check\n  cpu_hotremove_enable\n  ls_snapshot\n  create_snapshot\n  delete_snapshot \u003cname\u003e        Delete defined snapshot\n  revert_snapshot \u003cname\u003e        Revert to defined snapshot\n\nAdvanced usage:\n\ngovc.sh [options] -- \u003cgovc direct cmd\u003e\n```\n\n### Find vm:\n```\n$ govc.sh -l fra -- find vm -name wiki*\nvm/AMS_UBUNTU/\u003cvmname\u003e\n```\n### Query vm config option (via direct option):\n```\n$ govc.sh -l fra -- object.collect -s vm/AMS_UBUNTU/\u003cvmname\u003e config.memoryHotAddEnabled\nfalse\n```\n### Enable memory hotadd (by using shortcut):\n```\n$ govc.sh -l fra poweroff test-nginx01-fra\n$ govc.sh -l fra memory_hotadd_enable test-nginx01-fra\n$ govc.sh -l fra poweron test-nginx01-fra\n$ govc.sh -l fra memory_hotadd_check test-nginx01-fra\ngovc.sh: Enabled\n\n```\n### CPU hotadd/hotremove:\n```\n$ govc.sh -l fra cpu_hotremove_check test-nginx01-fra\ngovc.sh: Enabled\n\n$ govc.sh -l fra cpu_remove 1 test-nginx01-fra\ngovc.sh: Cannot remove CPUs from a running VM\n\n$ govc.sh -l fra poweroff test-nginx01-fra\nShutdown guest VirtualMachine:vm-5749... OK\n\n$ govc.sh -l fra cpu_remove 1 test-nginx01-fra\ngovc.sh: Changing CPU count 4-\u003e3 ..\n\n$ govc.sh -l fra poweron test-nginx01-fra\n...\n\n$ govc.sh -l fra cpu_add 1 test-nginx01-fra\ngovc.sh: Changing CPU count 3-\u003e4 ..\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flakostis%2Fgovc-scripts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flakostis%2Fgovc-scripts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flakostis%2Fgovc-scripts/lists"}