{"id":29016623,"url":"https://github.com/chef/knife-vcenter","last_synced_at":"2025-06-25T22:32:54.497Z","repository":{"id":45130186,"uuid":"98209686","full_name":"chef/knife-vcenter","owner":"chef","description":"Chef knife plug-in for VMware REST API","archived":false,"fork":false,"pushed_at":"2024-07-22T09:54:15.000Z","size":195,"stargazers_count":10,"open_issues_count":8,"forks_count":7,"subscribers_count":28,"default_branch":"main","last_synced_at":"2025-06-11T09:15:23.237Z","etag":null,"topics":["chef","knife","knife-plugin","rest-api","vcenter","vmware"],"latest_commit_sha":null,"homepage":"https://www.chef.io/implementations/vmware","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/chef.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-07-24T16:07:53.000Z","updated_at":"2025-01-18T07:01:41.000Z","dependencies_parsed_at":"2024-07-05T20:36:35.356Z","dependency_job_id":null,"html_url":"https://github.com/chef/knife-vcenter","commit_stats":{"total_commits":128,"total_committers":13,"mean_commits":9.846153846153847,"dds":0.8125,"last_synced_commit":"26beed8b51ebd384ff333aac0a46a35bf60f9e67"},"previous_names":[],"tags_count":28,"template":false,"template_full_name":null,"purl":"pkg:github/chef/knife-vcenter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chef%2Fknife-vcenter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chef%2Fknife-vcenter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chef%2Fknife-vcenter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chef%2Fknife-vcenter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chef","download_url":"https://codeload.github.com/chef/knife-vcenter/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chef%2Fknife-vcenter/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260697012,"owners_count":23048199,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["chef","knife","knife-plugin","rest-api","vcenter","vmware"],"created_at":"2025-06-25T22:30:59.755Z","updated_at":"2025-06-25T22:32:54.483Z","avatar_url":"https://github.com/chef.png","language":"Ruby","readme":"# knife-vcenter\n\n[![Gem Version](https://badge.fury.io/rb/knife-vcenter.svg)](https://rubygems.org/gems/knife-vcenter)\n[![Build status](https://badge.buildkite.com/47217bb5529337a493a4a29c8e45ea95f88997d981c2549b42.svg?branch=master)](https://buildkite.com/chef-oss/chef-knife-vcenter-master-verify)\n\n**Umbrella Project**: [Knife](https://github.com/chef/chef-oss-practices/blob/master/projects/knife.md)\n\n **Project State**: [Active](https://github.com/chef/chef-oss-practices/blob/master/repo-management/repo-states.md#active)\n\n **Issues [Response Time Maximum](https://github.com/chef/chef-oss-practices/blob/master/repo-management/repo-states.md)**: 14 days\n\n **Pull Request [Response Time Maximum](https://github.com/chef/chef-oss-practices/blob/master/repo-management/repo-states.md)**: 14 days\n\nThis is the official Chef Knife plugin for VMware REST API. This plugin gives knife the ability to create, bootstrap, and manage VMware vms.\n- Documentation: [https://github.com/chef/knife-vcenter/blob/master/README.md](https://github.com/chef/knife-vcenter/blob/master/README.md)\n- Source: [https://github.com/chef/knife-vcenter/tree/master](https://github.com/chef/knife-vcenter/tree/master)\n- Issues: [https://github.com/chef/knife-vcenter/issues](https://github.com/chef/knife-vcenter/issues)\n- Slack: sign up: https://code.vmware.com/slack/ slack channel: #chef\n- Mailing list: [https://discourse.chef.io/](https://discourse.chef.io/)\n\nThis is a `knife` plugin that allows interaction with vSphere using the vSphere Automation SDK.\n\nPlease refer to the [CHANGELOG](CHANGELOG.md) for version history and known issues.\n\n## Requirements\n\n- Chef 13.0 higher\n- Ruby 2.3.3 or higher\n\n## Installation\n\nUsing [ChefDK](https://downloads.chef.io/chef-dk/), simply install the Gem:\n\n```bash\nchef gem install knife-vcenter\n```\n\nIf you're using bundler, simply add Chef and knife-vcenter to your Gemfile:\n\n```ruby\ngem 'chef'\ngem 'knife-vcenter'\n```\n\n## Configuration\n\nIn order to communicate with vSphere, you must specify your user credentials. You can specify them in your `knife.rb` file:\n\n```ruby\nknife[:vcenter_username] = \"myuser\"\nknife[:vcenter_password] = \"mypassword\"\nknife[:vcenter_host] = \"172.16.20.2\"\nknife[:vcenter_disable_ssl_verify] = true # if you want to disable SSL checking\n```\n\nor alternatively you can supply them on the command-line:\n\n```bash\nknife vcenter _command_ --vcenter-username myuser --vcenter-password mypassword\n```\n\n### vCenter Permissions\n\nYou need the following permissions (at minimum) on your user to be able to use `knife-vcenter`.\n\n* Datastore\n    * Allocate space :ballot_box_with_check:\n    * Browse datastore :ballot_box_with_check:\n* Host\n    * Local Operations\n         * Create virtual machine :ballot_box_with_check:\n         * Delete virtual machine :ballot_box_with_check:\n         * Manage user groups :ballot_box_with_check:\n         * Reconfigure virtual machine :ballot_box_with_check:\n * Network\n    * Assign Network :ballot_box_with_check:\n * Resource\n    * Assign virtual machine to resource pool :ballot_box_with_check:\n * Virtual Machine :ballot_box_with_check:\n\n\n## Usage\n\n### knife vcenter cluster list\n\nLists the clusters on the connected vSphere environment\n\n```\n$ knife vcenter cluster list\nID           Name     DRS?   HA?\ndomain-c123  Cluster  False  False\n```\n\n## knife vcenter datacenter list\n\nList the data centers configures in the vSphere environment\n\n```\n$ knife vcenter datacenter list\nID             Name\ndatacenter-21  Datacenter\n```\n\n## knife vcenter host list\n\nList the hosts in the vSphere in the vSphere environment\n\n```\n$ knife vcenter host list\nID       Name          Power State  Connection State\nhost-28  172.16.20.3   POWERED_ON   CONNECTED\nhost-64  172.16.20.41  POWERED_ON   CONNECTED\nhost-69  172.16.20.42  POWERED_ON   CONNECTED\nhost-74  172.16.20.43  POWERED_ON   CONNECTED\nhost-79  172.16.20.44  POWERED_ON   CONNECTED\n```\n\n## knife vcenter vm list\n\nList out all the virtual machines that exist in the vSphere environment\n\n```\n$ knife vcenter vm list\nID      Name                             Power State  CPU Count  RAM Size (MB)\nvm-42   alpine-docker                    POWERED_OFF  1          4,024\nvm-35   automate-ubuntu                  POWERED_OFF  1          4,096\nvm-44   chef                             POWERED_OFF  1          4,096\nvm-33   chef-automate                    POWERED_OFF  1          4,096\nvm-34   chef-buildnode                   POWERED_OFF  1          4,096\nvm-43   chef-compliance                  POWERED_OFF  1          4,096\nvm-71   CyberArk                         POWERED_OFF  1          8,192\nvm-45   jenkins                          POWERED_ON   4          8,096\nvm-36   LFS                              POWERED_OFF  2          4,096\n```\n\n## knife vcenter vm show NAME\n\nDisplay details about a specific virtual machine.\n\n```\n$ knife vcenter vm show chef\nID: vm-44\nName: chef\nPower State: POWERED_OFF\n```\n\n_The IP address of the machine is not returned yet as this requires a call to a different SDK_\n\n## knife vcenter vm clone NAME\n\nCreate a new machine by cloning an existing machine or a template. This machine will be bootstrapped by Chef, as long as all the relevant details are in the `knife.rb` file.\n\nThe following parameters are required:\n\n - `--datacenter` - Datacenter in the vSphere environment that controls the target host\n - `--template` - Name of the virtual machine or template to use\n\nThere are some optional parameters that can be specified:\n\n - `--targethost` - The host that the virtual machine should be created on. If not specified the first host in the cluster is used.\n - `--folder` - Folder that machine should be stored in. If specified this must already exist.\n - `--pool` - Name of the resource pool to use when creating the machine\n - `--disable_power_on` - Do not power on the machine. Default: false\n\n```\n$ knife vcenter vm clone example-01 --targethost 172.16.20.3 --folder example --ssh-password P@ssw0rd! --datacenter Datacenter --template ubuntu16-template -N example-01\nCreating new machine\nWaiting for network interfaces to become available...\nID: vm-183\nName: example-01\nPower State: POWERED_ON\nBootstrapping the server by using bootstrap_protocol: ssh and image_os_type: linux\n\nWaiting for sshd to host (10.0.0.167)\n...\n```\n\n## knife vcenter vm delete NAME\n\nDeletes a virtual machine from vSphere. If you supply `--purge` the machine will be removed from the Chef Server.\n\nNOTE: The `--purge` option default expects the node name and hostname to be the same. Use `-N` if the node name and hostname are different.\n\n```\n$ knife vcenter vm delete example-01 -N example-01 --purge\nCreating new machine\nWaiting for network interfaces to become available...\nID: vm-183\nName: example-01\nPower State: POWERED_ON\nBootstrapping the server by using bootstrap_protocol: ssh and image_os_type: linux\n\nWaiting for sshd to host (10.0.0.167)\nWARNING: Deleted node example-01\nWARNING: Deleted client example-01\n```\n\n## Contributing\n\nFor information on contributing to this project see \u003chttps://github.com/chef/chef/blob/master/CONTRIBUTING.md\u003e\n\n## Development\n\n* Report issues/questions/feature requests on [GitHub Issues][issues]\n\nPull requests are very welcome! Make sure your patches are well tested.\nPlease create a topic branch for every separate change you make. For\nexample:\n\n1. Fork the repo\n2. Create your feature branch (`git checkout -b my-new-feature`)\n3. Run the tests and rubocop, `bundle exec rake spec` and `bundle exec rake rubocop`\n4. Commit your changes (`git commit -am 'Added some feature'`)\n5. Push to the branch (`git push origin my-new-feature`)\n6. Create new Pull Request\n\n## License\n\nAuthor:: Russell Seymour ([rseymour@chef.io](mailto:rseymour@chef.io))\n\nAuthor:: JJ Asghar ([jj@chef.io](mailto:jj@chef.io))\n\nCopyright:: Copyright (c) 2017-2020 Chef Software, Inc.\n\nLicense:: Apache License, Version 2.0\n\n```text\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n    http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchef%2Fknife-vcenter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchef%2Fknife-vcenter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchef%2Fknife-vcenter/lists"}