Add hacking check for deprecated library function os.popen().
This bug was reported https://bugs.launchpad.net/tempest/+bug/1529836
and this hacking prevents new os.popen() in the code.
The restrictions on PowerVM partition names are more stringent than
those on nova instance names. To avoid annoying API errors, if a name
is accepted by nova, we scrub it (using a provided pypowervm interface)
such that it becomes acceptable for PowerVM.
This change set adds a new vif driver interface (as well as SEA
implementation) for the nova-powervm driver. This is important as the
platform looks to new VIF types (ex. qbg or ovs).
The PowerVM REST API allows a handler to be registered for events
from PowerVM. From the events it can be determined if a VM has
had a state change. This change set registers for those events
and determines if the state change is one that should trigger
an instance life cycle event to the compute manager. The compute
manager then can sync the power state between OpenStack and
PowerVM. Normally, _sync_power_states is only called via a
periodic task which defaults to 10 minute intervals.
Follow up change set for multiattach, If the multiple mapping found
for the same hdisk, do not attempt to remove the hdisk.
Partially-implements: blueprint multi-attach-volume
The nova evacuate operation causes the compute manager to
call the virt driver's spawn method with an empty image_meta object.
Handle that case and just hook up the existing disks and volumes.
The SSP disk driver cleverly avoids uploading a particular glance image
to the SSP more than once by naming it such that it can be recognized
subsequently. If the image LU thus named already exists in the SSP, we
reuse it (creating a linked clone for use by the instance being
Previously, the naming convention for an image LU was
'image_%(sanitized_image_name)s', where the sanitized_image_name was
generated from the first 73 characters of the glance image name (79,
which is the default max filename size, minus the length of 'image_'),
scrubbed to replace any non-alphanumeric/period/underscore characters
This will cause problems whenever an image name is reused while the SSP
still contains the original image LU: the SSP disk driver will generate
the same name, find an image LU of that name in the SSP, and blithely
attach the deploying instance to a linked clone of that image, even
though it's not the same as the new one in glance.
To remedy this problem, with this change set we are now generating the
image LU name as 'image_%(sanitized_image_name)_%(image_checksum)s'.
The image_checksum is a 32-character hash that comes from ImageMeta.
The total length is still 79; so the 'sanitized_image_name' is now
limited to 40 characters.
Now, even when an image name is reused, the LU name will (with extremely
high probability, like reaching into your average star twice and getting
two different milligrams of matter) be different because the image's
checksum will be different; so we'll upload and use the new image
instead of the old one.
This change set brings our flake8 ignore rules in line with the core
nova team. nova-powervm should always be a minimal subset of flake8
ignore rules to the broader nova project. This change set removes some
old ignore rules that nova had, that they have removed in the past
couple of months.
Create usable instance objects in the driver setup routine so
each test that needs one doesn't have to duplicate the effort.
Removed unused _inst_dict() method from the driver and unit
When the VNC console gets created, an 'access path' can be passed to
coordinate the connection. This helps ensure that the client is
correctly connecting to the appropriate VM.
This change set enables this additional check for the PowerVM driver.
It should not be confused with full authentication. It simply
validates the UUID.
It is also not encryption. Other patch sets to the VNC consoles have
been proposed for this.
A sample nova_powervm configuration file can be generated with
the oslo tooling via:
oslo-config-generator --namespace nova_powervm > sample.conf
The output file will contain all the nova_powervm configuration
options. The file can be edited and then copy-n-pasted into the
full nova.conf file.
Added bounds checking to integer options and choice values for
string options where certain keywords are expected. Also added
code to ignore case differences for expected keywords.
The Nova blueprint centralize-config-options aims to gather the many
config options into a central location to make them more widely
known and to provide better documentation. This PowerVM change
implements the spirit of that blueprint and mimics the implementation.
The image task UpdateTaskState() was unconditionally sending the
expected_state to the update_task_state function. During a shelve
operation the compute manager uses the expected_state to index
into an array of states. Passing None causes an exception during
shelving for that reason. To fix it, we only pass the expected_state
when it's not None.
Currently an osshutdown is conducted during deleting an active VM. The
change set is to conduct a VSP hard shutdown instead of an osshutdown
when deleting an active VM.
Changed the power_off method to translate exceptions from
pypowervm to Nova exceptions. The InstancePowerOffFailure
exception is expected by the compute manager in some cases.
For instance, it will not deallocate the networks associated
with an instance if the power off exception is raised.
JSON encoding for supported_instances in the virt
drivers was a temporary measure that is not needed.
The encoding has been removed for all in tree virt
drivers. This patch remove it for PowerVM.
This change set adds support for cold migration and resize
to a different host.
Add methods to the local disk driver to retrieve and validate if
the drivers are compatible between the source and destination host.
These methods will only be called if the driver supports shared
storage. Currently only the SSP driver supports shared storage.
Add task flow implemention for migrate_disk_and_power_off.
There is a peculiar case when resizing a VM on the same host.
PowerVM doesn't allow two VMs to be defined with the same UUID,
therefore there is only one VM present on the host and care must
be taken during a resize revert not to delete the one and only VM
we have. To more easily detect that case and to easily see when
a VM is being resized or migrated, we rename the source VM during
the resize/migration processes. The renamed VM will either be
deleted or renamed back when the resize/migration operation is
confirmed or reverted.
To serve as a destination host of IBM i VM LPM, the host has to enable
IBMi mobility capable. The change set is to check the capability before
before migrate the VM.
pypowervm.tasks.scsi_mapper.detach_storage provides the function to
detach the storage element from VSCSI mappings. This logic was
previously inlined in nova_powervm.virt.powervm.media.add_dlt_vopt_tasks
- this change set replaces the inline code with the pypowervm call.
Some operating systems are unable to remove a device when it is in use.
However, during a live migrate, we can't migrate the the virtual optical
The current live migrate code was removing the virtual optical media,
but also was removing the mapping. This change updates it to leave the
mapping (so that operating systems that can't remove the bus are OK),
but to detach the vopt device from it. We still remove the virtual
When there is a live migration failure that prevents the VM
from moving to the destination host, any hdisks created on the
destination host should be deleted. These hdisks are created
when we do the discovery operation for any volumes attached
to the VM via VSCSI.