We now specify the status timeout when starting a partition. The
zhmcclient will wait that amount of seconds for the partition
to become active (or another valid start status).
Without explicitly setting it, the zhmcclient will wait for 900 seconds.
In the past we waited that 900 seconds + the 60 extra seconds, as we
were calling partition.wait_for_completion right after the start of
the partition again.
Change-Id: I483efc5808c1a91993dbde936c27b82302640f9e
The partition status attribute is not being updated automatically.
Before doing the poweron, we need to get the current status.
Otherwise wemight try to stop an already stopped partition,
only as the old status "paused" is still kept in the object.
Change-Id: I6971866e42d4c9a3cab225d52c95ed33a2035f0c
Nova commit [1] has changed the format of the block_device_mapping.
We need to adapt our way how we get the list of host wwpns.
[1] 0258cecaca
Change-Id: I852aeeb57c891c8bd1458c83feae05f58046eb8a
VLAN networking is not supported by nova-dpm. This patch
introduces a new exception that is thrown if somebody tries
to connect a DPM instance to a VLAN network.
Change-Id: I00e10d33040fed62a446b8a1df8eb9ae534a7a43
When a invalid vif_type was given, we used to throw a generic
exception. This patch introduces a new specific exception
InvalidVIFTypeError.
Change-Id: I225e1ccb6fead59b26a011b0ad02b28983751f87
We now can add all NICs with a single command!
This is also usefull once we might introduce ssc support which
requires additional verifications cross all nics.
Change-Id: Ic78686b662c97d67d6376e8b8592aa20887026f8
Patches [1][2] confused block_device_info (bdi) with
block_device_mapping (bdm). We always need the bdm. Nova_dpm's spawn
method now transforms the passed in bdi into a bdm.
[1] 112c4cda58
[2] 255d62a20b
Change-Id: Id3ec0b1861bedab76db42233d49752a277892c77
This patch modifies the method prep_for_spawn
* Making it private -> _prep_for_spawn
* Removing unused parameters
Change-Id: Ie2e2259badef350082b150b7989a93e85c09e9db
In prep_for_spawn we checked if the an image was provided
during launch. If so we aborted. This check is redundant, as we already
check this in _get_partition_instance.
The Unittests are still correct!
Change-Id: Idfee4d6dd80043c9a468b42c7b33dc7669a2529d
For some actions (e.g. downloading an image) we need the context
to be present in PartitionIstance. This patch introduces
the context property in this class. In addition context is set
during launch.
It is not required during other operations for now.
Change-Id: I01b7bee02e79c9b141731a88f7afb77bed7ae1cc
Till now the String was generated and set from the driver class.
This patch moves both actions into the PartitionInstance class.
This allows us overwriting this method once we support another
partition type (e.g. ssc).
Change-Id: If535cbdcdf878f5e9e2f91d0f0d1128021efcbbc
For each nic we need to add some data to the partitions
boot-os-specific-parameters property. Till now we were accumulating
everything to a single string which set the property once. The new
approach is to update the property for each nic.
This leads to more read/write accesses on this partition property. But
on the other hand we're gaining flexibility. E.g. someone might want to
add a NIC after spawn. Or some other data should be added. Those
scenarios were not supported in the past.
This is also helpful to move this code into the partitioninstance
class. In the future this action might not be required for all type of
partitions (e.g. not for ssc).
Change-Id: I0262f2660b3e89b455bb1b1ece016342c8347c80
We extract the pieces that generate the nic dict from the attach_nic
method into a separate method. This allows overwriting the creation
of the dict once we support for example ssc.
Change-Id: I17642d78b62eb71b0d89bec1fb6cd552b11f6fd8
The DPMVIF object represents a VIF (virtual interface for networking).
Nova provides us a large dictionary. This object provides a better method
to access properties of a vif.
Change-Id: I1e6c408c244330d9e59b988aecacce82e2c07b8e
We build up all the properties required for boot now in the
vm class. The driver does not need to deal with gathering
information for boot anymore.
Change-Id: Iad15a7a404a3467d417f27e739a3e4dc7233af6f
This object should simplify the usage of the block_device dictionary
provided by nova. Attributes can now easily be accesed via object
properties and method, instead of doing complex operations on the dict.
This patch does not yet exploit this object. This is done in a follow
up patch.
Change-Id: I4b88761c86dc8996fb490cf8680ceaf1480d445d
The set_boot_hba uri method can determine the boot-hba-uri on its own
as this information is available in the object instance.
Change-Id: I39f15db7865457a7e91452e7a024bc4944a5317b
In some cases we need the hba object to retrieve the wwpn of
the hba used for boot, in some the element-uri. We had 2 different
ways of gathering this information.
This patch transforms the get_boot_hba_uri method into a more generic
get_boot_hba method. From this object it's easy to retrieve the
required properties 'element-uri' and 'wwpn'.
Change-Id: If518a915408caf5c59d4425b8aa2e0673acbcc19
In some methods we directly created an instance of the PartitionInstnace object.
The instantiation of this object is now moved into a separate method. This is
even more usefull when we introduce ssc support in the future. In that case
we could simply introduce a SSCPartitionInstance class. The newly created method
would be the only place where the decission between ssc and pure dpm is done.
Change-Id: I06e6d8ee84b7f308f2cdbf120c08e46afd4dd8be
Following updates are made to the signature of spawn method and its
corresponding references in test_driver.py.
- add "allocations" kw arg as per [1]
- remove "flavor" kw arg as per [2]
[1] http://lists.openstack.org/pipermail/openstack-dev/2017-October/123738.htm
[2] 8749bda96e
Closes-Bug: 1724744
Change-Id: I6fd6974a0b32bbcc520a2fdd2c948367f3e8ae5f
Signed-off-by: Sreeram Vancheeswaran <sreeram.vancheeswaran@in.ibm.com>
Remove loop_status_update function and use
wait_for_status which is provided by zhmcclient
Closes-Bug: #1672979
Change-Id: I9b0d4edbfd9ccf44bae38afceff6200501511807
Signed-off-by: Prabhat Ranjan <pranjank@in.ibm.com>
It seems nova removed 'instance.instance_type_id'
by which we were getting flavor.
Now instance has 'instance.flavor'.
Direct access of flavor.
Closes-Bug: #1707628
Change-Id: I128d8adb0754c5b5313fc3e5ed7c521afa0df508
Signed-off-by: Prabhat Ranjan <pranjank@in.ibm.com>
When we do inband shutdown of partition using
command 'shutdown -P now'
Then partition is not going to 'stopped' state.
It is going to 'PAUSED' state.
In DPM there is no such implementation so that we
can start partition from PAUSED state. So workaround
is we need to stop the partition then start.
This patch also includes the cases when partition is
in "starting/stopping" state.
Closes-Bug: #1678002
Change-Id: I1898b85a8441c3175db0a6de6d620bca19af69ec
Signed-off-by: Prabhat Ranjan <pranjank@in.ibm.com>
After new version of os-dpm-1.1.0 cpc_object_id
is breaking in unit test
Change-Id: Ic17ff50549756728c1213a946d98b0fe2203e813
Signed-off-by: Prabhat Ranjan <pranjank@in.ibm.com>
If HMC is up and CPC is down then the 'ifl-processor' and
'storage-customer' values are 0.
Closes-Bug: #1684102
Change-Id: If7c10ca66c4e47c873cc9c7277a715dee3040ad5
Signed-off-by: Prabhat Ranjan <pranjank@in.ibm.com>
Instance delete always stops partition even if partition ia already stoped.
Work around is when it try to stop the partition which
is already stopped, then catch exception and pass it.
Closes-Bug: #1701506
Change-Id: I8ddb84de307bc58fa68136c503408a2d65ef629a
Signed-off-by: Prabhat Ranjan <pranjank@in.ibm.com>
There is a NumInstancesFilter which can be used to filter the number of
instances that are supposed to be launched on the host this replaces the
work that is planned for max_instances config parameter to perform.
It is removed as the main functionality of this parameter is not yet
implemented in the code.
Change-Id: Ie545a5f74f7b63ea56812577c201fcb443014998
512mb is the minimum memory that is required to launch a partition and
rounding off starts only from value greater that 512mb this decides the
min value needs to be set to the config parameter max_memory.
closes-Bug: 1689267
Change-Id: I493fec40b412feb5303ab7ca9ee2f78c9b9220db
Some of tests use different method of assertTrue(isinstance(A, B)) or
assertEqual(type(A), B). The correct way is to use assertIsInstance(A,
B) provided by testtools.
Change-Id: I3e3917db4f62cc713e0edcef81f2d4d8bb867067
Closes-Bug: #1268480
Oslo.config deprecated parameter enforce_type and change its default
value to True in Ifa552de0a994e40388cbc9f7dbaa55700ca276b0. Remove the
usage of it to avoid DeprecationWarning: "Using the 'enforce_type'
argument is deprecated in version '4.0' and will be removed in version
'5.0': The argument enforce_type has changed its default value to True
and then will be removed completely."
Change-Id: I807ee7b4cc622d8833802c7812f4ee03fc2d40a7
Closes-Bug: #1694616
The default value is set to -1, which means that there is no artificial
upper bound for the number of instances on this CPC. The number of
instances is only limited by the number of (free) partitions on this
CPC.
closes-Bug: 1683318
Change-Id: I80f8b36fa21cef313e0b5a821a26877afd1af980
The initator-target map, we're not necessarily picking
the entry for our boot adapter, but just the first one
that is returned by get_partition_wwpns. But in fact
we must not take the first one, but we must take the
wwpn of our selected boot adapter as initiator wwpns
(and then lookup the target wwpns for it).
Closes-Bug: #1662511
Change-Id: Ib5890c9e696e6bfae5d2915f87b4baf151b2ed9a
Signed-off-by: Prabhat Ranjan <pranjank@in.ibm.com>
This code writes an error log in the nova log
if the CPC is not found in the init_host() method
of the DPMDriver. This will help to debug problems.
The error message contains information about the
HMC host, HMC userid and CPC UUID that were used.
Closes-Bug: #1659037
Change-Id: I4606cefc9943c0a1a3a0db0c496dcce5c468407f
Signed-off-by: Juergen Leopold <leopoldj@de.ibm.com>
Remove requests.packages.urllib3.disable_warnings() from
unit testcase because it is not affacting unit testcase.
Means no warning log without
requests.packages.urllib3.disable_warnings().
But keep as it is in main code because we are using
it at one place only.
https://github.com/openstack/nova-dpm/blob/stable/ocata/nova_dpm/virt/dpm/client_proxy.py#L41
Closes-Bug: #1669299
Change-Id: I2eefc01743c2549ebe8cdc32eb95d03a05f7bc0f
Signed-off-by: Prabhat Ranjan <pranjank@in.ibm.com>
See 3bb1595d1f/nova_dpm/virt/dpm/utils.py (L38-L44)
Especially the line: config_mem=CONF.dpm.max_processors,
That should be "max_memory".
Closes-Bug: #1687051
Change-Id: I3e631550b29647234404638e201f40f362311d89
Signed-off-by: Prabhat Ranjan <pranjank@in.ibm.com>