# vm\_cdrom in vsphere\_guest not working

**URL:** <https://forum.ansible.com/t/vm-cdrom-in-vsphere-guest-not-working/18909>\
**Category:** Ansible Project\
**Created:** [July 31, 2015, 12:58pm UTC](https://forum.ansible.com/t/vm-cdrom-in-vsphere-guest-not-working/18909 "2015-07-31T12:58:40Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Timo](https://avatars.discourse-cdn.com/v4/letter/t/c4cdca/32.png) [@Timo](https://forum.ansible.com/u/Timo)\
**Post date:** [July 31, 2015, 12:58pm UTC](https://forum.ansible.com/t/vm-cdrom-in-vsphere-guest-not-working/18909/1 "2015-07-31T12:58:40Z")

</div>

Hi list,

got a small problem in the vsphere\_guest module.

ansible --version: 1.9.2

I can’t get the vm\_cdrom option to work.

I tried this version, like vm\_disk:

vm\_extra\_config:  
notes: “{{ notes }}”  
vcpu.hotadd: yes  
mem.hotadd: yes  
folder: TEST  
vm\_cdrom:  
type: iso  
iso\_path: “path/to/cd-image.iso”  
vm\_disk:  
disk1:  
size\_gb: “{{ disk }}”

Which did not work…

And that version, under vm\_hardware, according to documentation:

vm\_hardware:  
memory\_mb: “{{ memory }}”  
num\_cpus: “{{ cpucount }}”  
vm\_cdrom:  
type: iso  
iso\_path: “VSTOR1-NFS/ISO/cd-image.iso”

osid: “{{ osid }}”

Both with and without " in iso.

Always the same error:

Note: The error may actually appear before this position: line 18, column 1

# My comments are here

vm\_cdrom:

Note: The error may actually appear before this position: line 32, column 1

# My comments are here

vm\_cdrom:

Can anybody point me to the right direction, what might be wrong?

Thx a lot in advance!

Best,

Timo

---

<div class="post-metadata">

**Author:** ![j.r.hawkesworth](https://avatars.discourse-cdn.com/v4/letter/j/a3d4f5/32.png) [@j.r.hawkesworth](https://forum.ansible.com/u/j.r.hawkesworth)\
**Post date:** [July 31, 2015, 1:17pm UTC](https://forum.ansible.com/t/vm-cdrom-in-vsphere-guest-not-working/18909/2 "2015-07-31T13:17:53Z")

</div>

My guess would be its something to do with indentation in your playbook.

I suggest you try editing your playbook in a yaml-aware editor. On windows you can use Notepad++ - or use [yamlint.com](http://yamlint.com)

Hope this helps,

Jon

---

<div class="post-metadata">

**Author:** ![Timo](https://avatars.discourse-cdn.com/v4/letter/t/c4cdca/32.png) [@Timo](https://forum.ansible.com/u/Timo)\
**Post date:** [July 31, 2015, 1:35pm UTC](https://forum.ansible.com/t/vm-cdrom-in-vsphere-guest-not-working/18909/3 "2015-07-31T13:35:29Z")

</div>

Hi Jon,

i tried different indentations. Also used Notepad++, just to be sure.  
Just did not work.

It seems to me, it doesn’t even recognize that option. No matter where i put it…

Any other suggestions?

Thx!

---

<div class="post-metadata">

**Author:** ![Timo](https://avatars.discourse-cdn.com/v4/letter/t/c4cdca/32.png) [@Timo](https://forum.ansible.com/u/Timo)\
**Post date:** [July 31, 2015, 1:42pm UTC](https://forum.ansible.com/t/vm-cdrom-in-vsphere-guest-not-working/18909/4 "2015-07-31T13:42:06Z")

</div>

Hi Jon,

you were right. Too much copy and paste…  
I used your linkgiven software…

It was a [Tab], before vm\_cdrom…

So Problem solved, and the option should be set on the vm\_hardware section in the end…

Thx again for you quick help!

Best,

Timo

---

<div class="post-metadata">

**Author:** ![j.r.hawkesworth](https://avatars.discourse-cdn.com/v4/letter/j/a3d4f5/32.png) [@j.r.hawkesworth](https://forum.ansible.com/u/j.r.hawkesworth)\
**Post date:** [July 31, 2015, 5:30pm UTC](https://forum.ansible.com/t/vm-cdrom-in-vsphere-guest-not-working/18909/5 "2015-07-31T17:30:59Z")

</div>

Glad you are up and running.

Should have said there’s an option in Notepad++ somewhere to set it so that it inserts spaces when you hit tab. All your yaml (and python) will be easier for it.

Jon
