3.3. Conjuring Up OpenStack avec NovaLXD

Installation dans une VM ESXi 32 Go RAM, 16 vCPUs, 128 Go HD, réseau naté

1. Conjuring Up OpenStack avec NovaLXD

2. Préalables

echo "stack ALL=(ALL) NOPASSWD: ALL" | sudo tee /etc/sudoers.d/stack
cat << EOF >> .bashrc
export LANG=en_US.utf-8
export LC_ALL=en_US.utf-8
EOF
exit

3. Installation de lxd

sudo snap install lxd

4. Ajouter de l'utilisateur stack dans le groupe LXD

sudo usermod -a -G lxd stack
newgrp lxd

5. Création d'un pont local

/snap/bin/lxc network create lxdbr0 ipv4.address=auto ipv4.nat=true ipv6.address=none ipv6.nat=false

6. Initialisation de LXD

/snap/bin/lxd init
Would you like to use LXD clustering? (yes/no) [default=no]:
Do you want to configure a new storage pool? (yes/no) [default=yes]:
Name of the new storage pool [default=default]:
Name of the storage backend to use (btrfs, ceph, dir, lvm) [default=btrfs]:
Create a new BTRFS pool? (yes/no) [default=yes]:
Would you like to use an existing block device? (yes/no) [default=no]:
Size in GB of the new loop device (1GB minimum) [default=15GB]: 40GB
Would you like to connect to a MAAS server? (yes/no) [default=no]:
Would you like to create a new local network bridge? (yes/no) [default=yes]:
What should the new bridge be called? [default=lxdbr0]:
What IPv4 address should be used? (CIDR subnet notation, “auto” or “none”) [default=auto]:
What IPv6 address should be used? (CIDR subnet notation, “auto” or “none”) [default=auto]: none
Would you like LXD to be available over the network? (yes/no) [default=no]:
Would you like stale cached images to be updated automatically? (yes/no) [default=yes]
Would you like a YAML "lxd init" preseed to be printed? (yes/no) [default=no]: yes
config: {}
networks:
- config:
    ipv4.address: auto
    ipv6.address: none
  description: ""
  managed: false
  name: lxdbr0
  type: ""
storage_pools:
- config:
    size: 40GB
  description: ""
  name: default
  driver: btrfs
profiles:
- config: {}
  description: ""
  devices:
    eth0:
      name: eth0
      nictype: bridged
      parent: lxdbr0
      type: nic
    root:
      path: /
      pool: default
      type: disk
  name: default
cluster: null

7. Migration de LXD

sudo /snap/bin/lxd.migrate -yes
=> Connecting to source server
=> Connecting to destination server
=> Running sanity checks
The source server is empty, no migration needed.

The migration is now complete and your containers should be back online.

All done. You may need to close your current shell and open a new one to have the "lxc" command work.
To migrate your existing client configuration, move ~/.config/lxc to ~/snap/lxd/current/.config/lxc

8. Installation de conjure-up

sudo snap install conjure-up --classic

9. Lancement de conjure-up

if [ ! -f ~/.ssh/id_rsa.pub ] ; then cat /dev/zero | ssh-keygen -q -N "" > /dev/null ; fi
conjure-up openstack

"Spell Selection: OpenStack with NovaLXD"

OpenStack with NovaLXD
Figure 36 : OpenStack with NovaLXD

"Choose Cloud: localhost"

Choose Cloud: localhost
Figure 37 : Choose Cloud: localhost
Select a network bridge and storage pool for this deployment
Figure 38 : Select a network bridge and storage pool for this deployment
SSH public key path
Figure 39 : SSH public key path

10. Déploiement

Choix d'applications
Figure 40 : Choix d'applications
Juju Controller is initializing. Please wait.
Figure 41 : Juju Controller is initializing. Please wait.
Your deployment is now complete
Figure 42 : Your deployment is now complete
Login to Horizon: http://10.82.189.129/horizon l:           │
                          admin p: openstack domain: admin_domain

11. Exploitation

Installation des outils client OpenStack

sudo snap install openstackclients --classic

Récupération du fichier admin-openrc.sh

Connexion à l'interface Web via transfert de port SSH

Connexion à l'interface Web via transfert de port SSH
Figure 43 : Connexion à l'interface Web via transfert de port SSH
fichier admin-openrc.sh
Figure 44 : fichier admin-openrc.sh

Chargement du profil

. admin-openrc.sh
Please enter your OpenStack Password for project admin as user admin: openstack
openstack service list
+----------------------------------+-----------+--------------+
| ID                               | Name      | Type         |
+----------------------------------+-----------+--------------+
| 2923772c4e3546019c75f2e88e1707a7 | glance    | image        |
| 3019e6db3c854a8480c5f339075d78ce | swift     | object-store |
| 559b1365174e4f3b889df6d8724f13e1 | cinderv3  | volumev3     |
| 58fe9822f65644a0a0de0598b44a0623 | nova      | compute      |
| 96f6c39480f74e60a345271029b6d993 | keystone  | identity     |
| a06adea5bfcf4660ac61de36f1090807 | placement | placement    |
| a4eb7872d73f46a093cb3fe360b7ff8e | neutron   | network      |
| a5ca8978daeb4f21b0dda9a9c5840b1c | cinderv2  | volumev2     |
+----------------------------------+-----------+--------------+
openstack compute service list
+----+----------------+----------------+----------+---------+-------+----------------------------+
| ID | Binary         | Host           | Zone     | Status  | State | Updated At                 |
+----+----------------+----------------+----------+---------+-------+----------------------------+
|  4 | nova-conductor | juju-10a5e3-13 | internal | enabled | up    | 2019-03-10T11:25:54.000000 |
|  6 | nova-scheduler | juju-10a5e3-13 | internal | enabled | up    | 2019-03-10T11:25:54.000000 |
| 11 | nova-compute   | juju-10a5e3-14 | nova     | enabled | up    | 2019-03-10T11:25:55.000000 |
+----+----------------+----------------+----------+---------+-------+----------------------------+