diff --git a/common-powervc/powervc/common/client/service.py b/common-powervc/powervc/common/client/service.py index ae8da52..e97b201 100644 --- a/common-powervc/powervc/common/client/service.py +++ b/common-powervc/powervc/common/client/service.py @@ -396,6 +396,10 @@ class ClientServiceCatalog(object): wrappers.append(CinderService(svc_type, version, s_url, self.base_opts, self.keystone)) + elif svc_type == str(SERVICE_TYPES.volumev2): + wrappers.append(CinderService(svc_type, version, + s_url, self.base_opts, + self.keystone)) elif svc_type == str(SERVICE_TYPES.network): wrappers.append(NeutronService(svc_type, version, s_url, self.base_opts, diff --git a/common-powervc/powervc/common/constants.py b/common-powervc/powervc/common/constants.py index 972e94d..858c688 100644 --- a/common-powervc/powervc/common/constants.py +++ b/common-powervc/powervc/common/constants.py @@ -57,6 +57,7 @@ class ServiceTypes(object): """ def __init__(self): self.volume = ServiceType('volume', 'cinder') + self.volumev2 = ServiceType('volumev2', 'cinder') self.compute = ServiceType('compute', 'nova') self.network = ServiceType('network', 'neutron') self.identity = ServiceType('identity', 'keystone') diff --git a/nova-powervc/powervc/nova/driver/virt/powervc/service.py b/nova-powervc/powervc/nova/driver/virt/powervc/service.py index 825921f..23cb053 100644 --- a/nova-powervc/powervc/nova/driver/virt/powervc/service.py +++ b/nova-powervc/powervc/nova/driver/virt/powervc/service.py @@ -56,6 +56,8 @@ class PowerVCService(object): from powervc.common.client import factory self._cinderclient = factory.\ LOCAL.new_client(str(common_constants.SERVICE_TYPES.volume)) + self._cinderclientv2 = factory.\ + LOCAL.new_client(str(common_constants.SERVICE_TYPES.volumev2)) self._pvccinderclient = factory.\ POWERVC.new_client(str(common_constants.SERVICE_TYPES.volume)) self.max_tries = CONF.powervc.volume_max_try_times @@ -1042,7 +1044,7 @@ class PowerVCService(object): """ pvc_volume_id = '' - local_volume = self._cinderclient.volumes.get(local_id) + local_volume = self._cinderclientv2.volumes.get(local_id) if local_volume is None: return pvc_volume_id