Commit Graph

411 Commits (ceb54aad777db34493413714cd4a4d33483b4c4e)

Author SHA1 Message Date
Lennart Regebro ceb54aad77 Adding a test to exercise the command
Change-Id: Ia0fb62837c813a353c1d40eb8de2c763738caad8
2015-12-17 13:25:46 +01:00
Lennart Regebro 61cab9e97f Increase test coverage for utils and plugin
Increasing test coverage to acceptable levels for utils.py and plugin.py.

Change-Id: I4e71f126848e85c8330b49a1883c9c3ee9746fcf
2015-12-04 13:28:09 +01:00
Ben Nemec 2d7017ab71 Deprecate bash ramdisks
Ironic has deprecated these for a while, so we should be notifying
our users of that fact.  This change also makes us stop using those
old ramdisks by default so we don't have to build an extra image
during CI runs.

Change-Id: I68d726bf73ba0aa10803a5fd8f523323d1fdd70e
Co-Authored-By: Dan Prince <dprince@redhat.com>
2015-11-19 17:53:48 +00:00
Jenkins 0925b0300e Merge "Log all resource events during overcloud deploy" 2015-11-16 21:13:13 +00:00
Jenkins 1314fb36a0 Merge "Generate a unique DeployIdentifier on updates" 2015-11-16 20:46:40 +00:00
Jenkins 504a0140e1 Merge "Don't log exceptions redundantly" 2015-11-16 14:17:35 +00:00
Steve Baker a6ff771ab7 Log all resource events during overcloud deploy
This change switches the overcloud deploy stack polling with event
list polling. This uses the same technique as the recently added
heat stack-create --poll mode: Ib7d35b66521f0ccca8544fd18fb70e04eaf98e5a

There is a (CREATE|UPDATE)_(COMPLETE|FAILED) event generated when the stack
operation is complete, so this is used to decide when to stop polling.

Also, every time there is an event it is printed to the screen in log
style. This would give the user an indication that something is
happening, which is better than staring at nothing for minutes (hours).

On stack update, the oldest event from the previous operation is discovered and
that is used for the marker so that only new events are logged.

Change-Id: I8951b0b924db769961aa67e654fcbd774d3e7787
2015-11-16 03:27:11 +00:00
Jenkins 1a0e071cd1 Merge "Allow adding new overcloud passwords" 2015-11-13 21:45:34 +00:00
Jenkins 8edeb7e687 Merge "Remove parameter defaults" 2015-11-13 21:24:04 +00:00
Jenkins e15c696950 Merge "Include registry on update when other envs are specified" 2015-11-12 17:14:41 +00:00
Dan Prince ed945a9080 Generate a unique DeployIdentifier on updates
This patch updates 'overcloud deploy' commands so that
updates (re-running deploy on an existing stack) generate
a unique DeployIdentifier parameter. By passing an unique
DeployIdentifier parameter into the overcloud stack we
force all puppet config tasks (which are idempotent
and safe to exec multiple times) again.

We've had several issues with puppet not-rerunning on
a variety of config related changes and additionally recieved
user feedback that not re-running all puppet deployments on
an update is confusing.

Change-Id: Ia659181872a6537cc169f1d1531ebf5d36160183
Closes-bug: #1505430
Depends-On: Ic352ddd30807dc378e5e7b6c396bc53f5d6d5622
2015-11-12 07:25:13 -05:00
Jenkins 27b6c0aa78 Merge "Do not try to introspect nodes in maintenance mode and associated ones" 2015-11-11 20:35:42 +00:00
Jenkins c5578ddbeb Merge "Require tunnel ranges if network type is VLAN" 2015-11-11 11:05:36 +00:00
Dmitry Tantsur 6c5ce78479 Do not try to introspect nodes in maintenance mode and associated ones
Some time ago ironic-discoverd used to require maintenance mode.
This was changed back in Kilo, and was deprecated in Liberty.

Also cleans up introspection code a bit.

Change-Id: Ib2ea84a8e7f0a42423199cd1db40136ab8495fdc
2015-11-10 14:15:16 +01:00
Jenkins 5124fa0eac Merge "Don't raise bare Exceptions" 2015-11-09 18:27:28 +00:00
Jenkins 8792971880 Merge "Install bigswitch networking plugin by default" 2015-11-09 10:08:28 +00:00
Jenkins e925b7cc25 Merge "Don't parse redhat-release for distro info" 2015-11-06 14:52:36 +00:00
Jenkins f39484c94c Merge "Do not throw an error on validation when tunneling is disabled" 2015-11-05 15:11:33 +00:00
Ben Nemec d7141d6f51 Don't raise bare Exceptions
It's generally recommended that base Exceptions not be raised,
because this makes it impossible to handle exceptions in a more
granular way.  except Exception: will catch all exceptions, not
just the one you might care about.

This replaces most instances of this pattern in tripleoclient, with
the exception of the one in overcloud_image.py because I have a
separate change open that already fixes it.

Change-Id: I6fce306c4ffc57b4c52389be1feb583f5a400a64
2015-11-04 20:14:47 +00:00
Jenkins f5ef4434b0 Merge "Disable command run under root user" 2015-11-02 20:17:14 +00:00
Brad P. Crochet 9b259132f6 Require tunnel ranges if network type is VLAN
If the neutron network type is set to 'vlan', then the Neutron tunnel
ranges argument must also be passed.

Change-Id: I82a37db15c034da56c0c2c90146f01aa522226e1
2015-10-30 09:53:41 -04:00
Brad P. Crochet 4a0d237bac Do not throw an error on validation when tunneling is disabled
When neutron tunneling is disabled, allow the passing of neutron network type
without the need for neutron tunnel types.

Change-Id: Ib09ef36507ffbe0589c57d1a23ee6da38ffa0e5a
Closes-Bug: #1507556
2015-10-29 08:23:26 -04:00
Brad P. Crochet d0b54c533d Remove parameter defaults
Remove parameters that have sane defaults in the Heat templates.
In order to change these, one should use an environment file rather
than passing args to the deploy command. These commands should now
be considered deprecated in favor of the environment file.

Change-Id: Idbf85d455f348ed2ab9b34fe1dc95faec427a13f
Depends-On: Ifd740c50ee0e48e0cf50d9ebd9cc282155cb3a6d
2015-10-29 08:12:51 -04:00
Jenkins fe27e7934a Merge "Turn the baremetal client reference into a property" 2015-10-27 14:11:16 +00:00
Jenkins c772b51282 Merge "Turn the orchestration client reference into a property" 2015-10-27 12:34:52 +00:00
Brad P. Crochet f3af5c5c1c Turn the baremetal client reference into a property
Use a property instead of a function. This is more in line with how the
clients are referenced with openstackclient, thereby making it easier
to switch to the Ironic OSC plugin in the future.

Change-Id: I0b4d35f0af6136dd1bce6c6d4202caa52f4c042e
2015-10-27 12:31:54 +00:00
Mike Burns 33da842ef9 Install bigswitch networking plugin by default
Install the bigswitch networking packages
python-networking-bigswitch
openstack-neutron-bigswitch-lldp

Related:  rhbz#1262059

Change-Id: Ia7b50f7cfde4eb4444e7ba77a7d825ac8ba58318
2015-10-23 08:01:46 -04:00
Jenkins 2117ca53bf Merge "Fix chicken and eggs problem with tripleo-heat-templates" 2015-10-23 07:46:09 +00:00
Jenkins 4327be3cd6 Merge "Install device-mapper-multipath on overcloud-full" 2015-10-23 03:28:14 +00:00
Steve Baker 6cdae2f901 Include registry on update when other envs are specified
On an openstack overcloud deploy which results in a stack-update,
implicitly include overcloud-resource-registry-puppet.yaml if the user
specifies any other custom environments. Do not include
overcloud-resource-registry-puppet.yaml if the user specifies no extra
environments.

This solution would be an improvement over the current situation, but it
isn't perfect.

It does the right thing when:
- the user does an openstack overcloud with no environments specified
- the user does an openstack overcloud with all custom environments
  specified

It will sometimes do the wrong thing when:
- the user specifies a partial list of custom environments (like -e
  do_my_custom_oneoff_thing.yaml)

Change-Id: I60fbf2182429f6bb83e000fc4d45269d7f83171b
Related-Bug: #1498607
Closes-Bug: #1504363
2015-10-22 09:04:46 +13:00
Jenkins 5c4bd5a81c Merge "Don't download fedora-user as part of --all build" 2015-10-21 07:12:32 +00:00
Marek Aufart f538e304a5 Disable command run under root user
Running openstack command with python-tripleoclient under
root user is not supported and should not be allowed. Added
check for user and exit if it is root (EUID=0) to openstack
undercloud install command.

Each command can be disabled for root by adding
utils.ensure_run_as_normal_user() into it's body.

Change-Id: I685c639e02790483d1607c7eac038f8b9b8dc99e
Closes-Bug: rhbz#1239088
2015-10-21 07:07:42 +00:00
Jenkins dfa236730a Merge "Move more functions to utils.py" 2015-10-21 07:01:08 +00:00
Jenkins 7cbd5d13a9 Merge "Consolidate module constants." 2015-10-21 06:54:54 +00:00
Jenkins b6450f01fb Merge "Set --min-tmpfs for overcloud-full build" 2015-10-21 06:53:54 +00:00
Ben Nemec 6524e7035a Don't log exceptions redundantly
The pattern

self.log.error('Some message')
self.log.exception(e)

is redundant and misuses the logging.exception function.  The
argument to exception() is supposed to be a string describing the
error that occurred, not the exception itself.  It already pulls
the exception details from the exception handler context and
includes them in the output.

This changes the instances of the above pattern to simply

self.log.exception('Some message')

which results in the correct output of something like:

ERROR:root:Some message
Traceback (most recent call last):
  File "./test.py", line 23, in <module>
    raise Exception('foo')
Exception: foo

Change-Id: Ia55ec34256ceb6f095c2fbfe2d085567f6382509
2015-10-20 21:41:05 +00:00
Yanis Guenane 584c95f36a Fix chicken and eggs problem with tripleo-heat-templates
There is a current effort on tripleo-heat-templates to manage keystone
resources directly via puppet. The effort is separate in two patchset
one to replace the current keystone.initialize() and the other other to
replace setup-endpoints().

This review is necessary in order to make CI pass the upstream jobs.
The whole keystone functions call will be removed then.

Change-Id: Ia4b3244f114dcff746ab89d355ad4933f8fdbddf
2015-10-20 14:43:11 +02:00
Ben Nemec 0bdc365928 Allow adding new overcloud passwords
The current implementation of the password generation function is
all or nothing.  If the file exists, then it uses that file as the
list of passwords, otherwise it generates an entirely new file.

This means that if we add a new service that requires a password to
be generated and a user upgrades with a password file generated by
an older version, we will not generate a new password for the new
service and pandemonium will result.

To address the problem, read in any existing passwords from the file,
but loop through the names to make sure all of the expected passwords
are set.  If any are not, generate them.  Behavior in the case of
no password file remains unchanged.

Change-Id: Id9c5fe363a2aef55800bee4db12cbf3e2d278e45
2015-10-19 17:44:39 +00:00
Ben Nemec 33ef0718f6 Don't parse redhat-release for distro info
Python provides the platform module that can do this for us, and
it will simplify adding support for other distros in the future if
we aren't dependent on a redhat-specific file.

Also changes the exception raised from Exception to RuntimeError
because raising bare Exceptions is frowned upon.

Change-Id: I50d443918d802e94260a14be2f5a4e749e583703
2015-10-19 14:51:12 +00:00
Ryan S. Brown c75be2b2f8 Move more functions to utils.py
Moves create_overcloudrc and create_tempest_deployer_input to utils.py
because they didn't require the instance information from
DeployOvercloud, and now can be better tested independently.

