294 Commits

Author SHA1 Message Date
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
David Ames
324ea4f4ae Network space aware address for cluster relation
Use the get_relation_ip function for selecting addresses for the
cluster relationship. Including overrides for the admin, internal,
and public config settings or extra bindings.

Partial-Bug: #1687439

Change-Id: I0ca3ac8ebe44ccfff7a1440a77bbc51367103cb9
2017-05-05 10:30:52 -07:00
Jenkins
b03380aab2 Merge "Enable network spaces for the memcache relation" 2017-05-04 16:49:31 +00: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
Alex Kavanagh
3ffd566f55 Enable network spaces for the memcache relation
This enables network spaces for the memcache relation.  Essentially,
the charm tries to use the binding for the memcache, and if that doesn't
work falls back to the private address.

Change-Id: I831c4df22a698709fc0fa42ccea74f10b64a469b
2017-04-26 21:13:46 +01:00
David Ames
e94f7882cb Avoid shared-db change when using access-network
When the percona-cluster charm sets an access-network but the default
unit-get address is not on that network extra shared-db relations get
executed. This is specifically a problem when running upgrades and
trying to avoid API downtime.

The root cause is that the access-network is not checked until the
SharedDBContext is consulted. But then db_joined function will
change it back to the wrong ip on subsequent runs.

This change adds a check for access-network on the relation during the
db_joined function and pushes IP selection off to get_relation_ip.

Charm helpers sync to pull in changes to get_relation_ip.

Partial-bug: #1677647
Change-Id: Ifd4e975d9abbb9f7a8b0f12c8f0a8cf8f78595b6
2017-04-25 14:32:19 -07:00
Corey Bryant
e8539fe8fd Move add_hosts_to_cell earlier in compute_changed
The cloud-compute-relation-changed hook returns early in some
cases, such as when migration-auth-type is not set. Move the
add_hosts_to_cell call earlier in the hook so that it always
has a chance to be called when a compute host is added. This
also fixes the broken indentation.

Change-Id: I32df10286f34801acafc59017710c2fcbe58b29e
2017-02-17 19:11:36 +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
James Page
ad6fbd48db Ensure configuration changes propagated fully
nova-cloud-controller provides its region setting to the nova
services hosted in neutron-gateway units; ensure that any changes
to configuration are correctly propagated to related units.

Change-Id: Iea002d4379339abf64742409e36d237b163420c5
Closes-Bug: 1513411
2017-02-02 12:42:07 +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
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
James Page
928644532b Restart neutron-gateway services on amqp complete
The nova-api-metadata service which runs in the neutron-gateway
charm units will shutdown if it does not receive a response from
a nova-conductor within a short timeout period; this can happen
if the nova-conductor is not yet wired to the messaging bus.

Trigger a remote restart using the existing relation api when
the amqp relation is complete, and nova-conductor services should
be (shortly) up and running.

Change-Id: I47d242a6e4a11d30400b9b787ace752a472b2d1e
Closes-Bug: 1547122
2016-06-28 16:48:01 +01:00
David Ames
eba53c3d55 DNS HA
Implement DNS high availability. Pass the correct information to
hacluster to register a DNS entry with MAAS 2.0 or greater rather
than using a virtual IP.

Charm-helpers sync to bring in DNS HA helpers

Change-Id: I073770d3900b4948c4cceb440f90407128558c8f
2016-06-23 09:19:06 +01: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
4c68802ade Trigger restarts for nova-api-metadata
The neutron-gateway charm operates a nova-api-metadata service
for instance access to Nova metadata; this needs to be restarted
after a database initialization as if the conductors are not
responding, this service will shut itself down.

Set a remote_restart nonce on the quantum-network-service
relation post database migration to trigger remote restarts.

Change-Id: I469d4119dd95cc51378d7ca2e3ef736d94c12226
Closes-Bug: 1547122
2016-04-14 09:28:36 +01:00
James Page
547bc88a70 Use network space binding for shared-db relation
To ensure that the charm presents the right IP address for
accessing the MySQL database over the shared-db relation,
ensure that any network space binding provided by the user
is preferred over the default of 'private-address'.

If network spaces is not supported (juju < 2.0), fallback to
using 'private-address'.

