-
Notifications
You must be signed in to change notification settings - Fork 23.7k
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: Refactor disc logic #39285
VMware: Refactor disc logic #39285
Conversation
assert: | ||
that: | ||
- "cdrom_vm.failed == false" | ||
- "cdrom_vm.changed == true" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it be worth calling the task again and checking .changed == false
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. Thanks for suggestion. I will update it with same.
cc @dericcrago @pdellaert Could you please review this ? |
@Akasurde , I'm getting the following error when I use this patch: msg: 'Failed to create a virtual machine : The device ''5'' is referring to a nonexisting controller ''-,278''.' fatal: [vm -> localhost]: FAILED! => changed=false
invocation:
module_args:
annotation: null
cdrom:
type: client
cluster: null
customization: {}
customvalues:
- key: sched.cpu.latencySensitivity
value: normal
- key: sched.mem.prealloc
value: 'True'
- key: sched.swap.vmxSwapEnabled
value: 'False'
- key: isolation.tools.connectable.disable
value: 'True'
- key: tools.setInfo.sizeLimit
value: '1048576'
- key: isolation.tools.diskShrink.disable
value: 'True'
- key: isolation.tools.diskWiper.disable
value: 'True'
- key: isolation.tools.hgfs.disable
value: 'True'
- key: isolation.tools.copy.disable
value: 'True'
- key: isolation.tools.paste.disable
value: 'True'
- key: isolation.tools.setGUIOptions.enable
value: 'False'
- key: isolation.tools.setOption.disable
value: 'True'
- key: log.rotateSize
value: '100000'
- key: log.keepOld
value: '6'
- key: isolation.device.connectable.disable
value: 'True'
- key: isolation.device.edit.disable
value: 'True'
- key: isolation.tools.log.disable
value: 'True'
- key: isolation.tools.unity.push.update.disable
value: 'True'
- key: isolation.tools.ghi.launchmenu.change
value: 'True'
- key: isolation.tools.hgfsServerSet.disable
value: 'True'
- key: isolation.tools.memSchedFakeSampleStats.disable
value: 'True'
- key: isolation.tools.getCreds.disable
value: 'True'
datacenter: REDACTED
disk:
- datastore: local-datastore
size_gb: 30
type: thin
esxi_hostname: REDACTED
folder: /DCC/REDACTED/vm
force: false
guest_id: rhel6_64Guest
hardware:
hotadd_cpu: false
hotremove_cpu: false
memory_mb: '1024'
num_cpus: '1'
scsi: paravirtual
hostname: REDACTED
is_template: false
linked_clone: false
name: REDACTED
name_match: first
networks:
- device_type: vmxnet3
name: vlan1640_jumpkick
type: dhcp
- device_type: vmxnet3
name: vlan603
type: dhcp
password: VALUE_SPECIFIED_IN_NO_LOG_PARAMETER
port: 443
resource_pool: null
snapshot_src: null
state: present
state_change_timeout: 0
template: null
username: REDACTED
uuid: null
validate_certs: false
vapp_properties: []
wait_for_ip_address: false
msg: 'Failed to create a virtual machine : The device ''5'' is referring to a nonexisting controller ''-,278''.' |
@MikeKlebolt Thanks for testing this change. Do you face this error when you create a new VM or reconfigure existing one ? |
Sorry for not clarifying. This is when creating a new VM. |
Ran into this issue with Ansible 2.5.2. Previously virtual hard disks were being improperly associated with the ide controller despite requesting a scsi controller and, when a virtual cdrom was present, the VM would fail to create when a second disk was requested. With the updated vmware-guest.py in the PR, the virtual cdrom was associated with ide0:0 and virtual disks were assigned to scsi0:n as expected. |
Can confirm what @bbeaudoin said. Virtual disks are now assigned to scsi0:n. Before they were incorrectly assigned to IDE which makes hotplugging impossible. Would be nice if this PR gets accepted soon. |
@toxicvengeance Thanks for the feedback. |
@pdellaert @dericcrago Could you please review this ? |
I checked the version cadbd6e#diff-ed147163551d1eaa084b21f6bab29f96 With commit https://github.com/ansible/ansible/pull/39285/files in this thread performs a playbook with my section (creating two discs) without errors:
All ok. |
* Refactoring related to network device * Assign unique random temporary key while creating SCSI or/and IDE controller devices * Add testcase for this change Fixes: ansible#38679 Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
This has fixed my issue related to not being able to mount more than one hard drive during setup, with the same issue as Alex above. All OK after pushing this commit to our Ansible setup.
|
* Refactoring related to network device * Assign unique random temporary key while creating SCSI or/and IDE controller devices * Add testcase for this change Fixes: ansible#38679 Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com> (cherry picked from commit fd985db) Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
* Refactoring related to network device * Assign unique random temporary key while creating SCSI or/and IDE controller devices * Add testcase for this change Fixes: #38679 Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com> (cherry picked from commit fd985db) Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
SUMMARY
Fixes: #38679
Signed-off-by: Abhijeet Kasurde akasurde@redhat.com
ISSUE TYPE
COMPONENT NAME
lib/ansible/modules/cloud/vmware/vmware_guest.py
test/integration/targets/vmware_guest/tasks/cdrom_d1_c1_f0.yml
ANSIBLE VERSION