285 Commits

Author SHA1 Message Date
Jenkins
f185d001a3 Merge "Drop nova-cert >= newton" 2017-06-26 14:08:24 +00:00
James Page
e8f5341034 Drop nova-cert >= newton
nova-cert was deprecated @ newton, and only supports ec2 services
which we dropped in the charms @ liberty so remove installation
and configuration of this service for >= newton.

Change-Id: I6d0ed6a1e058f38cb5d556a34b6f4299bf6d2055
2017-06-23 13:59:24 +01:00
Jorge Niedbalski
51b7a600c8 Evaluate 'None' as None in console_attributes.
The config.yaml file suggests None as one
of the possible values of the directive console-access-protocol,
this is wrongly evaluated as a string in the console_attributes
function, which causes the charm to install the pacemaker
resource even when is not required (console-access-protocol = None).

Change-Id: I367b7fd813e044bc6eedca687e837e8adab2dd40
Closes-Bug: #1697693
Depends-On: I98ebbf9f2c7582fae5f466dfc1d224bf66e38a24
Signed-off-by: Jorge Niedbalski <jorge.niedbalski@canonical.com>
2017-06-16 19:20:40 +00:00
Jorge Niedbalski
0d28006e1c Disable the nova-consoleauth service on HA.
When using the nova-cloud-controller charm in HA with the config
option single-nova-consoleauth set to true, its expected for the
nova-consoleauth service to be run in just a single unit at the time.

The service management (start/stop) is performed by pacemaker in
accordance with the cluster health using the OCF resource agent[0].

Its required for the service to be disabled by default on upstart (trusty)
or systemd (>=xenial).

This change disables the service by using the service_pause
charmhelpers call which considers both cases (upstart/systemd) when
the ha relation is present and the single-nova-consoleauth option is
used.

Also, this change fixes LP: #1660244 (Services not running that should be:
nova-consoleauth) by removing it from the resource_map when
ha + single-nova-consoleauth is used.

[0] https://github.com/openstack/openstack-resource-agents/blob/master/ocf/nova-consoleauth

Closes-Bug: #1693629
Closes-Bug: #1660244

Change-Id: Iaffe0456cceb42ee124cb8881d3379d78cac0f3a
Signed-off-by: Jorge Niedbalski <jorge.niedbalski@canonical.com>
2017-05-30 20:13:46 -04:00
Alex Kavanagh
f9b97ac66c Fix alphanumeric comparisons for openstack and ubuntu releases
- sync charmhelpers with fix-alpha helpers
- fix up code where the alpha comparisons are done
- fix tests which assumed mocks would just work on os_release()

Change-Id: I48b4853ed343bd3188c16f2bc432b4ca0badc473
Related-Bug: #1659575
2017-04-27 10:52:43 +01:00
Corey Bryant
7dd8357b06 Enable SSL termination for nova-placement-api
determine_ports() was not adding the nova-placement-api port to the
ports list because it is run under the apache2 service. This fix
enables determine_ports() to get 'nova-placement-api' from the list
of services rather than 'apache2', allowing it to determine the port
that nova-placement-api uses.

Also enable tests/gate-basic-xenial-ocata in this commit.

