mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-22 12:50:22 -07:00
VMware: Provide verbose message about non-existent VM (#35682)
This fix adds a verbose message about non-existent VM when specified with operation, due to idempotency we can not detect correct state. Fixes: #27384 Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
This commit is contained in:
parent
4094ba7682
commit
367258507a
3 changed files with 63 additions and 0 deletions
|
@ -1343,6 +1343,11 @@ class PyVmomiHelper(PyVmomi):
|
|||
datastore_name = datastore.name
|
||||
|
||||
if not datastore:
|
||||
if len(self.params['disk']) != 0 or self.params['template'] is None:
|
||||
self.module.fail_json(msg="Unable to find the datastore with given parameters."
|
||||
" This could mean, %s is a non-existent virtual machine and module tried to"
|
||||
" deploy it as new virtual machine with no disk. Please specify disks parameter"
|
||||
" or specify template to clone from." % self.params['name'])
|
||||
self.module.fail_json(msg="Failed to find a matching datastore")
|
||||
|
||||
return datastore, datastore_name
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue