Install maas

https://maas.io/

os install

install ubuntu 20.04 LTS with CD

sudo apt update -y
sudo apt upgrade -y
sudo apt dist-upgrade -y

ipmi ์„ค์ •

sudo apt install ipmitool -y
ip=10.1.4.11
sudo ipmitool lan set 1 ipsrc static
sudo ipmitool lan set 1 ipaddr ${ip}
sudo ipmitool lan set 1 netmask 255.255.255.0
sudo ipmitool lan set 1 defgw ipaddr 10.1.4.1
sudo ipmitool lan set 1 arp respond on

ip setting

sudo vi /etc/netplan/00-installer-config.yaml
network:
  ethernets:
    eno1:
      addresses:
        - 10.1.5.11/24
      gateway4: 10.1.5.1
      nameservers:
        addresses:
          - 4.2.2.2
        search: []
    eno2:
      dhcp4: true
  version: 2
sudo netplan apply
ifconfig #ํ™•์ธ

snap and postgresql install

sudo snap install --channel=3.0/stable maas
sudo apt install -y postgresql

MAAS_DBUSER=XXXXXXX
MAAS_DBPASS=XXXXXXX
MAAS_DBNAME=maas

sudo -u postgres psql -c "CREATE USER \"$MAAS_DBUSER\" WITH ENCRYPTED PASSWORD '$MAAS_DBPASS'"

sudo -u postgres createdb -O "$MAAS_DBUSER" "$MAAS_DBNAME"
sudo vi /etc/postgresql/12/main/pg_hba.conf
# host    $MAAS_DBNAME    $MAAS_DBUSER    0/0     md5
host      maas            XXXX           0/0     md5
sudo maas init region+rack --database-uri "postgres://$MAAS_DBUSER:$MAAS_DBPASS@localhost/$MAAS_DBNAME"

#sudo maas init region+rack --database-uri "postgres://$MAAS_DBUSER:$MAAS_DBPASS@$HOSTNAME/$MAAS_DBNAME"
MASS URL : (just enter)

๊ฒฐ๊ณผ