Change-Id: I8113e911272ee671026bace9f6e0e8c4ce072e6b
2017-03-01 14:27:35 +00:00
Corey Bryant
1e2647a9b5 Enable minimal cells v2 support
A minimal cells v2 setup is required in Ocata, which includes the
following databases:
 1. An API database (named nova_api)
 2. A special cell0 database (named cell0)
 3. A "cell1" database (named nova - we're using the nova db as cell1)

The order of nova-manage commands is also updated in this commit.
The 'nova-manage api_db sync' must occur first because 'nova-manage
cell_v2' commands use the API database. 'nova-manage db sync' must
then be run after the 'nova-manage cell_v2' commands.

Finally, 'nova-manage cell_v2 discover_hosts' must be run whenever a
new compute node is introduced to add the host to cell1.

This commit includes a sync of charm-helpers to pick up AMQPContext
updates for transport_url.

Change-Id: Ia6f36ca8a360dc8490e9f41b62d499fa4d73d0b9
2017-02-16 18:23:21 +00:00
Corey Bryant
2564cf5a5f Enable nova-placement-api
This change installs the nova-placement-api, runs it under
mod_wsgi with apache2, updates nova.conf accordingly, and
registers its endpoints.

Change-Id: I4af4afa591cf68964e6146ca0ca0c51d1ddb8a64
2017-02-09 21:30:13 +00:00
Frode Nordahl
2eef644a5c Revert "Update policy.json to give service role access"
This reverts commit ec2579a8448281cdf1154018c0a56c9d4b174e36.

We are not quite ready for fine grained RBAC for service
accounts.

Change-Id: I210685d7b9036abb191073d512f8a65ebff30613
Closes-Bug: 1655028
2017-01-11 15:33:11 +01:00
Felipe Reyes
020e22eeae Allow to use any repository in openstack-origin to upgrade
do_openstack_upgrade() assumes that a cloud archive repository
will be used to upgrade the unit, this is not true for environments
where a mirror is used or a PPA.

Change-Id: I96a20e926f42dc5df4ddb3cb7ac5428b882711e8
Closes-Bug: #1646884
2016-12-14 16:18:26 -03:00
Liam Young
dfd8208354 Enable Memcache service for Token Caching
With the release of 4.2.0 of keystonemiddleware using the
in-process token cache is no longer recommended. It is recommended
that a memcache backend to store tokens is used instead,

This installs and configures memcache and configures neutron-server
to use memcache for token caching.

http://docs.openstack.org/releasenotes/keystonemiddleware/mitaka.html#id2

Change-Id: I747d107d28474d545e4a3612a927d46cae34e6b6
2016-12-13 09:31:19 +00:00
Frode Nordahl
ec2579a844 Update policy.json to give service role access
Role check is scoped to the configured service project and access
is granted to os_compute_api:servers:detail:get_all_tenants.

This change is required to allow Ceilometer to operate using a
non-Admin user.

Change-Id: I17729e2089cc658588eaea93f8de5051369e5dff
Closes-Bug: 1636098
2016-11-29 08:41:49 +01:00
James Page
366398e0b3 Guard return value from get_hostname
It's possible that the get_hostname call use when resolving the
full hostname of a IP address may return None in the event that
a hostname cannot be resolved via DNS.

Ensure that None values are not added to the list of hostnames
to validated for SSH key configuration.

Change-Id: I910224f9c22b7e0b8e53faddc64e3715389cc691
Closes-Bug: 1641614
2016-11-14 14:25:52 +00:00
Jenkins
7fe23b9dc3 Merge "Test resolvability of short names" 2016-11-10 15:48:54 +00:00
David Ames
d5d2e5064e Test resolvability of short names
There is no guarantee short hostnames will be DNS resolvable. Test
first before adding to the compute hosts list.

Change-Id: Ieddf098f97ebdfdf9074016998308e2887532d25
2016-11-07 15:16:37 -08:00
Jenkins
e8cb556926 Merge "Add support for serial console proxy access" 2016-09-27 13:04:26 +00:00
James Page
58bf5b0628 Add support for application version
Juju 2.0 provides support for display of the version of
an application deployed by a charm in juju status.

Insert the os_application_version_set function into the
existing assess_status function - this gets called after
all hook executions, and periodically after that, so any
changes in package versions due to normal system updates
will also be reflected in the status output.

This review also includes a resync of charm-helpers to
pickup hookenv and contrib.openstack support for this
feature.

Change-Id: I8c1d6b9b6d42bcc357d764ec1bd04a36e9982f57
2016-09-20 12:35:19 +01:00
Corey Bryant
88f2b0a648 Set install hook status when deploying from source
Change-Id: I8e576112b128fb307cb0b14dce61063fc4ac7559
2016-09-19 12:09:37 +00:00
James Page
469ef8dced Add support for serial console proxy access
Support access to instances via optionally enabled serial console
feature provided in Nova.

Seria console access is enabled using a new config flag; this flag
plus the required base_url for the nova-serialproxy are also passed
over the cloud-compute relation for use in nova-compute units.

This is only supported in OpenStack Juno or later, and replaces
the standard output to the nova console-log.

Change-Id: I3bfcca88bd6147be337e6d770db7348170b914e6
2016-09-15 12:37:33 +01:00
Felipe Reyes
68b0afed6d Add disable-aws-compat config to disable AWS compatibility layer
For OpenStack >= Liberty EC2 and objectstore services aren't installed and
deprecated, but there is no way to disable it, this patch adds a way to
permanently disable and enable them

Change-Id: Ie78ba5af1d953e8ebed9195202522ff73efcde9f
Closes-Bug: #1533255
2016-09-12 05:46:43 +00:00
Corey Bryant
a946731d24 Use os_release() to determine OpenStack release
Use os_release() instead of get_os_codename_install_source() to
determine the OpenStack release in resolve_services(). This is
needed when deploying from source because it checks both
openstack-origin and openstack-origin-git when determining the
release.

Change-Id: I39a61fc4394967bd70af493f6a69fe9d428274b1
2016-08-10 15:31:18 +00:00
Corey Bryant
01148cc7a9 Add systemd init support for deploy from source
systemd is used instead of upstart by default since Ubuntu 15.10
(Wily).  This adds systemd init file support for nova services
that are deployed from source.

Change-Id: Ie71aed8c1f28204d5fbd735d51cea6d77977a637
2016-07-07 11:05:45 +01:00
James Page
c103450dbb Re-license charm as Apache-2.0
All contributors to this charm have agreed to the switch
from GPL v3 to Apache 2.0; switch to Apache-2.0 license
as agreed so we can move forward with official project status.

Change-Id: I20448e0370138e103a00c7fcf0f49949c82d33a9
2016-07-03 16:38:27 +00:00
Corey Bryant
18e19ef50e Add defaults for openstack-origin-git config option
openstack-origin-git currently only supports YAML that specifies
the git repositories to deploy from.

This adds support for default openstack-origin-git values. The
default values supported are: icehouse, kilo, liberty, mitaka,
and master.  For example: openstack-origin-git=master

Change-Id: I6b737272deed067c2f71dbd36b201aea884265ee
2016-06-20 08:37:43 -04:00
Jenkins
a7ec1588b7 Merge "Fix for status-set race - related to bug 1588462" 2016-06-14 19:21:37 +00:00
Liam Young
05bd039a4e Run flavor migrate on upgrades.
Force upgrades to Liberty to step through Kilo and force Kilo upgrades to
migrate flavor information. The flavor migration needs to be run with a
Kilo tool set as the flavor migration option appears to have been removed
in Liberty . The charm now run the flavor migration if the current
deployment is Kilo and the user is migrating to a higher release.

When an instance is created on Icehouse the flavour ID is stored in a table
called instance_system_metadata. Kilo (or maybe Juno) creates a new table
in the nova database called instance_extra. For new instances created after
upgrading to Kilo the flavour information goes into the instance_extra
table not instance_system_metadata. It is a prerequisite for upgrading to
Liberty that this flavour data has been moved from instance_system_metadata
to instance_extra. At upgrade at this point will fail because the instance
created when the system was on Icehouse has its flavour information in the
wrong place.

Change-Id: If486372b05d165bd17fa9466b435f22088532d89
Closes-Bug: #1580698
2016-06-14 13:33:22 +00:00
David Ames
b570e36cba Fix for status-set race - related to bug 1588462
This change fixes the obvious race for a status_set() between
check_optional_interfaces() and assess_status() as the later calls the former
which calls status_set(), returns the status, which is then potentially set
again by the assess_status() function.  This cleans up the code so that only a
single status_set() is performed when calling assess_status().

Change-Id: Ie37a4d98de9c5e7bd26304e096796ce6287ea52b
Related-Bug:#1588462
2016-06-13 16:06:17 -07:00
James Page
dee3e41231 Restore relation with neutron-api service
A previous commit removed the use of the NeutronAPIContext with
the nova.conf template; restore this context to ensure that
a) the relation is detected when assessing status and b) that
neutron-api relation data is avaliable to the nova.conf template.

