55
47
self.d.add('rabbitmq-server', charm='cs:trusty/rabbitmq-server',
56
48
units=1, series=self.series)
57
49
self.d.add('cassandra', charm='cassandra', units=1,
58
branch='cs:trusty/cassandra', series=self.series)
50
branch='lp:charms/cassandra', series=self.series)
59
51
self.d.add('keystone', charm='keystone', units=1, series=self.series,
60
branch='cs:trusty/keystone')
61
self.d.add('compute', charm='nova-compute', units=1,
62
branch='cs:trusty/nova-compute', series=self.series,
63
constraints={'mem': '8G'})
64
self.d.add('neutron', charm='neutron-api', units=1,
65
branch='lp:~celebdor/charms/trusty/neutron-api/liberty',
67
self.d.add('nova', charm='nova-cloud-controller',
68
units=1, series=self.series)
69
self.d.add('glance', charm='glance',
70
branch='cs:trusty/glance',
71
units=1, series=self.series)
72
self.d.add('cinder', charm='cinder',
73
branch='cs:trusty/glance',
52
branch='lp:~celebdor/charms/trusty/keystone/trunk')
53
self.d.add('nova-compute', charm='nova-compute', units=1,
54
branch='lp:~celebdor/charms/trusty/nova-compute/trunk',
56
self.d.add('neutron-api', charm='neutron-api', units=1,
57
branch='lp:~celebdor/charms/trusty/neutron-api/trunk',
59
self.d.add('nova-cloud-controller', charm='nova-cloud-controller',
60
branch='lp:~celebdor/charms/trusty/nova-cloud-controller/trunk',
74
61
units=1, series=self.series)
75
62
self.d.add('zookeeper', charm='cs:trusty/zookeeper', units=1,
76
63
series=self.series)
80
67
self.d.add('midonet-agent', charm='midonet-agent', units=1,
81
68
branch='lp:~celebdor/charms/trusty/midonet-agent/trunk',
82
69
series=self.series)
83
self.d.add('neutron-agents-midonet', constraints={'mem': '4G'})
70
self.d.add('neutron-agents-midonet', charm='neutron-agents-midonet',
71
branch='lp:~celebdor/charms/trusty/neutron-agents-midonet/trunk',
85
74
def _add_relations(self):
87
75
self.d.relate('mysql:shared-db', 'keystone:shared-db')
90
self.d.relate('mysql:shared-db', 'nova:shared-db')
91
self.d.relate('keystone:identity-service', 'nova:identity-service')
92
self.d.relate('rabbitmq-server:amqp', 'nova:amqp')
93
self.d.relate('neutron-agents-midonet:neutron_agents',
94
'nova:quantum-network-service')
95
self.d.relate('neutron:neutron-api', 'nova:neutron-api')
96
self.d.relate('compute:cloud-compute', 'nova:cloud-compute')
97
self.d.relate('glance:image-service', 'nova:image-service')
98
self.d.relate('cinder:cinder-volume-service',
99
'nova:cinder-volume-service')
102
self.d.relate('keystone:identity-service', 'cinder:identity-service')
103
self.d.relate('mysql:shared-db', 'cinder:shared-db')
104
self.d.relate('rabbitmq-server:amqp', 'cinder:amqp')
105
self.d.relate('glance:image-service', 'cinder:image-service')
108
self.d.relate('keystone:identity-service', 'glance:identity-service')
109
self.d.relate('mysql:shared-db', 'glance:shared-db')
110
self.d.relate('rabbitmq-server:amqp', 'glance:amqp')
113
self.d.relate('mysql:shared-db', 'neutron:shared-db')
114
self.d.relate('keystone:identity-service', 'neutron:identity-service')
115
self.d.relate('rabbitmq-server:amqp', 'neutron:amqp')
116
self.d.relate('neutron-agents-midonet:neutron-plugin-api',
117
'neutron:neutron-plugin-api')
76
self.d.relate('mysql:shared-db', 'nova-cloud-controller:shared-db')
77
self.d.relate('rabbitmq-server:amqp', 'nova-compute:amqp')
78
self.d.relate('rabbitmq-server:amqp', 'nova-cloud-controller:amqp')
79
self.d.relate('rabbitmq-server:amqp', 'neutron-api:amqp')
80
self.d.relate('nova-cloud-controller:identity-service',
81
'keystone:identity-service')
83
self.d.relate('neutron-api:identity-service',
84
'keystone:identity-service')
85
self.d.relate('nova-compute:cloud-compute',
86
'nova-cloud-controller:cloud-compute')
87
self.d.relate('neutron-api:neutron-api',
88
'nova-cloud-controller:neutron-api')
120
90
self.d.relate('keystone:identity-service', 'midonet-api:keystone')
121
91
self.d.relate('zookeeper:zookeeper', 'midonet-api:zookeeper')
122
92
self.d.relate('midonet-agent:host', 'midonet-api:host')
123
self.d.relate('neutron:midonet', 'midonet-api:midonet-api')
124
self.d.relate('rabbitmq-server:amqp', 'neutron-gents-midonet:amqp')
125
self.d.relate('midonet-agent:host', 'neutron-agents-midonet:agent')
126
self.d.relate('cassandra:database', 'midonet-agent:cassandra')
127
self.d.relate('zookeeper:zookeeper', 'midonet-agent:zookeeper')
128
self.d.relate('midonet-api:midonet-api',
129
'neutron-agents-midonet:midonet')
132
self.d.relate('rabbitmq-server:amqp', 'compute:amqp')
133
self.d.relate('midonet-agent:neutron-plugin', 'compute:neutron-plugin')
134
self.d.relate('glance:image-service', 'compute:image-service')
93
self.d.relate('neutron-api:midonet', 'midonet-api:midonet-api')
95
self.d.relate('neutron-agents-midonet:neutron_agents',
96
'nova-cloud-controller:quantum-network-service')
98
self.d.relate('neutron-agents-midonet:neutron-plugin-api',
99
'neutron-api:neutron-plugin-api')
101
self.d.relate('midonet-agent:neutron-plugin',
102
'nova-compute:neutron-plugin')
104
self.d.relate('midonet-agent:host', 'neutron-api:midonet-host')
105
self.d.relate('midonet-agent:cassandra', 'cassandra:database')
106
self.d.relate('midonet-agent:zookeeper', 'zookeeper:zookeeper')
136
108
def _configure_services(self):
137
repo_config = {'midonet-origin': self.midonet_origin,
138
'openstack-origin': self.os_release}
140
repo_config.update(self.mem_credentials)
142
109
self.d.configure('keystone', {
143
'admin-user': 'admin',
144
'admin-password': 'openstack',
145
'admin-token': 'osttesting',
146
110
'enable-pki': 'false',
147
111
'openstack-origin': self.os_release})
149
self.d.configure('mysql', {
150
'max-connections': 500})
152
113
self.d.configure('cassandra', {
153
'authenticator': 'AllowAllAuthenticator',
154
'cluster_name': 'midonet',
155
'install_keys': '7E41C00F85BFC1706C4FFFB3350200F2B999A372',
114
'allow-single-node': True,
115
'cluster-name': 'midonet',
116
'apt-repo-key': '7E41C00F85BFC1706C4FFFB3350200F2B999A372',
157
118
'deb http://debian.datastax.com/community 2.0 main',
158
'extra_packages': 'dsc20'})
160
self.d.configure('compute', {
119
'extra_packages': 'openjdk-7-jre-headless dsc20'})
121
self.d.configure('mysql', {'max-connections': 2000})
123
self.d.configure('nova-compute', {
161
124
'openstack-origin': self.os_release,
162
125
'virt-type': 'qemu',
163
126
'flat-interface': 'eth0',
164
127
'manage-neutron-plugin-legacy-mode': 'false'})
166
self.d.configure('nova', {
129
self.d.configure('nova-cloud-controller', {
167
130
'openstack-origin': self.os_release,
168
131
'network-manager': 'Neutron',
169
'shared-secret': 'secret'})
132
'shared_secret': 'secret'})
171
self.d.configure('neutron', {
134
self.d.configure('neutron-api', {
172
135
'neutron-plugin': 'midonet',
173
136
'neutron-security-groups': 'True',
174
137
'neutron-external-network': 'Public_Network',
175
138
'l2-population': 'False',
176
139
'openstack-origin': self.os_release,
177
'midonet-origin': self.midonet_origin})
180
self.d.configure('midonet-api', repo_config)
182
neutron_agts_midonet_config = {'shared-secret': 'secret'}
183
neutron_agts_midonet_config.update(repo_config)
184
self.d.configure('neutron-agents-midonet', neutron_agts_midonet_config)
186
self.d.configure('midonet-agent', repo_config)
140
'midonet-release': self.midonet_release})
142
self.d.configure('midonet-api',
143
{'midonet-release': self.midonet_release})
145
self.d.configure('neutron-agents-midonet',
146
{'shared_secret': 'secret'})
148
self.d.configure('midonet-agent',
149
{'midonet-release': self.midonet_release})
188
151
def _deploy(self):
221
184
def test_neutron_agents_mn(self):
222
185
u.log.debug('Checking if the key has been correctly fetched...')
223
apt_key_out, _ = self.mn_agent_sentry.run('apt-key list | '
186
apt_key_out, apt_key_exit = self.mn_agent_sentry.run(
187
'apt-key list | grep Midokura')
225
188
if 'Midokura' not in apt_key_out:
226
amulet.raise_status(amulet.FAIL,
227
msg='Midokura repository key is not installed')
189
message = ("error, Midokura repository key is not installed")
190
amulet.raise_status(amulet.FAIL, msg=message)
229
192
u.log.debug('Checking if midonet-plugin package has been installed...')
230
dpkg_plugin_out, _ = self.agents_mn_sentry.run(
231
'dpkg -l | grep python-neutron-plugin-midonet')
193
dpkg_plugin_out, dpkg_exit = self.agents_mn_sentry.run(
194
('dpkg -l | grep python-neutron-plugin-midonet'))
232
195
if 'python-neutron-plugin-midonet' not in dpkg_plugin_out:
233
amulet.raise_status(amulet.FAIL,
234
msg='python-neutron-plugin-midonet package is '
197
"error: python-neutron-plugin-midonet package is not installed")
198
amulet.raise_status(amulet.FAIL, msg=message)
237
200
u.log.debug('Checking neutron-dhcp-agent...')
238
dhcp_agent_out, _ = self.agents_mn_sentry.run(
239
'service neutron-dhcp-agent status')
201
dhcp_agent_out, dhcp_agent_exit = self.agents_mn_sentry.run(
202
'service neutron-dhcp-agent status')
240
203
if 'running' not in dhcp_agent_out:
241
amulet.raise_status(amulet.FAIL,
242
msg="neutron-dhcp-agent not running: %s" %
205
"error, neutron-dhcp-agent not running: %s" % dhcp_agent_out)
206
amulet.raise_status(amulet.FAIL, msg=message)
245
208
u.log.debug('Checking neutron-metadata-agent...')
246
meta_agent_out, _ = self.agents_mn_sentry.run(
247
'service neutron-metadata-agent status')
209
meta_agent_out, meta_agent_exit = self.agents_mn_sentry.run(
210
'service neutron-metadata-agent status')
248
211
if 'running' not in meta_agent_out:
249
amulet.raise_status(amulet.FAIL,
250
msg="neutron-metadata-agent not running: %s" %
213
"error, neutron-metadata-agent not running: %s" % meta_agent_out)
214
amulet.raise_status(amulet.FAIL, msg=message)