from .xlate import XLATOR
-__version__ = '1.8.2'
+__version__ = '1.8.3'
LOG = logging.getLogger(__name__)
TZ = pytz.timezone('Europe/Berlin')
ds_to_use = None
if self.config.storage_cluster:
ds_to_use = self.select_data_store_from_cluster()
- msg = MSG_NO_CLUSTER.format(
- size=self.config.data_size_gb, c_name=self.config.storage_cluster)
- LOG.warn(msg)
+ if ds_to_use:
+ msg = _(
+ "Got datastore {n!r} as a member of datastore cluster {c!r}.").format(
+ n=ds_to_use.name, c=self.config.storage_cluster)
+ LOG.info(msg)
+ else:
+ msg = MSG_NO_CLUSTER.format(
+ size=self.config.data_size_gb, c_name=self.config.storage_cluster)
+ LOG.warn(msg)
if not ds_to_use:
ds_to_use = self.select_simple_data_store()
podsel = vim.storageDrs.PodSelectionSpec()
podsel.storagePod = pod
+ folder_obj = self.vsphere.get_vm_folder(self.config.folder)
+
storagespec = vim.storageDrs.StoragePlacementSpec()
storagespec.podSelectionSpec = podsel
storagespec.type = 'create'
- storagespec.folder = self.config.folder
+ storagespec.folder = folder_obj
storagespec.resourcePool = self.cluster.resource_pool
storagespec.configSpec = vmconf
LOG.debug(_(
"Trying to get a recommendation for a datastore from "
"VSphere storageResourceManager ..."))
+ if self.verbose > 2:
+ msg = "storagespec:\n" + pp(storagespec)
+ LOG.debug(msg)
content = self.vsphere.service_instance.RetrieveContent()
try:
rec = content.storageResourceManager.RecommendDatastores(storageSpec=storagespec)
def _get_storage_pod_obj(self, used_c_name):
content = self.vsphere.service_instance.RetrieveContent()
- dc = self.config.get_obj(content, [vim.Datacenter], self.config.dc)
+ dc = self.vsphere.get_obj(content, [vim.Datacenter], self.config.dc)
if not dc:
raise VSphereDatacenterNotFoundError(self.config.dc)