Ansible: Register a VM to sphere ( vcenter)

36 views
Skip to first unread message

Vijay Misra

unread,
Jul 30, 2017, 2:30:28 AM7/30/17
to Ansible Project
 Hi ,

   I am trying to register a VM through vmware-cmd command line as below but it fails with the following error message.
has anybody tried this earlier. any help is appreciated.

I just need to register a VM to vcenter ( or in other words register to the datastore associated with ESX host managed by vcenter).

    
  name: Register a VM template to VSphere
shell: vmware-cmd -H '{{hostname}}' -U '{{username}}' -P '{{password}}' --vihost '{{esxi_hostname1}}' -s register {{ template_file_path }}
register: result
ignore_errors: true

********************************************************

fatal: []: FAILED! => {
"changed": true,
"cmd": "vmware-cmd -H 'X.X.X.X' -U 'admini...@vsphere.local' -P 'XXX23' --vihost 'X.x.x.x' -s register /vmfs/volumes/EVC_Store1/myvgpu_clone2/myvgpu_clone2.vmx",
"delta": "0:00:00.004544",
"end": "2017-07-30 06:26:24.922754",
"failed": true,
"invocation": {
"module_args": {
"_raw_params": "vmware-cmd -H 'xxxx' -U 'xx...@vsphere.local' -P 'Admin!23' --vihost 'xxxx' -s register /vmfs/volumes/EVC_Store1/myvgpu_clone2/myvgpu_clone2.vmx",
"_uses_shell": true,
"chdir": null,
"creates": null,
"executable": null,
"removes": null,
"warn": true
}
},
"rc": 127,
"start": "2017-07-30 06:26:24.918210",
"stderr": "/bin/sh: vmware-cmd: command not found",
"stderr_lines": [
"/bin/sh: vmware-cmd: command not found"
],
"stdout": "",
"stdout_lines": []
}


  

Kai Stian Olstad

unread,
Jul 30, 2017, 5:48:23 AM7/30/17
to ansible...@googlegroups.com
On 30. juli 2017 08:30, Vijay Misra wrote:
> I am trying to register a VM through vmware-cmd command line as below
> but it fails with the following error message.
> has anybody tried this earlier. any help is appreciated.
>
< snip/>

> "stderr": "/bin/sh: vmware-cmd: command not found",

It clearly say the command doesn't exist.
Either it's missing or not in users PATH.

Use full path or search the list for "interactive shell" and "non
interactive shell" to learn more about the shell feature when it comes
to PATH.

--
Kai Stian Olstad

Brian Keyes

unread,
Jul 31, 2017, 10:47:51 AM7/31/17
to ansible...@googlegroups.com
this command is only available in the vmware CLI i think



--
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 ansible-project+unsubscribe@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/bfcf66d7-9bf0-b4d6-72ae-a0ea2fc1bc8b%40olstad.com.

For more options, visit https://groups.google.com/d/optout.



--
Brian Keyes
Systems Engineer, Vizuri
703-855-9074(Mobile)

FOR OFFICIAL USE ONLY: This email and any attachments may contain information that is privacy and business sensitive.  Inappropriate or unauthorized disclosure of business and privacy sensitive information may result in civil and/or criminal penalties as detailed in as amended Privacy Act of 1974 and DoD 5400.11-R.

Reply all
Reply to author
Forward
0 new messages