ユーザ用ツール

サイト用ツール


サイドバー

このページの翻訳:



最近の更新



Tag Cloud

01_linux:08_仮想化:juju:01_juju_maas_openstack

文書の過去の版を表示しています。


01 JuJu Maas Openstack

JuJu+MaasでOpenStackをデプロイしてみる。
今回はUbuntuサーバに、KVMをれ入れて下記の5VMを立てて検証してみる。

hostname external internal tag
MAAS 192.168.0.1010.10.0.10
juju-controller DHCP bootstrap
node01 DHCPnode01
node02 DHCPnode02
node03 DHCPnode03
NicPXENetworkDHCP Gateway Space
ens3192.168.0.0/24MAAS-DHCP 192.168.0.254 internal
ens4 10.10.0.0/24No DHCP 10.10.0.254 external

01. Maas Install

Maasとは

Maasとは、Metal-as-a-Serviceでベアメタルを提供するサービス

apt upgrade

$ sudo apt -y update
$ sudo apt -y upgrade

maas install

$ sudo apt install maas

maas init

$ sudo maas init
[sudo] password for matsui:

Note: Configuring the MAAS snap in "all" mode will be
deprecated in MAAS 2.8.0 and removed in 2.9.0.

See https://maas.io/deprecations/MD1 for details.


Mode (all/region+rack/region/rack/none) [default=all]?
MAAS URL [default=http://192.168.0.10:5240/MAAS]:
Create first admin account
Username: admin
Password:
Again:
Email: hoge@hogehoge.com
Import SSH keys [] (lp:user-id or gh:user-id):

UI

これでhttp://192.168.0.10:5240/MAASからUIにアクセスできる。

  • ログイン後、Ubuntu imageで20.04 LTSを選択し、Update selectionをクリック
  • SSH keyをアップロードしておく
  • Subnetsから、192.168.0.0/24ネットワークを選んでDHCPを有効にしておく

02. JuJu

JuJuとは

JujuはCanonical社が提供するプロビジョニングツール
JuJuはMaasに接続して、MaasのMetalサーバを利用し様々なアプリケーションをデプロイする。

juju install

sudo snap install juju --classic

03. jujuにMaas登録

Yaml用意

$ vim mymaas.yaml
clouds:
   maas-server:
      type: maas
      auth-types: [oauth1]
      endpoint: http://192.168.0.10:5240/MAAS

登録

juju add-cloud maas-server mymaas.yaml

MaasのAPIキー登録

$ juju add-credential maas-server
This operation can be applied to both a copy on this client and to the one on a controller.
No current controller was detected and there are no registered controllers on this client: either bootstrap one or register one.
Enter credential name: maas-server-credential

Regions
  default

Select region [any region, credential is not region specific]:

Using auth-type "oauth1".

Enter maas-oauth:

Credential "maas-server-credential" added locally for cloud "maas-server".

APIキーは下記MAASのUIからコピー

credential確認

credentialが見えればOK

$ juju credentials
No credentials from any controller to display.

Client Credentials:
Cloud        Credentials
maas-server  maas-server-credential

MAASの登録確認

matsui@maasvm2:~$ juju clouds
Only clouds with registered credentials are shown.
There are more clouds, use --all to see them.
You can bootstrap a new controller using one of these clouds...

Clouds available on the client:
Cloud        Regions  Default    Type  Credentials  Source    Description
localhost    1        localhost  lxd   0            built-in  LXD Container Hypervisor
maas-server  1        default    maas  1            local     Metal As A Service

juju bootstrapノードデプロイ

juju からの命令を受けて処理するノード

デプロイには結構時間がかかる。

$ juju bootstrap --constraints tags=bootstrap  maas-server maas
Creating Juju controller "maas" on maas-server/default
Looking for packaged Juju agent version 2.9.22 for amd64
Located Juju agent version 2.9.22-ubuntu-amd64 at https://streams.canonical.com/juju/tools/agent/2.9.22/juju-2.9.22-ubuntu-amd64.tgz
Launching controller instance(s) on maas-server/default...
 - 4t8t4s (arch=amd64 mem=16G cores=8) 
Installing Juju agent on bootstrap instance
Fetching Juju Dashboard 0.8.1
Waiting for address
Attempting to connect to 192.168.0.251:22
Connected to 192.168.0.251
Running machine configuration script...
Bootstrap agent now started
Contacting Juju controller at 192.168.0.251 to verify accessibility...

Bootstrap complete, controller "maas" is now available
Controller machines are in the "controller" model
Initial model "default" added

charm install

charmはgit みたいなもの

$ sudo snap install charm --classic
[sudo] password for matsui: 
charm 2.8.2 from Canonical✓ installed

OpenStack base

charm pull openstack-base ~/openstack-base

### charm pull specific version
charm pull openstack-base-73 ~/openstack-base-73
01_linux/08_仮想化/juju/01_juju_maas_openstack.1643936823.txt.gz · 最終更新: 2022/02/04 10:07 by matsui