I was going over the pysphere code: By the looks of it, it seems that you 
can add an existing vmdk. Which is what i am looking to do.
At this point i am just trying to figure out the config_target parameter. 
See code below: 


def add_disk(module, s, config_target, config, devices, datastore, 
type="thin", size=200000, disk_ctrl_key=1, disk_number=0, key=0):
    ### add a vmdk disk
    # Verify the datastore exists
    datastore_name, ds = find_datastore(module, s, datastore, config_target)
    # create a new disk - file based - for the vm


On Tuesday, August 16, 2016 at 4:38:13 PM UTC-4, Gallo wrote:
>
> 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]
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/5e75d211-5be0-4c2a-a9d3-6c206d71961b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to