This is an automatically generated e-mail. To reply, visit: http://reviewboard-openlmi.rhcloud.com/r/1485/ |
src/lmi/storage/LMI_LVStorageCapabilities.py (Diff revisions 1 - 2) | |||
---|---|---|---|
def get_pool_name_for_capabilities(self, instance_id): |
|||
111 | if device.type == 'lvmvg': |
||
112 | caps['SupportedStorageElementTypes'] = \ |
||
113 | [self.Values.SupportedStorageElementTypes.ThinlyProvisionedAllocatedStoragePool] |
||
114 | elif device.type == 'lvmthinpool': |
||
115 | caps['SupportedStorageElementTypes'] = \ |
||
116 | [self.Values.SupportedStorageElementTypes.ThinlyProvisionedLimitlessStoragePool] |
CIM_StorageCapabilities describe capabilities of the CIM_StoragePool, i.e. what the Pool can _create_. If it is a VG, it can create Thin Pools (ThinlyProvisionedLimitlessStoragePool) and Logical Volumes (not reflected in SupportedStorageElementTypes). If it is a Thin Pool, it can create only thin volumes (ThinlyProvisionedStorageExtent; this is a new vendor ValueMap member as we allocate neither StorageVolumes nor LogicalDisks).
src/lmi/storage/LMI_StorageConfigurationService.py (Diff revisions 1 - 2) | |||
---|---|---|---|
def _create_thinlv(self, job, pool_path, name, size): |
|||
530 | oldsize = thinlv.vg.align(thinlv.size, False) |
540 | oldsize = thinlv.vg.align(storage.to_blivet_size(thinlv.size), False) |
thinlv.size already is in Blivet size units.
src/lmi/storage/LMI_StorageConfigurationService.py (Diff revisions 1 - 2) | |||
---|---|---|---|
def cim_method_createormodifystoragepool(self, env, object_name, |
|||
1142 | if param_goal and goal['ThinProvisionedPoolType']: |
||
1143 | if param_inextents: |
||
1144 | raise pywbem.CIMError(pywbem.CIM_ERR_INVALID_PARAMETER, |
||
1145 | "Unsupported combination of Goal and InExtents.") |
||
1107 | if pool.type == 'lvmvg': |
1146 | if pool.type == 'lvmvg': |
1108 | if param_inextents: |
1147 | # create thinpool |
1109 | # modify vg |
1148 | return self.cim_method_createormodifythinpool(env, object_name, |
1110 | self.cim_method_createormodifyvg(env, object_name, |
1149 | param_elementname, param_goal, |
1111 | param_elementname, param_goal, |
1150 | param_pool, None, |
1112 | param_inextents, param_pool, |
1151 | param_size) |
1113 | input_arguments, method_name) |
1152 | elif pool.type == 'lvmthinpool': |
1114 | else: |
1153 | # modify thinpool |
1115 | # create thinpool |
1154 | return self.cim_method_createormodifythinpool(env, object_name, |
1116 | self.cim_method_createormodifythinpool(env, object_name, |
1155 | param_elementname, param_goal, |
1117 | param_elementname, param_goal, |
1156 | None, param_pool, |
1118 | param_thinpool, None, |
1157 | param_size) |
1119 | param_size) |
1158 | else: |
1120 | if pool.type == 'lvmthinpool': |
1159 | # defensive |
1121 | if param_inextents: |
1160 | raise pywbem.CIMError(pywbem.CIM_ERR_INVALID_PARAMETER, |
1122 | raise pywbem.CIMError(pywbem.CIM_ERR_NOT_SUPPORTED, |
1161 | "Unknown Pool type.") |
1123 | "InExtents specified together with Pool .") |
1162 |
This is weird... If Pool is specified, then this method _always_ modifies the Pool. You should check if the parameters are fine and call appropriate modify_vg or modify_thinpool. If Pool is None, this method always _creates_ new pool. You should check input parameters and: - if Goal says that thin pool is requested: create thin pool (and check other params. accordingly). The _source_ VG is in InPool parameter! - if goal is None or specifies normal VG: try to create VG (and check other params accordingly)
src/lmi/storage/LMI_StorageConfigurationService.py (Diff revisions 1 - 2) | |||
---|---|---|---|
def _delete_vg(self, job, poolpath): |
|||
1617 | action = blivet.ActionDestroyDevice(pool) |
1649 | actions = [] |
1618 | storage.do_storage_action(self.storage, [action]) |
1650 | actions.append(blivet.ActionDestroyDevice(pool)) |
1651 | # Destroy also all formats on member devices. |
||
1652 | for parent in pool.parents: |
||
1653 | actions.append(blivet.deviceaction.ActionDestroyFormat(parent)) |
||
1654 | storage.do_storage_action(self.storage, actions) |
isn't this already pushed? I am not sure now...
- Jan Safranek
On February 3rd, 2014, 11:34 a.m. CET, Jan Synacek wrote:
Review request for OpenLMI Developers.
By Jan Synacek.
Updated Feb. 3, 2014, 11:34 a.m.
Repository:
openlmi-storage
Description
Diffs
|