mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 22:02:50 +00: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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user