Commit Graph

478 Commits (e5749bec65deabf567dc80a32b41cfcee79fbe64)

Author SHA1 Message Date
kairoaraujo e5749bec65 hacking: check for deprecated
Add hacking check for deprecated library function os.popen().
This bug was reported
and this hacking prevents new os.popen() in the code.

Change-Id: I124b9f86ffc6eba268c99ad9834686f55fd857c3
2016-02-17 14:43:31 -02:00
Jenkins 57e2eb13d0 Merge "Add vif driver framework" 2016-02-15 13:31:27 +00:00
Jenkins f5b758827e Merge "Sanitize PowerVM partition name" 2016-02-11 23:25:51 +00:00
Eric Fried 3c39bfff2f Sanitize PowerVM partition name
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.

Related-Bug: #1535338

Change-Id: Ic494f4ec05d9f6b1b2c93843ad404c6bee0bfba8
2016-02-10 15:33:27 -06:00
skseeker 9b35519f76 pep8 error resolved
Removes the H405 pep8 exclusion.

Change-Id: I9cea7c3b1b05ed737f6dd65853a6247a8e58ca17
2016-02-10 12:36:30 -05:00
Drew Thorstensen 01a452be03 Add vif driver framework
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).

Change-Id: Ieb250d539e4adad8977d3a2716c2f1cf341c4137
2016-02-10 12:23:52 -05:00
Kyle L. Henderson 97b3661463 Emit instance life cycle events
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.

Change-Id: I33363d4b9dfef3fafc9125dd283660417dbf3186
2016-02-09 08:21:20 -06:00
Kyle L. Henderson a339ce2faf Update nova vnc config options location
The nova vnc configuration options have moved from nova.vnc to

Change-Id: I25f2ff5fc6e6c367ac4ccdc20bbc1afdb28d5631
2016-02-05 19:10:01 -06:00
Jenkins 9a12d2e4ac Merge "Fix spell typos" 2016-02-03 22:21:36 +00:00
venkatamahesh b9f012e14a Fix spell typos
Change-Id: I497eb5b2b0a388c242a452bddc39c2bc39648f7a
2016-02-03 23:31:48 +05:30
Kyle L. Henderson 18252f3f96 Initial seed of hacking rules
Change-Id: I17ccd8de73c9c5452897cc6f54fddcf1911971e0
2016-02-02 11:00:15 -06:00
Chhavi Agarwal 7dd938d819 Don't remove the hdisk if multiattach
Follow up change set for multiattach, If the multiple mapping found
for the same hdisk, do not attempt to remove the hdisk.

Change-Id: I0175bb4827dc76dfb774907e1db93d92c39731f6
Partially-implements: blueprint multi-attach-volume
2016-02-01 00:31:31 -05:00
Jenkins aa077c2ea8 Merge "Support the nova evacuate spawn semantic" 2016-01-30 16:20:04 +00:00
Kyle L. Henderson 5b269525f7 Support the nova evacuate spawn semantic
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.

Change-Id: I3cf904636c195b48bf5c0436b3e01a961405bf2a
2016-01-27 15:14:49 -06:00
Jenkins 04743d29af Merge "Add checksum to image LU identification" 2016-01-26 13:59:16 +00:00
Jenkins bf7bfea05e Merge "Update tox.ini flake8 rules" 2016-01-23 21:26:16 +00:00
Eric Fried edf7367ed5 Add checksum to image LU identification
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
with underscores.

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.

Change-Id: I465a90e7105d7d8a7ed1e0b30e96ee98a1d7dfdb
2016-01-22 12:06:02 -06:00
Jenkins 48f8bca8d8 Merge "Add minor authentication to vnc console" 2016-01-22 16:32:45 +00:00
Drew Thorstensen 07e6073f7b Update tox.ini flake8 rules
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.

Change-Id: I82cdcbc79dac7254f768e110d48c66d63274fc93
2016-01-22 08:37:46 -05:00
Kyle L. Henderson 7137b449fc Cleanup driver UTs
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

Change-Id: I2b79698584b0fd978d9cf044206350485d4f687a
2016-01-21 09:19:49 -06:00
Drew Thorstensen 5547178f37 Add minor authentication to vnc console
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.

Change-Id: I3c3bfde9513d9ad96fe5638469a2005ad57e91bb
2016-01-20 21:15:03 -05:00
Jenkins a01f3ca869 Merge "Convert to use nova.objects.ImageMeta" 2016-01-20 16:00:59 +00:00
Kyle L. Henderson 42a1a63bb9 Convert to use nova.objects.ImageMeta
The compute manager now passes image object to the virt driver
rather than dicts.

Change-Id: Ib8f52ecc9f4241636e79d9a7f8846c081c42b5f3
Blueprint: mitaka-objects
2016-01-19 14:08:48 -06:00
Jenkins 06f5549812 Merge "Enable oslo-config-generator to generate a sample" 2016-01-19 19:46:25 +00:00
Kyle L. Henderson 537514c744 Enable oslo-config-generator to generate a sample
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.

Change-Id: Iacc3a3ec9e7b00275ba192b5b9b07e346da6fbbf
2016-01-19 07:01:45 -06:00
Kyle L. Henderson 971d17afca Better config option validation and testing
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.

