コード例 #1
0
    def delete_replica(self, pair_id):
        LOG.info('Delete replication pair %s.', pair_id)
        try:
            pair_info = self.pair_op.get_info(pair_id)
        except exception.VolumeBackendAPIException as exc:
            if huawei_utils.is_not_exist_exc(exc):
                return
            raise

        self.pair_op.split(pair_id)
        self.pair_op.delete(pair_id)
        huawei_utils.remove_lun_from_lungroup(
            self.rmt_client, pair_info['LOCALRESID'],
            self.configuration.force_delete_volume)
        self.rmt_client.delete_lun(pair_info['LOCALRESID'])
コード例 #2
0
    def delete_hypermetro(self, volume):
        lun_name = huawei_utils.encode_name(volume.id)
        hypermetro = self.local_cli.get_hypermetro_by_lun_name(lun_name)

        if hypermetro:
            huawei_utils.remove_lun_from_lungroup(self.remote_cli,
                                                  hypermetro['REMOTEOBJID'])
            if (hypermetro['RUNNINGSTATUS'] in (constants.METRO_RUNNING_NORMAL,
                                                constants.METRO_RUNNING_SYNC)):
                self.local_cli.stop_hypermetro(hypermetro['ID'])

            self.local_cli.delete_hypermetro(hypermetro['ID'])
            self.remote_cli.delete_lun(hypermetro['REMOTEOBJID'])
        else:
            remote_lun_info = self.remote_cli.get_lun_info_by_name(lun_name)
            if remote_lun_info:
                self.remote_cli.delete_lun(remote_lun_info['ID'])
コード例 #3
0
 def _delete_rmt_lun(self, lun_id):
     if lun_id and self.rmt_client.check_lun_exist(lun_id):
         huawei_utils.remove_lun_from_lungroup(
             self.rmt_client, lun_id, self.conf.force_delete_volume)
         self.rmt_client.delete_lun(lun_id)