Change-Id: Id55800095b9a2d0a5807288ff5f67d71755f9948
2016-04-11 12:02:57 +01:00
James Page
c2bc02e3ab Drop support for Neutron functionality
Neutron functionality was deprecated last release; remove
direct support for managing the neutron-server process and
associated plugin support from this charm.

All neutron-server support is now provided by the neutron-api
charm.

Change-Id: Iec7bd5ec6d835b573a15f8163fa5f78842bd672b
2016-04-08 11:46:52 +01:00
Edward Hope-Morley
24514dcd5b Support using internal network for clients
Openstack mostly defaults to using public endpoints for
internal communication between services. This patch adds
a new option use-internal-endpoints which, if set to True,
will configure services to use internal endpoints where
possible.

Closes-Bug: 1456876
Change-Id: I0f13fa1ab66864859d3adb37e5ec64bd95d7025d
2016-04-01 12:40:06 +01:00
Liam Young
bb9ef8b039 Add pause/resume actions and sync charm-helpers
Adds pause and resume unit to the charm such that the
charm stays paused during maintenance operations.

Change-Id: Ia422aa4077fbdd8cdb0353306c14f5633e2affb8
Partial-Bug: 1558642
2016-03-23 15:41:30 +00:00
James Page
6e8dcf8af8 Drop support for OpenStack releases < Icehouse
Rollup all old configuration file templates, remove any related
to Quantum which was renamed in the Havana release.

