Changed name of cpc_uuid config option to cpc_object_id

Reason for the change is that the HMC API book does not mention
anywhere that the format of the ID is a UUID, and the name of the
resource property is "object-id". This change set changes the
name of the DPM config option "cpc_uuid" to "cpc_object_id",
and the devstack variables CPC_UUID to CPC_OBJECT_ID, and
updates any use of that and the unit testcases accordingly.

Change-Id: I6153ac791d4296101dc00f23dfb7fb7c3d2fee2c
Partial-Bug: 1659304
Signed-off-by: Andreas Maier <maiera@de.ibm.com>
This commit is contained in:
Andreas Maier 2017-01-25 15:51:32 +01:00 committed by Andreas Scheuring
parent 44d5c02320
commit 5fa46366d9
9 changed files with 17 additions and 17 deletions

View File

@ -28,7 +28,7 @@ max_instances = 10
max_memory = 5000 max_memory = 5000
max_processors = 2 max_processors = 2
host = foo host = foo
cpc_uuid = <cpc-uuid> cpc_object_id = <cpc-object-id>
hmc_password = <password> hmc_password = <password>
hmc_username = <user> hmc_username = <user>
hmc = <ip> hmc = <ip>

View File

@ -55,7 +55,7 @@ function configure_nova_dpm {
iniset $NOVA_CONF dpm hmc_username $HMC_USERNAME iniset $NOVA_CONF dpm hmc_username $HMC_USERNAME
iniset $NOVA_CONF dpm hmc_password $HMC_PASSWORD iniset $NOVA_CONF dpm hmc_password $HMC_PASSWORD
iniset $NOVA_CONF dpm host $HOST iniset $NOVA_CONF dpm host $HOST
iniset $NOVA_CONF dpm cpc_uuid $CPC_UUID iniset $NOVA_CONF dpm cpc_object_id $CPC_OBJECT_ID
iniset $NOVA_CONF dpm max_processors $MAX_PROC iniset $NOVA_CONF dpm max_processors $MAX_PROC
iniset $NOVA_CONF dpm max_memory $MAX_MEM iniset $NOVA_CONF dpm max_memory $MAX_MEM
iniset $NOVA_CONF dpm max_instances $MAX_INSTANCES iniset $NOVA_CONF dpm max_instances $MAX_INSTANCES

View File

@ -15,7 +15,7 @@ HMC=$HMC
HMC_USERNAME=$HMC_USERNAME HMC_USERNAME=$HMC_USERNAME
HMC_PASSWORD=$HMC_PASSWORD HMC_PASSWORD=$HMC_PASSWORD
HOST=$HOST HOST=$HOST
CPC_UUID=$CPC_UUID CPC_OBJECT_ID=$CPC_OBJECT_ID
MAX_PROC=$MAX_PROC MAX_PROC=$MAX_PROC
MAX_MEM=$MAX_MEM MAX_MEM=$MAX_MEM
MAX_INSTANCES=$MAX_INSTANCES MAX_INSTANCES=$MAX_INSTANCES

View File

@ -45,7 +45,7 @@ ALL_DPM_OPTS = [
Password for connection to the HMC"""), Password for connection to the HMC"""),
cfg.StrOpt('host', default='', required=True, help=""" cfg.StrOpt('host', default='', required=True, help="""
Name of the OpenStack hypervisor host"""), Name of the OpenStack hypervisor host"""),
cfg.StrOpt('cpc_uuid', help=""" cfg.StrOpt('cpc_object_id', help="""
Object-id of the target CPC"""), Object-id of the target CPC"""),
cfg.IntOpt('max_processors', help=""" cfg.IntOpt('max_processors', help="""
Maximum number of shared physical IFL processors on the target CPC that can Maximum number of shared physical IFL processors on the target CPC that can

View File

@ -16,7 +16,7 @@
def getFakeCPCconf(): def getFakeCPCconf():
conf = {'cpcsubset_name': "S12subset", conf = {'cpcsubset_name': "S12subset",
'cpc_uuid': "1232132", 'cpc_object_id': "1232132",
'max_processors': 10, 'max_processors': 10,
'max_memory_mb': 200, 'max_memory_mb': 200,
'max_partitions': 10 'max_partitions': 10

View File

@ -104,7 +104,7 @@ def getFakeCPC(cpcmanager=None):
def getFakeCPCconf(): def getFakeCPCconf():
conf = {'cpcsubset_name': "S12subset", conf = {'cpcsubset_name': "S12subset",
'cpc_uuid': "1232132", 'cpc_object_id': "1232132",
'max_processors': 10, 'max_processors': 10,
'max_memory_mb': 200, 'max_memory_mb': 200,
'max_partitions': 10 'max_partitions': 10

View File

@ -74,7 +74,7 @@ class DPMDriver(driver.ComputeDriver):
# retrieve from ncpu service configurationfile # retrieve from ncpu service configurationfile
self._conf = {'cpcsubset_name': CONF.dpm.host, self._conf = {'cpcsubset_name': CONF.dpm.host,
'cpc_uuid': CONF.dpm.cpc_uuid, 'cpc_object_id': CONF.dpm.cpc_object_id,
'max_processors': CONF.dpm.max_processors, 'max_processors': CONF.dpm.max_processors,
'max_memory_mb': CONF.dpm.max_memory, 'max_memory_mb': CONF.dpm.max_memory,
'max_partitions': CONF.dpm.max_instances, 'max_partitions': CONF.dpm.max_instances,
@ -82,11 +82,11 @@ class DPMDriver(driver.ComputeDriver):
CONF.dpm.physical_storage_adapter_mappings} CONF.dpm.physical_storage_adapter_mappings}
self._cpc = self._client.cpcs.find(**{ self._cpc = self._client.cpcs.find(**{
"object-id": self._conf['cpc_uuid']}) "object-id": self._conf['cpc_object_id']})
LOG.debug("Matching hypervisor found %(cpcsubset_name)s for UUID " LOG.debug("Matching hypervisor found %(cpcsubset_name)s for object-id "
"%(uuid)s and CPC %(cpcname)s" % "%(cpcid)s and CPC %(cpcname)s" %
{'cpcsubset_name': self._conf['cpcsubset_name'], {'cpcsubset_name': self._conf['cpcsubset_name'],
'uuid': self._conf['cpc_uuid'], 'cpcid': self._conf['cpc_object_id'],
'cpcname': self._cpc.properties['name']}) 'cpcname': self._cpc.properties['name']})
utils.valide_host_conf(self._conf, self._cpc) utils.valide_host_conf(self._conf, self._cpc)

View File

@ -32,11 +32,11 @@ def valide_host_conf(conf, cpc):
errormsg = (_("max_processors %(config_proc)s configured for " errormsg = (_("max_processors %(config_proc)s configured for "
"CpcSubset %(cpcsubset_name)s is greater than the " "CpcSubset %(cpcsubset_name)s is greater than the "
"available amount of processors %(max_proc)s on " "available amount of processors %(max_proc)s on "
"CPC uuid %(cpcuuid)s and CPC name %(cpcname)s") "CPC object-id %(cpcid)s and CPC name %(cpcname)s")
% {'config_proc': conf['max_processors'], % {'config_proc': conf['max_processors'],
'cpcsubset_name': conf['cpcsubset_name'], 'cpcsubset_name': conf['cpcsubset_name'],
'max_proc': cpc.properties['processor-count-ifl'], 'max_proc': cpc.properties['processor-count-ifl'],
'cpcuuid': conf['cpc_uuid'], 'cpcid': conf['cpc_object_id'],
'cpcname': cpc.properties['name']}) 'cpcname': cpc.properties['name']})
raise exception.ValidationError(errormsg) raise exception.ValidationError(errormsg)
if (conf['max_memory_mb'] > cpc.properties['storage-customer']): if (conf['max_memory_mb'] > cpc.properties['storage-customer']):
@ -44,11 +44,11 @@ def valide_host_conf(conf, cpc):
errormsg = (_("max_memory_mb %(config_mem)s configured for " errormsg = (_("max_memory_mb %(config_mem)s configured for "
"CpcSubset %(cpcsubset_name)s is greater than the " "CpcSubset %(cpcsubset_name)s is greater than the "
"available amount of memory %(max_mem)s on CPC " "available amount of memory %(max_mem)s on CPC "
"uuid %(cpcuuid)s and CPC name %(cpcname)s") "object-id %(cpcid)s and CPC name %(cpcname)s")
% {'config_mem': conf['max_processors'], % {'config_mem': conf['max_processors'],
'cpcsubset_name': conf['cpcsubset_name'], 'cpcsubset_name': conf['cpcsubset_name'],
'max_mem': cpc.properties['processor-count-ifl'], 'max_mem': cpc.properties['processor-count-ifl'],
'cpcuuid': conf['cpc_uuid'], 'cpcid': conf['cpc_object_id'],
'cpcname': cpc.properties['name']}) 'cpcname': cpc.properties['name']})
raise exception.ValidationError(errormsg) raise exception.ValidationError(errormsg)

View File

@ -114,7 +114,7 @@ class PartitionInstance(object):
@property @property
def partition_name(self): def partition_name(self):
"""This function will create partition name using uuid """This function will create partition name using the instance uuid
:return: name of partition :return: name of partition
""" """