Comment 0 for bug 1697422

Revision history for this message
jingtao liang (liang-jingtao) wrote : Hp3par:after volume retyped or migrate, the volume can not work normally.such as clone,create snapshot attach,detach and so on.

Version :the newest
reproduce:
1 create a volume A .
2 attach A to an instance.
3 migrate A to another host.
4 Then use A do clone,create snapshot or others.

reasons:

After volume retyped,swap src and dest volume DB records so we can continue using the src id and
asynchronously delete the destination id.But the volume name on hp3par has not change.So we can not
get the exact volume name from the exchanged volume id.Function as follows:
 def _get_3par_vol_name(self, volume_id):
        """Get converted 3PAR volume name.

        Converts the openstack volume id from
        ecffc30f-98cb-4cf5-85ee-d7309cc17cd2
        to
        osv-7P.DD5jLTPWF7tcwnMF80g

        We convert the 128 bits of the uuid into a 24character long
        base64 encoded string to ensure we don't exceed the maximum
        allowed 31 character name limit on 3Par

        We strip the padding '=' and replace + with .
        and / with -
        """
        volume_name = self._encode_name(volume_id)
        return "osv-%s" % volume_name

Like create,delete .These action will get volume name by volume_id.Then can not get the right volume.

I hope someone can notice the problem.Tks