Drop references in code to Quantum, refactor unit tests to baseline
on Icehouse rather than anything older.

Drop relation and associated references to nova-volume service;
deprecated in Folsom and removed in Havana.

Drop ml2 migration - this was required when migrating to Icehouse
from older releases.

Change-Id: I6f5d641ffef2599d0dfc8e16a2dce3cc7be88bd4
2016-03-23 12:40:37 +00:00
James Page
90f376453b Add nova-api database setup for Mitaka
Mitaka requires the use of a separate nova-api database;
ensure that this is setup on the shared-db relation and add
a new [api_database] section to the mitaka nova.conf file.

Add a new NovaAPISharedDBContext wrapper to prefix the key
names for the nova-api database with 'nova_api_' so that we
can present two database connections to the same configuration
file.

Ensure that 'nova-manage api_db sync' is called for database
setup for >= mitaka release.

For upgrades, ensure that the database migration and service
start is deferred until the nova_api database has been
setup by the related mysql service.

Closes-Bug: #1556896

Change-Id: If1c9a037b1e0745a486a57fddf885e26aa7e313d
2016-03-18 12:28:57 +00:00
Liam Young
e394d07e66 [gandelman-a, r=gnuoy]
Advertise Nova API readiness

    Adds a new relation 'nova-api' that can be used by services that consume
    the nova api in some way or another. We use it to simply pass a flag to
    remote services that states whether the API service is ready to be used,
    based on the complete context of required interfaces.
2016-02-22 12:03:52 +00:00
James Page
ee3afc15a8 Fixup lint and test failures 2016-02-09 11:38:46 +00:00
James Page
96082675e3 Fixup 2016-02-09 11:24:48 +00:00
James Page
df8816d07c Use pop 2016-02-09 11:23:41 +00:00
James Page
374a284b20 Initial stab at xenial support 2016-02-09 11:19:34 +00:00
Adam Gandelman
962790239b Advertise Nova API readiness
Adds a new relation 'nova-api' that can be used by services that consume
the nova api in some way or another. We use it to simply pass a flag to
remote services that states whether the API service is ready to be used,
based on the complete context of required interfaces.
2016-02-03 11:38:43 -08:00
Edward Hope-Morley
8c875c4009 [hopem,r=]
Fix upgrade breakage whereby if upgrading from
version of charm that did not support
dbsync_state peer setting db ops get stuck
waiting infinitely for db to be intialised.

Closes-Bug: 1519035
2016-01-08 12:30:31 +00:00
James Page
383fcceb10 Add unit status support 2015-10-08 17:19:14 -07:00
Liam Young
8e85f1e272 Add workload status 2015-10-07 09:32:28 +00:00
Liam Young
2d405cc744 Updated after mp review from hopem 2015-10-06 16:47:35 +01:00
Liam Young
5aa0f7b1e4 Fix type in length check. If all is well the cmd should return two lines 2015-10-06 13:17:05 +01:00
Liam Young
5ac25bf361 Process empty output from ssh-keygen safely incase charm is running on precise 2015-10-06 08:37:21 +00:00
Christopher Glass
ca94f0699d Enable rate-limiting for the API. 2015-10-02 14:05:06 +02:00
Edward Hope-Morley
d0f0aa0f15 [hopem,r=gnuoy]
No more trusty-backports for haproxy >= Liberty

Closes-Bug: 1499435
2015-09-25 18:20:51 +01:00
Edward Hope-Morley
0bc90edd3c [hopem,r=]
No more trusty-backports for haproxy >= Liberty

Closes-Bug: 1499435
2015-09-24 17:32:02 +01:00
James Page
7fae6a199c [thedac,r=james-page] Add support for action managed openstack upgrades.
Also fix misc assert_called problems in unit tests.
2015-09-24 17:29:26 +01:00
David Ames
468f3ae945 Action managed upgrades 2015-09-21 16:06:54 -07:00