vmware / vmware/pyvmomi

If open-vm-tools installed on VM/template, editing a network device will not connect to it at power on

Open
#243 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

help wanted needs verification
Dominant language
Python
Stars
2.3k
Forks
763
PR merge metrics
No merged PRs in 30d

Description

Trying to edit a network adapter of a VM when cloning it from a template.

If VMware tools is installed, it edits and connects after power on successfully but if open-vm-tools is installed instead, it will edit the network adapter successfully but it will not connect to it at power on automatically. I have to manually check "Connect at power on" from the client which for some reason was unchecked even though in the device specs I marked startConnected = true.

Here's the spec:

      deviceChange = (vim.vm.device.VirtualDeviceSpec) [
         (vim.vm.device.VirtualDeviceSpec) {
            dynamicType = <unset>,
            dynamicProperty = (vmodl.DynamicProperty) [],
            operation = 'edit',
            fileOperation = <unset>,
            device = (vim.vm.device.VirtualE1000) {
               dynamicType = <unset>,
               dynamicProperty = (vmodl.DynamicProperty) [],
               key = 4000,
               deviceInfo = (vim.Description) {
                  dynamicType = <unset>,
                  dynamicProperty = (vmodl.DynamicProperty) [],
                  label = 'Network adapter 1',
                  summary = '10.20.30-VLAN-Test'
               },
               backing = (vim.vm.device.VirtualEthernetCard.DistributedVirtualPortBackingInfo) {
                  dynamicType = <unset>,
                  dynamicProperty = (vmodl.DynamicProperty) [],
                  port = (vim.dvs.PortConnection) {
                     dynamicType = <unset>,
                     dynamicProperty = (vmodl.DynamicProperty) [],
                     switchUuid = '81 b7 0e 50 6e 8f 67 c5-40 46 3a 40 d5 e5 4b 32',
                     portgroupKey = 'dvportgroup-1235',
                     portKey = <unset>,
                     connectionCookie = <unset>
                  }
               },
               connectable = (vim.vm.device.VirtualDevice.ConnectInfo) {
                  dynamicType = <unset>,
                  dynamicProperty = (vmodl.DynamicProperty) [],
                  startConnected = true,
                  allowGuestControl = true,
                  connected = true,
                  status = 'ok'
               },
               slotInfo = <unset>,
               controllerKey = 100,
               unitNumber = 7,
               addressType = 'assigned',
               macAddress = '00:50:56:8e:70:53',
               wakeOnLanEnabled = true
            },
            profile = (vim.vm.ProfileSpec) []
         }
      ]

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the issue's VM cloning and network-device edit specification, especially the connectable fields and the open-vm-tools versus VMware Tools behavior. Reproduce the template clone with open-vm-tools and verify whether the network adapter remains connected at power on; the issue is resolved when startConnected=true is honored without manually enabling the client option.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api, infrastructure
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.