Use magnum and etcd offline

asked 2018-06-11 09:50:30 -0500

Sideris gravatar image

Hi all,

Today i have a problem. I must build an architecture of Openstack Queens without Internet. I installed basic components (Keystone, glance, nova, neutron, horizon, cinder and heat), all work nicely. Now i want install Magnum, i follow this doc: https://docs.openstack.org/magnum/queens/install/index.html (https://docs.openstack.org/magnum/que...)

The installation work correctly, when i make the verification chapter, when i create the swarm-cluster i have this error:

# openstack coe cluster show swarm-cluster
+---------------------+--------------------------------------------------------------------------+
| Field               | Value                                                                    |
+---------------------+--------------------------------------------------------------------------+
| status              | CREATE_FAILED                                                            |
| cluster_template_id | 6e9946af-40cc-43d4-abd2-616bc14c96cf                                     |
| node_addresses      | []                                                                       |
| uuid                | f86cc9fb-a251-424f-8341-024268ec7ac7                                     |
| stack_id            | None                                                                     |
| status_reason       | Failed to get discovery url from 'https://discovery.etcd.io/new?size=1'. |
| created_at          | 2018-06-11T13:56:58+00:00                                                |
| updated_at          | 2018-06-11T13:57:21+00:00                                                |
| coe_version         | None                                                                     |
| labels              | {}                                                                       |
| faults              | {}                                                                       |
| keypair             | mykey                                                                    |
| api_address         | None                                                                     |
| master_addresses    | []                                                                       |
| create_timeout      | 60                                                                       |
| node_count          | 1                                                                        |
| discovery_url       | None                                                                     |
| master_count        | 1                                                                        |
| container_version   | None                                                                     |
| name                | swarm-cluster                                                            |
| master_flavor_id    | m1.small                                                                 |
| flavor_id           | m1.small                                                                 |
+---------------------+--------------------------------------------------------------------------+

I understand the message, magnum want get something in 'https://discovery.etcd.io/new?size=1' But i must build this without internet. In the doc, i follow etcd configuration chapter, this is configuration file

#cat /etc/etcd/etcd.conf.yml
name: imgesx07
data-dir: /var/lib/etcd
initial-cluster-state: 'new'
initial-cluster-token: 'etcd-cluster-01'
initial-cluster: imgesx07=http://192.168.10.20:2380
initial-advertise-peer-urls: http://192.168.10.20:2380
advertise-client-urls: http://192.169.10.20:2379
listen-peer-urls: http://0.0.0.0:2380
listen-client-urls: http://192.168.10.20:2379

&

#cat /lib/systemd/system/etcd.service
[Unit]
After=network.target
Description=etcd - highly-available key value store

[Service]
LimitNOFILE=65536
Restart=on-failure
Type=notify
ExecStart=/usr/bin/etcd --config-file /etc/etcd/etcd.conf.yml
User=etcd

[Install]
WantedBy=multi-user.target

Do you have an idea to use magnum without internet please? Thank you, Best Regards Nicolas MOREL

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2018-07-05 04:17:49 -0500

Sideris gravatar image

Hi all,

This is my solution : Get 2 images docker: discovery.etcd.io.docker etcd.io.docker

Make a script like this:

#!/bin/bash
# set host ip for etcd, replace your own host IP before run it.
export HostIP="10.26.9.19"

#Lancement d'une session etcd dans un container
docker run -d -v /usr/share/ca-certificates/:/etc/ssl/certs -p 4001:4001 -p 2380:2380 -p 2379:2379 \
 --name etcd quay.io/coreos/etcd \
 etcd \
 -name etcd0 \
 -advertise-client-urls http://${HostIP}:2379,http://${HostIP}:4001 \
 -listen-client-urls http://0.0.0.0:2379,http://0.0.0.0:4001 \
 -initial-advertise-peer-urls http://${HostIP}:2380 \
 -listen-peer-urls http://0.0.0.0:2380 \
 -initial-cluster-token etcd-cluster-1 \
 -initial-cluster etcd0=http://${HostIP}:2380 \
 -initial-cluster-state new

#Lancement dans un container du service discovery
docker run --name discovery -d --net=host quay.io/coreos/discovery.etcd.io

#Test du bon fonctionnement
#Sleep le temps du lancement
sleep 5
curl -v -X PUT localhost:8087/new

And put on discovery url in magnum.conf, your controler name on url.

It's work for me.

edit flag offensive delete link more

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower

Stats

Asked: 2018-06-11 09:50:30 -0500

Seen: 307 times

Last updated: Jul 05 '18