Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vcsim: Setting manual mac address on VM Clone #1355

Closed
zeot opened this issue Jan 23, 2019 · 1 comment · Fixed by #1362
Closed

vcsim: Setting manual mac address on VM Clone #1355

zeot opened this issue Jan 23, 2019 · 1 comment · Fixed by #1362
Milestone

Comments

@zeot
Copy link
Contributor

zeot commented Jan 23, 2019

I'm trying to fix an issue in the Ansible module where you're unable to set a manual mac address on an already present network interface when cloning a VM. Got everything working fine when running against our live vSphere 6.5, but the Ansible test is failing due to vcsim not applying these changes.

In the background, the following SOAP body is sent for cloning:

    <?xml
        version="1.0"
        encoding="UTF-8"
        ?>
    <soapenv:Envelope
        xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
        xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xmlns:xsd="http://www.w3.org/2001/XMLSchema">
        <soapenv:Body>
            <CloneVM_Task
                xmlns="urn:vim25">
                <_this
                    type="VirtualMachine">
                    vm-66
                    </_this>
                <folder
                    type="Folder">
                    folder-3
                    </folder>
                <name>
                    nictest00
                    </name>
                <spec>
                    <location>
                        <datastore
                            type="Datastore">
                            /tmp/govcsim-DC0-LocalDS_0-966032278@folder-5
                            </datastore>
                        <pool
                            type="ResourcePool">
                            resgroup-20
                            </pool>
                        </location>
                    <template>
                        false
                        </template>
                    <config>
                        <deviceChange>
                            <operation>
                                edit
                                </operation>
                            <device
                                xsi:type="VirtualVmxnet3">
                                <key>
                                    202
                                    </key>
                                <deviceInfo>
                                    <label>
                                        Network Adapter 1
                                        </label>
                                    <summary>
                                        VM Network
                                        </summary>
                                    </deviceInfo>
                                <backing
                                    xsi:type="VirtualEthernetCardNetworkBackingInfo">
                                    <deviceName>
                                        VM Network
                                        </deviceName>
                                    <network
                                        type="Network">
                                        network-7
                                        </network>
                                    </backing>
                                <connectable>
                                    <startConnected>
                                        true
                                        </startConnected>
                                    <allowGuestControl>
                                        true
                                        </allowGuestControl>
                                    <connected>
                                        true
                                        </connected>
                                    </connectable>
                                <controllerKey>
                                    100
                                    </controllerKey>
                                <unitNumber>
                                    1
                                    </unitNumber>
                                <addressType>
                                    manual
                                    </addressType>
                                <macAddress>
                                    aa:bb:cc:dd:aa:dd
                                    </macAddress>
                                <wakeOnLanEnabled>
                                    true
                                    </wakeOnLanEnabled>
                                </device>
                            </deviceChange>
                        </config>
                    <powerOn>
                        false
                        </powerOn>
                    </spec>
                </CloneVM_Task>
            </soapenv:Body>
        </soapenv:Envelope>

Basically the same request on a live vSphere works fine - the mac address is changed and everyone is happy. On the vcsim, however, the mac address on the new VM is still generated (00:0c:29:8e:f6:af) instead of the manual one requested.

@zeot
Copy link
Contributor Author

zeot commented Jan 25, 2019

I think I found the issue. configureDevices was called with device changes from Location rather than Config.

dougm added a commit that referenced this issue Jan 26, 2019
…on-clone

vcsim: resolve issue making device changes on clone (resolves #1355)
@dougm dougm added this to the 2018.12 milestone Feb 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants