Open razbag opened 4 years ago
Hi @razbag the logic is if you specify the parameter "autoselect_datastore" and set it to true, it will get all the VMFS datastores of ESXi host specified or the "cluster" specified, then check if these datastores' name contains the "datastore" parameter value. Here you set the "datastore" to "['ds-r5', 'ds-r10']", I think there is no matched datastore name. So it will use the template disk file datastore if this datastore is also in the same "datacenter", or it will select a datastore in this vCenter with largest free space. Thanks.
cluster: HA cluster
folder: /
disk:
- size_gb: 25 # System
datastore:
- ds-r5
- ds-r10
autoselect_datastore: True
Hi @razbag the logic is if you specify the parameter "autoselect_datastore" and set it to true, it will get all the VMFS datastores of ESXi host specified or the "cluster" specified, then check if these datastores' name contains the "datastore" parameter value. Here you set the "datastore" to "['ds-r5', 'ds-r10']", I think there is no matched datastore name. So it will use the template disk file datastore if this datastore is also in the same "datacenter", or it will select a datastore in this vCenter with largest free space. Thanks.
cluster: HA cluster folder: / disk: - size_gb: 25 # System datastore: - ds-r5 - ds-r10 autoselect_datastore: True
Hi @Tomorrow9 ,
I am agree with logic but it doesn't work also but when I set only one datastore it is working fine for example cluster: HA cluster folder: / disk:
or
cluster: HA cluster folder: / disk:
it is working fine.
Thanks, Razmik
Hi @razbag is the result of your examples above is: it selects datastore "ds-r5" and "ds-r10" to deploy VM separately?
If you want it to select one datastore in the configured two datastores, then that must be a feature request for "vmware_guest" to support selecting one datastore in specified datastore list instead of all datastores available.
Hi @razbag is the result of your examples above is: it selects datastore "ds-r5" and "ds-r10" to deploy VM separately?
If you want it to select one datastore in the configured two datastores, then that must be a feature request for "vmware_guest" to support selecting one datastore in specified datastore list instead of all datastores available.
Hi @Tomorrow9 , This is just an example with individuals datastore it works fine example is this one
cluster: HA cluster folder: / disk:
but what I want is use both datastores in one command with autoselect_datastore: example is
cluster: HA cluster
folder: /
disk:
- size_gb: 25 # System
datastore:
- ds-r5
- ds-r10
autoselect_datastore: True
and autoselect_datastore with value true can find and select less used between this listed datastore:(in my case ds-r5 and ds-r10)
I just want to know if this is possible or I have some misconfiguration in my playbook ?
Thanks in advance
@razbag now selecting from a specified datastore list is not supported as I know. But I think this is a use case that user don't want to deploy VM to all available datastores just some of them.
A way to let it work is set the datastores' names to "ds-r1", "ds-r5-test", "ds-r10-test", and write as below, I think it can work to find datastores with keyword "test" in the name.
cluster: HA cluster
folder: /
disk:
- size_gb: 25 # System
datastore: 'test'
autoselect_datastore: True
@razbag now selecting from a specified datastore list is not supported as I know. But I think this is a use case that user don't want to deploy VM to all available datastores just some of them.
A way to let it work is set the datastores' names to "ds-r1", "ds-r5-test", "ds-r10-test", and write as below, I think it can work to find datastores with keyword "test" in the name.
cluster: HA cluster folder: / disk: - size_gb: 25 # System datastore: 'test' autoselect_datastore: True
Hi @Tomorrow9
It is really working with change naming of datastores and I run test and confirm that this is working. Thanks for this workaround. but let me ask you my latest question :) are you planning to implement selecting from a specified datastore list I think it is very useful
Thanks in advance, Razmik
@razbag We are not planning to add this feature to the near future. Please feel free to open pull request.
needs_info
SUMMARY
Trying to Deploy VM from template and I want to use autoselect_datastore: True paramter only for specific datastores for example I have three datastores ds-r1 ds-r5 and ds-r10
I want to use autoselect_datastore only for this two datastores ds-r5 and ds-r10 and I want that system automatically choose with less used datastore But I can't I try with list items it is not working
If someone can help please
Thanks in advance.
P.S I have limitation and cannot use datastore cluster function in Vcenter
ISSUE TYPE
COMPONENT NAME
ANSIBLE VERSION
OS / ENVIRONMENT
Ubuntu 18.04.4 LTS 4.15.0-106-generic
STEPS TO REPRODUCE
So what I expect that autoselect_datastore choose between ds-r5 and ds-r10 with filter less but it is not working and disk created in default template storage which is ds-r1
P.S play-book run without any error but VM disk create at the datastore where is located template
ACTUAL RESULTS