示例#1
0
 def _manage_existing_get_size_2_2(self, volume, existing_ref):
     existing_ref = existing_ref['source-name']
     app_inst_name, storage_inst_name, vol_name, __ = datc._parse_vol_ref(
         existing_ref)
     dummy_vol = {'id': app_inst_name, 'project_id': volume['project_id']}
     dvol = self.cvol_to_dvol(dummy_vol)
     return dvol.size
示例#2
0
 def _manage_existing_2_2(self, volume, existing_ref):
     # Only volumes created under the requesting tenant can be managed in
     # the v2.1+ API.  Eg.  If tenant A is the tenant for the volume to be
     # managed, it must also be tenant A that makes this request.
     # This will be fixed in a later API update
     existing_ref = existing_ref['source-name']
     app_inst_name, __, __, __ = datc._parse_vol_ref(existing_ref)
     LOG.debug("Managing existing Datera volume %s  "
               "Changing name to %s", datc.get_name(volume), existing_ref)
     # Rename AppInstance
     dummy_vol = {'id': app_inst_name, 'project_id': volume['project_id']}
     tenant = self.get_tenant(volume['project_id'])
     ai = self.cvol_to_ai(dummy_vol, tenant=tenant)
     data = {'name': datc.get_name(volume)}
     ai.set(tenant=tenant, **data)
     self._add_vol_meta_2_2(volume)