{"id":28125171,"url":"https://github.com/xing/cloudinit-vmware-guestinfo","last_synced_at":"2025-10-08T20:05:32.916Z","repository":{"id":45575056,"uuid":"51076776","full_name":"xing/cloudinit-vmware-guestinfo","owner":"xing","description":null,"archived":false,"fork":false,"pushed_at":"2018-06-15T21:38:41.000Z","size":18,"stargazers_count":19,"open_issues_count":0,"forks_count":5,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-05-14T09:21:19.587Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/xing.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-02-04T13:12:05.000Z","updated_at":"2022-02-02T14:55:02.000Z","dependencies_parsed_at":"2022-09-05T14:00:46.372Z","dependency_job_id":null,"html_url":"https://github.com/xing/cloudinit-vmware-guestinfo","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/xing/cloudinit-vmware-guestinfo","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xing%2Fcloudinit-vmware-guestinfo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xing%2Fcloudinit-vmware-guestinfo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xing%2Fcloudinit-vmware-guestinfo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xing%2Fcloudinit-vmware-guestinfo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xing","download_url":"https://codeload.github.com/xing/cloudinit-vmware-guestinfo/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xing%2Fcloudinit-vmware-guestinfo/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279000704,"owners_count":26082819,"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","status":"online","status_checked_at":"2025-10-08T02:00:06.501Z","response_time":56,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2025-05-14T09:20:37.228Z","updated_at":"2025-10-08T20:05:32.901Z","avatar_url":"https://github.com/xing.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"DataSourceVmwareGuestinfo  vmware guestinfo based provider for cloud-init\n====================\n\n[![Build Status](https://travis-ci.org/xing/cloudinit-vmware-guestinfo.svg?branch=master)](https://travis-ci.org/xing/cloudinit-vmware-guestinfo)\n\nRequirements\n------------------\n\nUbuntu 12.04/14.04: Install package `cloud-init`.\n\n\nInstall\n---------------\n\nCopy `DataSourceVmareGuestinfo.py` to `/usr/lib/python2.7/dist-packages/cloudinit/`.\nEdit `/etc/cloud/cloud.cfg.d/90_dpkg.cfg` to include `VmwareGuestinfo` in the list of providers.\n\nUsage\n----------------\n\nSet the guestinfo key `cloudinit.userdata` to your raw userdata. Optionally set the key `cloudinit.metadata` to a json object containing the necessary metadata.\n\nThe guestinfo settings are buried deep in the vsphere api. They can be set using the `extraConfig` property of [vim.vm.ConfigSpec](https://pubs.vmware.com/vsphere-60/index.jsp?topic=%2Fcom.vmware.wssdk.apiref.doc%2Fvim.vm.ConfigSpec.html). Here is an actual example from our ruby code using rbvmomi:\n\n```ruby\n# Adds guestinfo entries\n# @param [RbVmomi::VIM::VM] vm\n# @param [Hash\u003cString,Object\u003e] guestinfo\ndef add_guestinfo(vm, guestinfo)\n  extraConfig = guestinfo.map do |key, value|\n    {key: \"guestinfo.#{key}\", value: value.to_s}\n  end\n  spec = RbVmomi::VIM.VirtualMachineConfigSpec(extraConfig: extraConfig)\n  vm.ReconfigVM_Task('spec' =\u003e spec).wait_for_completion\nend\n```\n\nMetadata\n---------------\n\nThe guestinfo key `cloudinit.metadata` is interpreted as json and used as metadata.\n\n\nNetwork config\n---------------\n\nVia network-interfaces\n=========================\n\nThe most straight-forward way to configure a virtual machines network is to inject a properly formatted `/etc/network/interfaces` [man page](http://manpages.ubuntu.com/manpages/xenial/man5/interfaces.5.html). This works on all cloud-init versions.\n\nTo do so, add the content of the file to your metadata as `network-interfaces`. This for example sets eth0 to dhcp:\n\n```json\n{\n  \"network-interfaces\":\"auto lo eth0\niface lo inet loopback\niface eth0 inet dhcp\"\n}\n```\n\n\nVia cloudinit.net ( cloud-init \u003e 0.7.7 )\n=================================\n\nNewer versions of cloud-init learned to write different network configs. The config is passed directly in the metadata json as `network-config`. Sadly the exact format is completely undocumented ( hint: `cloudinit/net/__init__.py` :( ).\n\nHere is a documentation by example:\n\n```json\n{\n  \"network-config\": {\n    \"version\": 1,\n    \"config\": [\n      {\n        \"name\":\"lo\",\n        \"type\":\"physical\",\n        \"subnets\":{\n          \"control\":\"auto\",\n          \"type\":\"loopback\"\n        }\n      },\n      {\n        \"name\":\"eth0\",\n        \"type\":\"physical\",\n        \"subnets\":{\n          \"control\":\"auto\",\n          \"type\":\"static\",\n          \"address\":\"1.2.3.4\"\n        }\n      }\n    ]\n  }\n}\n\n```\n\nAuthors\n------------------\n\nHannes Georg @hannesg42\n\nLicense\n-----------------\n\nThe MIT License (MIT)\n\nCopyright (c) 2016 XING AG\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxing%2Fcloudinit-vmware-guestinfo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxing%2Fcloudinit-vmware-guestinfo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxing%2Fcloudinit-vmware-guestinfo/lists"}