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

vmware_guest: Enable setting mac address when cloning from VM or template #64511

Closed
wants to merge 1 commit into from

Conversation

wkoot
Copy link

@wkoot wkoot commented Nov 6, 2019

SUMMARY

Rebased zeot/devel from #51368 on ansible/devel. Original summary:

The method previously used for device changes when cloning was deprecated in vCenter 6.0. Even though it still works on vCenter 6.5.0, the vcsim did not apply these changes (resolved in govmomi master now, but not released).

For future proofing and testability, the new method of implementing device changes on clone is used when applying device changes when vCenter version 6.0 or greater is detected.

Fixes #51123 and fixes #51124

ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME

lib/ansible/modules/cloud/vmware/vmware_guest.py

ADDITIONAL INFORMATION

I wasn't able to use the suggested prepare_vmware_roles, but tested against a local vsphere instead

@ansibot
Copy link
Contributor

ansibot commented Nov 6, 2019

@ansibot
Copy link
Contributor

ansibot commented Nov 6, 2019

@wkoot, just so you are aware we have a dedicated Working Group for vmware.
You can find other people interested in this in #ansible-vmware on Freenode IRC
For more information about communities, meetings and agendas see https://github.com/ansible/community

click here for bot help

@ansibot ansibot added affects_2.10 This issue/PR affects Ansible v2.10 bug This issue/PR relates to a bug. cloud community_review In order to be merged, this PR must follow the community review workflow. module This issue/PR relates to a module. needs_triage Needs a first human triage before being processed. new_contributor This PR is the first contribution by a new community member. support:community This issue/PR relates to code supported by the Ansible community. vmware VMware community labels Nov 6, 2019
@wkoot wkoot changed the title Merge from zeot/devel vmware_guest: Enable setting mac address when cloning from VM or template Nov 6, 2019
@ansibot ansibot added the stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. label Nov 15, 2019
Copy link
Contributor

@goneri goneri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the rebase, and the update of the functional tests. It looks much better. But I've a little problem with the test itself :-(.

netmask: 255.255.255.0
gateway: 192.168.10.254
mac: aa:bb:cc:dd:aa:b0
register: clone_manual_mac_address
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I get the following error :-(

fatal: [testhost]: FAILED! => {
    "changed": false,
    "invocation": {
        "module_args": {
            "annotation": null,
            "cdrom": [],
            "cluster": null,
            "convert": null,
            "customization": {},
            "customization_spec": null,
            "customvalues": [],
            "datacenter": "DC0",
            "datastore": null,
            "delete_from_inventory": false,
            "disk": [],
            "esxi_hostname": null,
            "folder": "F0",
            "force": false,
            "guest_id": null,
            "hardware": {},
            "hostname": "vcenter.test",
            "is_template": false,
            "linked_clone": false,
            "name": "test_vm1",
            "name_match": "first",
            "networks": [
                {
                    "gateway": "192.168.10.254",
                    "ip": "192.168.10.10",
                    "mac": "aa:bb:cc:dd:aa:b0",
                    "name": "VM Network",
                    "netmask": "255.255.255.0",
                    "type": "static"
                }
            ],
            "password": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER",
            "port": 443,
            "proxy_host": null,
            "proxy_port": null,
            "resource_pool": null,
            "snapshot_src": null,
            "state": "poweredoff",
            "state_change_timeout": 0,
            "template": "DC0_H0_VM0",
            "use_instance_uuid": false,
            "username": "administrator@vsphere.local",
            "uuid": null,
            "validate_certs": false,
            "vapp_properties": [],
            "wait_for_customization": false,
            "wait_for_customization_timeout": 3600,
            "wait_for_ip_address": false,
            "wait_for_ip_address_timeout": 300
        }
    },
    "msg": "Failed to create a virtual machine : Customization of the guest operating system 'debian8_64Guest' is not supported in this configuration. Microsoft Vista (TM) and Linux guests with Logical Volume Manager are supported only for recent ESX host and VMware Tools versions. Refer to vCenter documentation for supported configurations."  
}

clone_customize_guest_test.yml works fine with the same configuration.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's weird. Was the test vm not turned off when you ran the test?

@ansibot ansibot added has_issue needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. and removed community_review In order to be merged, this PR must follow the community review workflow. needs_triage Needs a first human triage before being processed. labels Dec 6, 2019
@goshansp
Copy link

goshansp commented Feb 5, 2020

Workaround: Remove network interface from vm manually before converting it to template. I am now able to clone and customize interface/mac using Ansible 2.8.1 against vSphere 6.5 spinning RHEL7.7 ... Great work you people are doing - Thanks and much appreciation.

@ansibot ansibot added community_review In order to be merged, this PR must follow the community review workflow. and removed needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. labels Mar 8, 2020
@goneri
Copy link
Contributor

goneri commented Mar 20, 2020

Hi!

Thank you for your PR. Since March 2, 2020, the Ansible team does not accept any new changes on the VMware modules on the core ansible/ansible repository.
The development continue but in the new VMware collection repository: https://github.com/ansible-collections/vmware
We have no way to properly migrate a Github issue between the two projects. Could you please reopen the PR there? https://github.com/ansible-collections/vmware

Links:

needs_info

@ansibot ansibot added needs_info This issue requires further information. Please answer any outstanding questions. and removed community_review In order to be merged, this PR must follow the community review workflow. labels Mar 20, 2020
@ansibot ansibot added needs_rebase https://docs.ansible.com/ansible/devel/dev_guide/developing_rebasing.html needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. support:core This issue/PR relates to code supported by the Ansible Engineering Team. labels Mar 28, 2020
@ansibot ansibot added the test This PR relates to tests. label Mar 28, 2020
@ansibot
Copy link
Contributor

ansibot commented Apr 29, 2020

@wkoot This pullrequest is waiting for your response. Please respond or the pullrequest will be closed.

click here for bot help

@ansibot ansibot added collection Related to Ansible Collections work collection:community.vmware needs_collection_redirect https://github.com/ansible/ansibullbot/blob/master/docs/collection_migration.md and removed support:core This issue/PR relates to code supported by the Ansible Engineering Team. labels Apr 29, 2020
@wkoot
Copy link
Author

wkoot commented Apr 30, 2020

@ansibot fuck it

@wkoot wkoot closed this Apr 30, 2020
@ansible ansible locked and limited conversation to collaborators May 28, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects_2.10 This issue/PR affects Ansible v2.10 bug This issue/PR relates to a bug. cloud collection:community.vmware collection Related to Ansible Collections work has_issue module This issue/PR relates to a module. needs_collection_redirect https://github.com/ansible/ansibullbot/blob/master/docs/collection_migration.md needs_info This issue requires further information. Please answer any outstanding questions. needs_rebase https://docs.ansible.com/ansible/devel/dev_guide/developing_rebasing.html needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. new_contributor This PR is the first contribution by a new community member. stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. support:community This issue/PR relates to code supported by the Ansible community. test This PR relates to tests. vmware VMware community
Projects
None yet
4 participants