Merge lp:~cbjchen/charms/trusty/nova-cloud-controller/my_ip_setting into lp:~openstack-charmers-archive/charms/trusty/nova-cloud-controller/next

Proposed by Liang Chen
Status: Merged
Approved by: Edward Hope-Morley
Approved revision: 126
Merged at revision: 125
Proposed branch: lp:~cbjchen/charms/trusty/nova-cloud-controller/my_ip_setting
Merge into: lp:~openstack-charmers-archive/charms/trusty/nova-cloud-controller/next
Diff against target: 72 lines (+12/-3)
4 files modified
hooks/nova_cc_context.py (+9/-1)
templates/havana/nova.conf (+1/-0)
templates/icehouse/nova.conf (+1/-1)
tests/basic_deployment.py (+1/-1)
To merge this branch: bzr merge lp:~cbjchen/charms/trusty/nova-cloud-controller/my_ip_setting
Reviewer Review Type Date Requested Status
Edward Hope-Morley Approve
Review via email: mp+243440@code.launchpad.net

Description of the change

my_ip may be used by other hosts like a callback. It needs to be set to a ip address that can reach
to the nova-cc node from other hosts. This patch will try to use the internal-network address if
applicable, or otherwise the private-address. vip is also considered.

To post a comment you must log in.
Revision history for this message
uosci-testing-bot (uosci-testing-bot) wrote :

UOSCI bot says:
charm_lint_check #1307 nova-cloud-controller-next for cbjchen mp243440
    LINT OK: passed

LINT Results (max last 5 lines):
  I: config.yaml: option os-admin-network has no default value
  I: config.yaml: option haproxy-client-timeout has no default value
  I: config.yaml: option ssl_cert has no default value
  I: config.yaml: option nvp-l3-uuid has no default value
  I: config.yaml: option os-internal-network has no default value

Full lint test output: http://paste.ubuntu.com/9351208/
Build: http://10.98.191.181:8080/job/charm_lint_check/1307/

Revision history for this message
uosci-testing-bot (uosci-testing-bot) wrote :

UOSCI bot says:
charm_unit_test #1141 nova-cloud-controller-next for cbjchen mp243440
    UNIT OK: passed

UNIT Results (max last 5 lines):
  hooks/nova_cc_hooks 442 145 67% 132-135, 148-149, 173, 184-185, 189, 221, 226-231, 242, 322-325, 333-336, 342-345, 355-371, 380-382, 392-406, 410-419, 505, 515, 519-520, 573, 579-589, 594-605, 615-625, 630-669, 679-694, 702-706, 731-740, 764, 769-777, 803, 853-856
  hooks/nova_cc_utils 445 112 75% 296-301, 312-315, 325-326, 382, 384, 430-432, 436, 450-458, 465-470, 474-488, 544, 593-595, 600-603, 608, 612, 636-637, 651-653, 674-675, 681-704, 708-714, 718-724, 730, 736, 743, 754-758, 843, 903-909, 913-915, 919-922, 926-938
  TOTAL 1040 367 65%
  Ran 96 tests in 9.180s
  OK

Full unit test output: http://paste.ubuntu.com/9351211/
Build: http://10.98.191.181:8080/job/charm_unit_test/1141/

Revision history for this message
uosci-testing-bot (uosci-testing-bot) wrote :

UOSCI bot says:
charm_amulet_test #573 nova-cloud-controller-next for cbjchen mp243440
    AMULET FAIL: amulet-test failed

AMULET Results (max last 5 lines):
  juju-test.conductor DEBUG : Calling "juju destroy-environment -y osci-sv01"
  WARNING cannot delete security group "juju-osci-sv01-0". Used by another environment?
  juju-test INFO : Results: 2 passed, 1 failed, 0 errored
  ERROR subprocess encountered error code 1
  make: *** [test] Error 1

Full amulet test output: http://paste.ubuntu.com/9351364/
Build: http://10.98.191.181:8080/job/charm_amulet_test/573/

Revision history for this message
Edward Hope-Morley (hopem) wrote :

lgtm, approved. Thanks for fixing liang.

review: Approve
Revision history for this message
Edward Hope-Morley (hopem) wrote :

