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 Create VM with Windows Template without parameter guest_id #719

Open
SilentT19 opened this issue Mar 15, 2021 · 6 comments
Open
Labels
bug This issue/PR relates to a bug cloud module module plugins plugin (any type)

Comments

@SilentT19
Copy link

SilentT19 commented Mar 15, 2021

SUMMARY

When create VM with Windows template with customisation and without guest_id, the module send linux customisation

ISSUE TYPE
  • Bug Report
COMPONENT NAME

vmware_guest

ANSIBLE VERSION
2.10.7
CONFIGURATION
Ubuntu 20.04 , pyvmomi 7.0.1
vCenter Server 6.5u3n 17590285 
OS / ENVIRONMENT

OS : Windows

STEPS TO REPRODUCE

Simply use vmware_guest with windows template with customization

 name:  Deploy VM
  community.vmware.vmware_guest:
....
    template: '{{ Windows_Template }}'
...
EXPECTED RESULTS

The VM was created with customisation and without error in vcenter

ACTUAL RESULTS
-->       customization = (vim.vm.customization.Specification) {
-->          options = (vim.vm.customization.Options) null,
-->          identity = (vim.vm.customization.LinuxPrep) {

image

@ansibullbot
Copy link

Files identified in the description:

If these files are inaccurate, please update the component name section of the description or use the !component bot command.

click here for bot help

@ansibullbot
Copy link

@ansibullbot ansibullbot added bug This issue/PR relates to a bug cloud module module needs_triage Needs a first human triage before being processed. plugins plugin (any type) labels Mar 15, 2021
@SilentT19
Copy link
Author

SilentT19 commented Mar 15, 2021

if 'win' in guest_id:

if win in guest_id but guest_id was not required if use template

https://docs.ansible.com/ansible/2.10/collections/community/vmware/vmware_guest_module.html#parameter-guest_id

"This field is required when creating a virtual machine, not required when creating from the template."

guest_id = vm_obj.summary.config.guestId

vCenter inventory output the guestid ?

@SilentT19
Copy link
Author

SilentT19 commented Mar 15, 2021

Perhaps this problem #75 is related too

@Akasurde
Copy link
Member

@SilentT19 Thanks for reporting this issue. GuestID information is gathered using VMware Tools installed inside the VM. If VMware tools fail to detect or wrongly report the guest id then the module would misbehave. I am afraid that there is no other way to detect guest id.

Please try updating vmware tools in Guest OS.

@ansibullbot ansibullbot removed the needs_triage Needs a first human triage before being processed. label Mar 19, 2021
@SilentT19
Copy link
Author

I think that when we prepare and use a template, the guestOS is registered in the configuration of the template and it is cloned with the VM, Liked this
image
I think that we should use this parameter instead of that of the tools.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue/PR relates to a bug cloud module module plugins plugin (any type)
Projects
None yet
Development

No branches or pull requests

3 participants