vsphere able to add a new drive but can not add an existing drive

22 views
Skip to first unread message

Gallo

unread,
Aug 16, 2016, 4:38:13 PM8/16/16
to Ansible Project
Hi guys I am looking to add an existing hard drive to a vm in vsphere however it seems to be expecting the size to be populated.

[code]
---
- name: adding drive
  vsphere_guest:
    vcenter_hostname: "{{ thehypper }}"
    username: "{{ myuser }}"
    password: "{{ mypass }}"
    guest: "{{ guest_name }}"
    state: reconfigured
    vm_disk:
      disk2:
        datastore: "{{ dataStore }}"
#        type: thick
#        size_gb: "10"
        folder: NexusData/
        disk_file: nexusdata.vmdk
    validate_certs: False
[/code] 

playbook snippet output:
[code]
\"/var/fold
ers/v7/y40ls2mx5sjbpqfm4ctym4l1czrh2g/T/ansible_9VKigd/ansible_module_vsphere_guest.py\", line 792, in update_disks\n    hd.CapacityInKB = int(vm_disk[cnf_disk]['size_gb']) * 1024 * 1024\nKeyError: 'size_gb'\n", "module_stdout": "", "msg": "MODULE FAILURE", "parsed": false}

[/code]


Reply all
Reply to author
Forward
Message has been deleted
0 new messages