Change-Id: I7adb4ce8f1f1c2359b210296aaa52e1f0a80417e
2016-01-15 16:09:13 -06:00
Jenkins f4f47699c3 Merge "Centralize config options for PowerVM" 2016-01-15 13:49:38 +00:00
Jenkins 56526e2337 Merge "Handle task state update when expected is None" 2016-01-14 21:27:51 +00:00
Kyle L. Henderson d91c8eedff Centralize config options for PowerVM
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.

blueprint centralize-config-options

Change-Id: Ia1e5901b27256754c807bb956b98ca2e66b1f312
2016-01-14 09:08:40 -06:00
ibm 718e3457d6 Nova PowerVM changes for Remote VNC Console
Changes in the nova-powervm driver to support remote VNC console

Change-Id: Ia21221ba81f09499e124d8f0a9929d170562f652
2016-01-14 06:36:55 -06:00
Kyle L. Henderson 51f2ee99df Handle task state update when expected is None
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.

Change-Id: I00ab265533fe30ba4ffb86759588bba3b139e0a2
2016-01-11 15:51:57 -06:00
Jenkins 473f6edc13 Merge "Use fixtures MockPatch in fixtures" 2016-01-11 18:41:41 +00:00
zhuljbj ec5f77c7a3 Conduct vsp hard shutdown when deleting an active VM
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.

Change-Id: I2908b72fdb46b74d8723964dc7d5f3ba7a52a49a
2016-01-09 23:48:07 -05:00
Kyle L. Henderson 796247cf0b Use fixtures MockPatch in fixtures
This change is to use the fixtures MockPatch method to setup
our fixtures.  Previously, the mocks were manually started and
cleaned up.

Change-Id: I18161c660fba0c7431e4015fc8723b8a462502cf
2016-01-08 15:39:46 -06:00
Jenkins 11710be804 Merge "Convert destroy exceptions to Nova exceptions" 2016-01-08 13:06:07 +00:00
Kyle L. Henderson 5dfabb3763 Convert destroy exceptions to Nova exceptions
Changed the driver destroy operation to translate exceptions
received into Nova exceptions.

Change-Id: Ied2bf518f84a74f618f302e42b0c41bab4a4e243
2016-01-07 16:22:50 -06:00
Kyle L. Henderson a9477a6c3d Raise Nova exception on power off error
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.

Change-Id: I39d4cab78a71077e293b2ab69191ca92676fd43b
2016-01-07 13:47:14 -06:00
Kyle L. Henderson 1f28d5db85 Drop JSON decoding for supported_instances
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.

blueprint mitaka-objects

Change-Id: I86391c80bf733b84c2d4ae6377437b130b7b9087
2016-01-07 11:04:08 -06:00
Kyle L. Henderson 1b5c427a73 Support resize and cold migration
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.

Change-Id: Ie3afe7de9b6daca2396dbc9e2d1c1537cb85e8d9
2016-01-06 09:27:04 -06:00
Jenkins a46d18e134 Merge "Implements estimate_instance_overhead()" 2016-01-06 13:05:47 +00:00
Jenkins 4d102f23b4 Merge "Check the destination host is capable for IBMi VM LPM." 2016-01-05 18:51:34 +00:00
ibm c3c8e03fd0 Implements estimate_instance_overhead()
estimate_instance_overhead is an compute interfaces which returns
the instance virtualization overhead required to build an instance.

Change-Id: I7aa598cc44cd26159221462fe63f46e273c67cfe
2016-01-05 02:16:39 -06:00
zhuljbj e9607f0dd2 Check the destination host is capable for IBMi VM LPM.
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.

Change-Id: I42b64c51d9ff6902f12ca078e67c36deed2d66eb
2016-01-04 20:50:06 -05:00
Drew Thorstensen e779e950d6 Change LOG.warn to LOG.warning
Python 3 deprecated the logger.warn method, see:
so we prefer to use warning to avoid DeprecationWarning.

Change-Id: Ic19e8cb8cc7c6211f716376e35f5d2d7c68464ef
Closes-Bug: 1530742
2016-01-04 09:16:47 -05:00
Eric Fried 99f19c86dd Refactor 'detach vopt' to use detach_storage
pypowervm.tasks.scsi_mapper.detach_storage provides the function to
detach the storage element from VSCSI mappings.  This logic was
previously inlined in
- this change set replaces the inline code with the pypowervm call.

Change-Id: Ica5096e4150d76c79c198073a3b96dab5789ab57
2015-12-07 09:19:16 -06:00
Drew Thorstensen aad297c619 Don't remove vOpt mapping on live migrate
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
optical media.

Change-Id: Id2a3216ec06e95a538fa2f9f25463c490d69f81f
Closes-Bug: 1522222
2015-12-03 11:44:54 -06:00
ibm 026f3ad1b1 Provide synchronization during the Vopt creation
During concurrent scale deploys sometime we hit the synchronization
issue during the vopt validation.

Change-Id: Ic522b8a1cfc984e114ec74e827ae1546236a7c55
Closes-bug: #1521097
2015-12-01 07:52:52 -06:00
Jenkins 947d44c5b9 Merge "Clean up hdisks after failed live migration" 2015-11-16 21:22:19 +00:00
Jenkins 8fcce7c695 Merge "Raise error if bad WWPNs used on connect" 2015-11-13 20:42:23 +00:00
Kyle L. Henderson 09d23f8d3b Clean up hdisks after failed live migration
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.

Change-Id: I6e7f88ede68522c9f4788c549b8bfc84f7ae382a
2015-11-12 13:22:36 -06:00