def do_setup(self, context): """Any initialization the volume driver does while starting.""" super(HyperScaleDriver, self).do_setup(context) try: # Get computes info computes = HyperScaleDriver._fetch_config_for_compute() if computes is None: computes = {} for compute in computes.keys(): if 'disabled' in computes[compute].keys(): disabled = computes[compute]['disabled'] if disabled == "1": continue vsa_ip = computes[compute]['vsa_ip'] vsa_isolated_ip = computes[compute]['vsa_isolated_ip'] vsa_section_header = computes[compute]['vsa_section_header'] compute_name = computes[compute]['compute_name'] self.compute_map[vsa_ip] = vsa_isolated_ip self.vsa_map[vsa_ip] = vsa_section_header self.compute_meta_map[compute_name] = vsa_ip self.vsa_compute_map[vsa_ip] = compute_name # Get controller info cntr_info = HyperScaleDriver._fetch_config_for_controller() if cntr_info is None: cntr_info = {} # Get data node info self.my_dnid = util.get_datanode_id() datanodes = HyperScaleDriver._fetch_config_for_datanode() if datanodes is None: datanodes = {} for key, value in datanodes.items(): if self.my_dnid == value['hypervisor_id']: self.datanode_hostname = value['datanode_name'] self.datanode_ip = value['data_ip'] self.dn_routing_key = value['hypervisor_id'] LOG.debug("In init compute_map %s", self.compute_map) LOG.debug("In init vsa_map %s", self.vsa_map) LOG.debug("In init compute_meta_map %s", self.compute_meta_map) except (exception.UnableToProcessHyperScaleCmdOutput, exception.ErrorInFetchingConfiguration): err_msg = _("Unable to initialise the Veritas cinder driver") LOG.exception(err_msg) raise exception.VolumeBackendAPIException(data=err_msg) except Exception: err_msg = _("Internal error occurred") LOG.exception(err_msg) raise exception.VolumeBackendAPIException(data=err_msg)
def do_setup(self, context): """Any initialization the volume driver does while starting.""" super(HyperScaleDriver, self).do_setup(context) try: # Get computes info computes = HyperScaleDriver._fetch_config_for_compute() if computes is None: computes = {} for compute in computes.keys(): if 'disabled' in computes[compute].keys(): disabled = computes[compute]['disabled'] if disabled == "1": continue vsa_ip = computes[compute]['vsa_ip'] vsa_isolated_ip = computes[compute]['vsa_isolated_ip'] vsa_section_header = computes[compute]['vsa_section_header'] compute_name = computes[compute]['compute_name'] self.compute_map[vsa_ip] = vsa_isolated_ip self.vsa_map[vsa_ip] = vsa_section_header self.compute_meta_map[compute_name] = vsa_ip self.vsa_compute_map[vsa_ip] = compute_name # Get controller info cntr_info = HyperScaleDriver._fetch_config_for_controller() if cntr_info is None: cntr_info = {} # Get data node info self.my_dnid = util.get_datanode_id() datanodes = HyperScaleDriver._fetch_config_for_datanode() if datanodes is None: datanodes = {} for key, value in datanodes.items(): if self.my_dnid == value['hypervisor_id']: self.datanode_hostname = value['datanode_name'] self.datanode_ip = value['data_ip'] self.dn_routing_key = value['hypervisor_id'] LOG.debug("In init compute_map %s", self.compute_map) LOG.debug("In init vsa_map %s", self.vsa_map) LOG.debug("In init compute_meta_map %s", self.compute_meta_map) except (v_exception.UnableToProcessHyperScaleCmdOutput, v_exception.ErrorInFetchingConfiguration): err_msg = _("Unable to initialise the Veritas cinder driver") LOG.exception(err_msg) raise exception.VolumeBackendAPIException(data=err_msg) except Exception: err_msg = _("Internal error occurred") LOG.exception(err_msg) raise exception.VolumeBackendAPIException(data=err_msg)