MAAS URL [default=http://10.1.5.11:5240/MAAS]:
MAAS has been set up.

If you want to configure external authentication or use
MAAS with Canonical RBAC, please run

  sudo maas configauth

To create admins when not using external authentication, run

  sudo maas createadmin
sudo maas status

> bind9                            RUNNING   pid 8142, uptime 0:02:21
> dhcpd                            STOPPED   Not started
> dhcpd6                           STOPPED   Not started
> http                             RUNNING   pid 8411, uptime 0:00:46
> ntp                              RUNNING   pid 8327, uptime 0:00:51
> proxy                            RUNNING   pid 8486, uptime 0:00:39
> rackd                            RUNNING   pid 8145, uptime 0:02:21
> regiond                          RUNNING   pid 8146, uptime 0:02:21
> syslog                           RUNNING   pid 8324, uptime 0:00:51

add admin

sudo maas createadmin --username=admin --email=smiley@yourdomain.com

> YourPassword

Import SSH keys [] (lp:user-id or gh:user-id): (just enter)

์›น ๋ธŒ๋ผ์šฐ์ ธ

http://10.1.5.11:5240/MAAS/ (๋Œ€์†Œ๋ฌธ์ž ์ฃผ์˜)

continue

upload ssh key import

์ดˆ๊ธฐ ์ ‘์† ssh key๋ฅผ ์„ค์ •ํ•œ๋‹ค. ์ค‘์š”ํ•˜๋‹ค.

continue

cat ~/.ssh/id_rsa.pub
>  ssh-rsa AAxxx0RVSJOdOBSeO7e

dhcp๋ฅผ enable

subnet >> click

untagged click

enable dhcp ํด๋ฆญ

sudo maas status

bind9                            RUNNING   pid 19886, uptime 0:09:28
dhcpd                            RUNNING   pid 20664, uptime 0:00:49
dhcpd6                           STOPPED   Not started
http                             RUNNING   pid 20198, uptime 0:07:34
ntp                              RUNNING   pid 20085, uptime 0:07:43
proxy                            RUNNING   pid 20602, uptime 0:02:28
rackd                            RUNNING   pid 19889, uptime 0:09:28
regiond                          RUNNING   pid 19890, uptime 0:09:28
syslog                           RUNNING   pid 20084, uptime 0:07:43

dhcp๊ฐ€ ์‹คํ–‰์ค‘์ž„์„ ํ™•์ธํ• ์ˆ˜ ์žˆ๋‹ค.

image ๋‹ค์šด๋กœ๋“œ

http://10.1.5.11:5240/MAAS/l/images

sync์ž„์„ ํ™•์ธํ• ์ˆ˜ ์žˆ๋‹ค.

์ƒˆ๋…ธ๋“œ ์„ค์น˜

๋…ธ๋“œ ๋ถ€ํŒ… ์ˆœ์„œ๋ฅผ pxe๋ฅผ 1๋ฒˆ์œผ๋กœ ํ•ด๋‘๋ฉด ์ž๋™์œผ๋กœ maas์—์„œ ์ด๋ฏธ์ง€๋ฅผ ๋ฐ›์•„์„œ ์„ค์น˜ํ•œ๋‹ค. ์›น ํ™”๋ฉด์—์„œ๋„ ์ž๋™ ๋“ฑ๋ก์ด ๋œ๋‹ค.

์ž๋™์œผ๋กœ ๋“ฑ๋ก๋˜๋ฉฐ commissioning๊นŒ์ง€ ๋œ๋‹ค. commsioning์ด ์‹คํŒจํ•˜๋ฉด new ๋กœ ๋˜๊ณ  ํ†ต๊ณผํ•˜๋ฉด ready๊ฐ€ ๋œ๋‹ค.

์ƒํƒœ๋ฅผ ์„ค๋ช…ํ•˜๋ฉด ์•„๋ž˜์™€ ๊ฐ™๋‹ค.

new -> commissioning -> ready -> deploy

new ์ƒํƒœ๋กœ ๊ฐ„๋‹ค.

--> commisioning์„ ์ถ”๊ฐ€๋กœ ํ•ด๋ณด์ž.

--> ready์ƒํƒœ์ž„

์ด๋ฆ„ ๋ฐ”๊พธ๊ณ  ip๋ฅผ ์ง€์ •์„ ํ•ด๋ณด์ž.

install os

์ด์ œ deploy๋ฅผ ํ•ด๋ณด์ž.

์žฅ๋น„๋ฅผ ์„ ํƒํ•˜๊ณ  deploy๋ฅผ ๋ˆ„๋ฅด๋ฉด ๋œ๋‹ค.

bearmetal์žฅ๋น„์ด๋ฏ€๋กœ kvm๋„ ๊ฐ™์ด ์„ค์น˜๊ฐ€ ๋˜๊ฒŒ ํ•ด๋‘์—ˆ๋‹ค.

๋””ํ”Œ๋กœ์ด ํ•ด๋ณด์ž.

์ž˜ ์„ค์น˜ ๋˜์—ˆ๋‹ค.

vm๋„ ์„ค์น˜

๋…ธ๋“œ ์ด๋ฆ„์„ ๋ˆ„๋ฅด๊ณ  ๋“ค์–ด๊ฐ€์„œ compose๋ฅผ ๋ˆŒ๋ฅธ๋‹ค.

memory , core , harddisk ์„ค์ •์„ ํ•ด๋ณด์ž.

์ƒ์„ฑํ•˜์ž.

machine ๋ฉ”๋‰ด๋กœ ๊ฐ€๋ณด์ž.

์ƒˆ๋กœ ์ƒ์„ฑ๋œ vm์ด ์ƒˆ ์žฅ๋น„๋กœ ๋ณด์ด๊ณ  commisioning์ด ์‹œ์ž‘๋˜์—ˆ๋‹ค.

ready์ƒํƒœ๋กœ ๋ฐ”๋€Œ๊ณ  ๋””ํ”Œ๋กœ์ด๋ฅผ ๋Œ€๊ธฐํ•œ๋‹ค.

์ด์ œ os๋ฅผ deploy ํ•˜๋ฉด ๋œ๋‹ค.

์™„๋ฃŒํ›„ ์ ‘์†ํ•ด๋ณด์ž ubuntu์œ ์ €์™€ ์ดˆ๊ธฐ์— ๋“ฑ๋กํ•œ ssh key๋กœ ์ ‘์†์ด ๊ฐ€๋Šฅํ•˜๋‹ค.

Last updated