Change-Id: If91dd8e9a4f47c5455095532ed27433eaf0d47d4
2016-04-12 15:12:03 +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
4b98e30307 Add hardening support
Add charmhelpers.contrib.hardening and calls to install,
config-changed, upgrade-charm and update-status hooks.
Also add new config option to allow one or more hardening
modules to be applied at runtime.

Change-Id: Icf48829e010d35d7d7a4ccd547eae6a8c511c04e
2016-03-31 19:30:33 +01:00
Jenkins
25c7a5968e Merge "Add Liberty template with keystone v3 support" 2016-03-30 08:37:29 +00:00
Liam Young
0e58516b13 Add Liberty template with keystone v3 support
This change adds a template for liberty or above that works with a keystone
v3 endpoint. It also removes the Mitaka template as it duplicated the liberty
one.

Change-Id: Ic0bd24c8516b541c44dac9c8a92357050e75fcf6
Partial-Bug: 1522397
2016-03-29 08:20:24 +00: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
billy.olsen@canonical.com
8808bf9302 Update code with feedback from code review:
1. Rebase
2. Update the new mitaka/nova.conf template
3. Add related_unit call to get the units
2016-02-17 10:24:59 -07:00
billy.olsen@canonical.com
b492f1a79e Merge with trunk. 2016-02-17 09:35:07 -07:00
billy.olsen@canonical.com
40e3a51461 [jamespage, r=billy-olsen,thedac] Drop ec2 and objectstore checks from restart
tests for liberty or greater.

Closes-Bug: #1537155
Closes-Bug: #1546261
2016-02-16 14:52:04 -07:00
billy.olsen@canonical.com
19df3b6430 [billy-olsen,r=] Add region information to the conf files, relations.
This change adds the appropriate region information to the conf files
and to the cloud-compute relations in order to ensure that the region
can be configured on all nova components.

Closes-Bug: #1468306
2016-02-12 10:38:21 -07:00
David Ames
5c4050e94f Fixes lp bug#1524448. Do not run neutron-server if >= juno 2016-02-11 07:49:38 -08:00
James Page
ee3afc15a8 Fixup lint and test failures 2016-02-09 11:38:46 +00:00
Adam Gandelman
0b55954f77 Remove duplicate hook trigger 2016-02-04 10:24:06 -08: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
8defefbe7c more 2016-01-08 13:46:56 +00: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
Subbarayudu Mukkamala
1525f2129b Merge from lp:~openstack-charmers/charms/trusty/.../next/ 2015-10-27 07:51:11 -07:00
Liam Young
7cafeecb03 Use new format for workload status 2015-10-08 14:31:01 +01:00
Liam Young
8e85f1e272 Add workload status 2015-10-07 09:32:28 +00: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
James Page
f26a5ab508 Ensure python2 is installed before hook execution 2015-09-22 14:52:12 +01:00
David Ames
468f3ae945 Action managed upgrades 2015-09-21 16:06:54 -07:00
Nobuto Murata
880d21af41 fix catch error of "No such file or directory" with python2, LP: #1484605 2015-08-25 22:42:14 +09:00
Subbarayudu Mukkamala
945fceafd2 fix lint errors 2015-08-21 05:05:24 -07:00
Subbarayudu Mukkamala
2fcaeea48c Merge from lp:~openstack-charmers/.../next 2015-07-26 19:42:39 -07:00
Edward Hope-Morley
c95bd4e655 [xianghu,r=hopem]
Add Console SSL support. This allows SSL to be used for
instance console sessions independently of whether SSL
is used for the Nova API endpoint.

Closes-Bug: 1476455
2015-07-24 13:29:29 +01:00
Hui Xiang
d61aa28daf Fix comments. 2015-07-22 20:01:24 +08:00
Hui Xiang
7267a2c30e Fix more 2015-07-22 13:33:03 +08:00
Subbarayudu Mukkamala
034334db30 Fix log stmt within an else block 2015-06-18 11:24:16 -07:00
Edward Hope-Morley
c49974a91a [hopem,r=]
Ensure packages not upgraded unexpectedly.

Closes-Bug: 1464605
2015-06-12 14:03:50 +01:00