Depends-On: I98e19cc29d69cbd6636cd4ce77a07c7a0e3dc048
Depends-On: I205569f4be0bcee2b284048dec7ddf0b28bbd8a1
Change-Id: I4a819c4262bde4d38e3f51150413836ca83646a0
2015-10-19 10:30:18 -04:00
Ryan S. Brown 59c5e4d980 Consolidate module constants.
3 separate places had hardcoded values for the t-h-t directory. Many
values are/will be shared, this patch consolidates them to avoid having
them diverge in the future.

Depends-On: I98e19cc29d69cbd6636cd4ce77a07c7a0e3dc048
Change-Id: I205569f4be0bcee2b284048dec7ddf0b28bbd8a1
2015-10-19 10:22:50 -04:00
Jenkins 2aac09de13 Merge "Improve Coverage for tripleoclient/utils.py" 2015-10-19 13:24:39 +00:00
Jenkins 199a35f696 Merge "Explicitly unset package update hooks when re-deploying" 2015-10-16 07:49:19 +00:00
Jenkins ee4e4efe30 Merge "Also disallow tunnel types without network type" 2015-10-15 12:16:55 +00:00
Jenkins e636596fbf Merge "Change RHEL subscription template path" 2015-10-15 09:49:50 +00:00
James Slagle 57cb0fa245 Install device-mapper-multipath on overcloud-full
device-mapper-multipath needs to be installed for managing of multipath
devices for scenarios where fail over or load balancing of block devices
is desirable.

This change installs the package by default in the overcloud-full image
for connvenience. The multipathd daemon is not started or enabled nor
any multipath configuration exposed. Those exercises would be left to be
done via the ExtraConfig resources in tripleo-heat-templates.

Change-Id: I5b575fe7728fd58c1fd448b1f4355ee4df7bffb8
2015-10-14 13:29:31 -04:00
Ben Nemec 017cb65bea Don't download fedora-user as part of --all build
fedora-user is an optional image that is only used for testing the
deployed overcloud.  We shouldn't force everyone to download it as
part of the --all build when in many cases it won't be needed.  The
option to download it is left in the client though so it can still
be easily retrieved when necessary.

Change-Id: I3ea6ad911a6ee411f19379060da127ef0a6e75e3
2015-10-14 16:17:19 +00:00
Ben Nemec 608b069762 Set --min-tmpfs for overcloud-full build
I consistently have problems building images on an 8 GB VM with
the undercloud already installed (which is the documented flow).
At 4 or 12 GB it works fine, but 8 seems to fall in a sweet spot
where the tmpfs usage of dib causes OOM problems.  4 GB works
because dib doesn't use tmpfs by default with that little memory,
and 12 GB seems to be sufficient to avoid running out of memory
even with tmpfs.

This changes passes the --min-tmpfs 5 parameter to the image build
for the overcloud-full image (the largest image by far) so it will
not attempt to build in tmpfs if there is less than 12 GB of RAM.
5 instead of 6 because due to rounding 6 would result in tmpfs not
being used on 12 GB VMs either (similar to how it is not used on a
4 GB VM even though the default is 2).

Note that tmpfs by default uses half of total memory, which is why
all of the min-tmpfs numbers are half of the expected memory on the
system.

Change-Id: I6254d04216936551e68ac02999f2bffc11b19f65
2015-10-14 16:14:35 +00:00
Jan Provaznik 3c603896c0 Explicitly unset package update hooks when re-deploying
Because existing heat environment is used (instead of passing whole
environment with each stack-update command), it's possible
that there are some hooks left in the existing environment.

As a short-term solution, we make sure we unset hooks (which are
now set only by package update command).

Change-Id: I9782098fb4be889e63824338b2fdb6c9b1b13bf4
Depends-On: I1cb6c069cf6cf3b5f9504b35ca9538ba99ec405d
Closes-Bug: #1502869
2015-10-14 15:45:54 +02:00
Jenkins e7829bc661 Merge "Move common functions out into utils.py" 2015-10-14 10:27:46 +00:00