'Delete a volume.
Three steps:
Firstly, remove associate from lungroup.
Secondly, remove associate from QoS policy.
Thirdly, remove the lun.'

def delete_volume(self, volume):

    lun_id = self._check_volume_exist_on_array(volume, constants.VOLUME_NOT_EXISTS_WARN)
    if (not lun_id):
        return
    if self.support_func.get('QoS_support'):
        qos_id = self.client.get_qosid_by_lunid(lun_id)
        if qos_id:
            smart_qos = smartx.SmartQos(self.client)
            smart_qos.remove(qos_id, lun_id)
    metadata = huawei_utils.get_lun_metadata(volume)
    if ('hypermetro_id' in metadata):
        metro = hypermetro.HuaweiHyperMetro(self.client, self.rmt_client, self.configuration)
        try:
            metro.delete_hypermetro(volume)
        except exception.VolumeBackendAPIException as err:
            LOG.error('Delete    hypermetro    error:    %s.', err)
            self._delete_volume(volume)
            raise
    replica_data = volume.replication_driver_data
    if replica_data:
        try:
            self.replica.delete_replica(volume)
        except exception.VolumeBackendAPIException as err:
            with excutils.save_and_reraise_exception():
                LOG.exception('Delete    replication    error.')
                self._delete_volume(volume)
    self._delete_volume(volume)
