Commit Graph

531 Commits (57e2eb13d065e6e428ea7556cc71d34d717d9ba2)

Author SHA1 Message Date
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
kairoaraujo c80c843d8a Replace deprecated library function os.popen() with subprocess
os.popen() is deprecated since version 2.6. Resolved with use of
subprocess module.

Change-Id: Ic9c994dd044ac0c27194ba05634c826c6ca9e7ba
Closes-Bug: #1529836
2016-02-11 09:56:09 -02: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
Jenkins ebbb9ec623 Merge "Emit instance life cycle events" 2016-02-10 17:07:20 +00:00
Drew Thorstensen 5848833533 Update requirements level
Bring nova-powervm up to the new global-requirements for OpenStack.

Change-Id: I07bbae22170dfdf54267a13c29cc22b74396d907
2016-02-09 13:55:50 -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 02b5c9f0d0 Port over pretty_tox.sh from Nova
Nova has a bash script that uses the ostestr package to format
the output from tox in a 'pretty' format.  It makes it much more
readable.  pretty_tox.sh is pulled from Nova as-is and enabled
in tox.ini.

Change-Id: Ib90791b1333044c98e20444953d7ccab21cd62ba
2016-02-08 08:28:54 -06:00
Kyle L. Henderson a339ce2faf Update nova vnc config options location
The nova vnc configuration options have moved from nova.vnc to
nova.conf.vnc.

Change-Id: I25f2ff5fc6e6c367ac4ccdc20bbc1afdb28d5631
2016-02-05 19:10:01 -06:00
venkatamahesh a63c825b5b use uppercase 'S' in word "OpenStack"
Change-Id: I8d3791afe71f90249135ad163fdac8f96f1d446c
2016-02-04 16:36:47 +05:30
Jenkins 9a12d2e4ac Merge "Fix spell typos" 2016-02-03 22:21:36 +00:00
Jenkins 111727c2f2 Merge "Initial seed of hacking rules" 2016-02-03 19:27:14 +00:00
venkatamahesh b9f012e14a Fix spell typos
Change-Id: I497eb5b2b0a388c242a452bddc39c2bc39648f7a
2016-02-03 23:31:48 +05:30
Drew Thorstensen 08577f420d Add more information on local.conf files
This change set adds some additional background information on the
local.conf files.  This was feedback from the field that this will help
developers as they on board for the project.

Change-Id: I0e69bb01e497bfd29817559021cdafeaf0248cad
2016-02-02 20:43:02 -05:00
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
deployed).

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
adreznec 35bc4447db Do not error if NovaLink not installed
Instead of throwing a fatal error if NovaLink is not installed,
simply warn the user instead.

Change-Id: If676cfaa081ee7bb2d0ce3d02323d729c79b943d
2016-01-21 12:42:04 -06:00
Jenkins fa85959c13 Merge "Cleanup driver UTs" 2016-01-21 17:01:55 +00: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
tests.

Change-Id: I2b79698584b0fd978d9cf044206350485d4f687a
2016-01-21 09:19:49 -06:00
Eric Fried d2a4f4608a pypowervm log level to INFO in local.conf samples
At DEBUG, pypowervm produces way too much information, including the
payload of every REST request & response.  Set the log level to the
more-reasonable INFO in our sample local.conf files for compute and
all-in-one nodes.

Change-Id: Ie8b1abed5106902046bb36c39fbc980a9e481f12
2016-01-21 08:00:54 -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