Actually , just spotted an issue. See inline.

review: Needs Fixing
126. By Liang Chen <email address hidden>

set my_ip to an address reachable from outside

[cbjchen,r=]
my_ip can be used by other hosts like a callback.
It needs to be set to a ip address that can reach
to the nova-cc node from other hosts. This patch
will try to use the internal-network address if
applicable, or otherwise the private-address.

Revision history for this message
Liang Chen (cbjchen) wrote :

updated. Thanks for spotting it out!

Revision history for this message
Edward Hope-Morley (hopem) wrote :

Thanks liang. lgtm, approved.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'hooks/nova_cc_context.py'
2--- hooks/nova_cc_context.py 2014-10-13 16:18:58 +0000
3+++ hooks/nova_cc_context.py 2014-12-03 23:32:15 +0000
4@@ -13,7 +13,13 @@
5 )
6
7 from charmhelpers.contrib.network.ip import (
8- get_ipv6_addr
9+ get_ipv6_addr,
10+ format_ipv6_addr
11+)
12+
13+from charmhelpers.contrib.openstack.ip import (
14+ resolve_address,
15+ INTERNAL,
16 )
17
18
19@@ -273,6 +279,8 @@
20 ctxt = super(NovaConfigContext, self).__call__()
21 ctxt['cpu_allocation_ratio'] = config('cpu-allocation-ratio')
22 ctxt['ram_allocation_ratio'] = config('ram-allocation-ratio')
23+ addr = resolve_address(INTERNAL)
24+ ctxt['host_ip'] = format_ipv6_addr(addr) or addr
25 return ctxt
26
27
28
29=== modified file 'templates/havana/nova.conf'
30--- templates/havana/nova.conf 2014-08-08 09:31:32 +0000
31+++ templates/havana/nova.conf 2014-12-03 23:32:15 +0000
32@@ -25,6 +25,7 @@
33 scheduler_default_filters = RetryFilter,AvailabilityZoneFilter,CoreFilter,RamFilter,ComputeFilter,ComputeCapabilitiesFilter,ImagePropertiesFilter,ServerGroupAntiAffinityFilter,ServerGroupAffinityFilter
34 cpu_allocation_ratio = {{ cpu_allocation_ratio }}
35 use_syslog={{ use_syslog }}
36+my_ip = {{ host_ip }}
37
38 {% if keystone_ec2_url -%}
39 keystone_ec2_url = {{ keystone_ec2_url }}
40
41=== modified file 'templates/icehouse/nova.conf'
42--- templates/icehouse/nova.conf 2014-10-07 11:37:20 +0000
43+++ templates/icehouse/nova.conf 2014-12-03 23:32:15 +0000
44@@ -24,7 +24,6 @@
45 compute_driver=libvirt.LibvirtDriver
46 use_ipv6 = {{ use_ipv6 }}
47 osapi_compute_listen = {{ bind_host }}
48-my_ip = {{ bind_host }}
49 metadata_host = {{ bind_host }}
50 s3_listen = {{ bind_host }}
51 ec2_listen = {{ bind_host }}
52@@ -37,6 +36,7 @@
53 ram_allocation_ratio = {{ ram_allocation_ratio }}
54
55 use_syslog={{ use_syslog }}
56+my_ip = {{ host_ip }}
57
58 {% if keystone_ec2_url -%}
59 keystone_ec2_url = {{ keystone_ec2_url }}
60
61=== modified file 'tests/basic_deployment.py'
62--- tests/basic_deployment.py 2014-10-14 15:17:57 +0000
63+++ tests/basic_deployment.py 2014-12-03 23:32:15 +0000
64@@ -19,7 +19,7 @@
65 class NovaCCBasicDeployment(OpenStackAmuletDeployment):
66 """Amulet tests on a basic nova cloud controller deployment."""
67
68- def __init__(self, series=None, openstack=None, source=None, stable=False):
69+ def __init__(self, series=None, openstack=None, source=None, stable=True):
70 """Deploy the entire test environment."""
71 super(NovaCCBasicDeployment, self).__init__(series, openstack, source, stable)
72 self._add_services()

Subscribers

People subscribed via source and target branches