ubuntu18.04 maas

Reference documents:

"Using IPMI to remotely control and manage DELL R710 server"

"Juju-maas Environment Construction"

"MAAS+JUJU+CONJURE-UP fully automatic deployment of OPENSTACK"

"Official document Install MAAS"
"Official document MAAS Documentation"
"MAAS installation from packages"

"Official document jaas"
"Official document Install Juju"
"Installing Juju"

"Official document Ubuntu18.04, OpenStack Charms Deployment Guide"
"Official document Conjure-up is magic!"
"Official document What is conjure-up"

《canonical》

"Bare metal cloud rapid deployment tool Ubuntu MAAS: stand-alone installation and testing series tutorial first"
"Bare metal cloud rapid deployment tool Ubuntu MAAS: stand-alone installation and testing series tutorial second article" "bare
metal cloud rapid deployment tool Ubuntu MAAS: stand-alone installation and The third part of the test series tutorial"
"Ubuntu cluster-use MAAS to start the bare metal installation"
"Ubuntu MAAS-Custom Ubuntu 16.04 Images [closed]"

Pre-setting:
Configure the node server ipmi to ensure that maas can remotely turn on and off the node server. In the Dell R series, pxe uses the first network port, and ipmi also uses the first network port, ipmi will obtain a network address from dhcp, and pxe will also dhcp an address.

1 Set up your hardware
1 安装硬件
You need one small server for MAAS and at least one server which can be managed with a BMC. It is recommended to have the MAAS server provide DHCP and DNS on a network the managed machines are connected to.

You need to use a small server to install maas, and at least another server that can be managed by BMC. It is recommended to use the MAAS server to provide DHCP and DNS to manage the connected network.

2 Install Ubuntu Server
2 安装ubuntu服务器
Download Ubuntu Server 18.04 LTS and follow the step-by-step installation instructions on your MAAS server.

Download Ubuntu Server 18.04 LTS and follow the step-by-step installation instructions on your MAAS server.

Modify it to a domestic source and modify the host to improve the upgrade speed and download image speed.

sudo su - root
mv /etc/apt/sources.list /etc/apt/sources.list.bak
touch /etc/apt/sources.list


#echo “content” >> 文件名
echo "deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse" > /etc/apt/sources.list
echo "deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse" >> /etc/apt/sources.list
echo "deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse" >> /etc/apt/sources.list
echo "deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse" >> /etc/apt/sources.list
echo "deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse" >> /etc/apt/sources.list
echo "deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse" >> /etc/apt/sources.list
echo "deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse" >> /etc/apt/sources.list
echo "deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse" >> /etc/apt/sources.list

apt update -y  && apt -y upgrade 

cp /etc/hosts /etc/hosts.old
echo 91.189.95.83 ppa.launchpad.net >> /etc/hosts
echo 91.189.88.136 images.maas.io >> /etc/hosts
echo 91.189.91.45 maas.io >> /etc/hosts
netplan apply

3 Install MAAS
3 Install MAAS

sudo apt update
sudo snap install maas
#sudo apt install maas

The Create the User admin 4
4 create admin user
Create your admin credentials by typing
typing the following command to create your admin credentials

sudo maas init

Log in to the MAAS UI at http://<your.maas.ip>:5240/MAAS/
登陆MAAS界面 http://<your.maas.ip>:5240/MAAS/

5 Complete the first user configuration journey
5 完成第一次用户配置之旅
Follow the instructions on screen to complete the first installation of MAAS. We recommend using the default values unless your installation has different requirements.

By the end of the journey you should have the following configured;

Region name (MAAS name)
Ubuntu archive, Ubuntu extra architectures
Ubuntu images (https://mirrors.tuna.tsinghua.edu.cn/ubuntu-cloud-images/daily/streams/v1/index.json)
SSH keys (for currently logged in user)
Follow the instructions on the screen to complete the first installation of MAAS. We recommend using the default value unless your installation has different requirements. Note: The Tsinghua source I used for archive:
https://mirrors.tuna.tsinghua.edu.cn/ubuntu/. But when downloading the image, it is still downloaded from maas.io, which will be very slow. It took two days to download the 18.04 64-bit image. When downloading the image, you can do the following steps.
nethogs
lsof -p 2092 -nP | grep TCP

At the end of the journey, you should have configured the following;

Area name (MAAS name)
UBUNTU file, UBUNTU additional structure
UBUNTU IMAGE
SSH key (for the currently logged in user) Note: ssh key is not recommended to use the lauchupad account. It is recommended to generate directly under the maas server.
Insert picture description here
Turn ON the DHCP 6
6 Open the DHCP
Go to at The "Subnets" the Tab, and the SELECT at The VLAN for Which you want to enable the DHCP. The From at The "the Take Action" the Button the SELECT "the Provide the DHCP."

Set the Rack controller that will manage DHCP.
Select the subnet where to create the DHCP Dynamic range on.
Fill in the details for the dynamic range.

Go to the tab "Subnets", select the currently used VLAN in the VLAN, and DHCP will be turned on. Select the "Take action" button and select "Provide DHCP".

Note: In the subnet where pxe works, the gateway needs to be configured. If it is not configured, the node cannot be found in the maas server. On the node node, the words “disable enlist in maas server” will be displayed.

Set the Rack controller to manage DHCP.
Select subnet, the DHCP dynamic range will be created.
Fill in the dynamic range detailed information.
Insert picture description here

7. Create ssh key When
MAAS installs the server node, it will inject the stored key into the node, and then you can log in to the machine directly from the MAAS controller (account Ubuntu, no password).

Note: At the beginning, I created an admin account and used the ssh key of the lauchpad account, and then I could not log in to the node installed using maas because the username and password were incorrect. Later, I re-created an account yunwei, and used the key created by ssh-kengen in the server to realize the password-free login using ssh ubuntu@$node-ipadd from the maas server.

Create key:

ssh-keygen -t rsa -b 2048

Then vi ~/.ssh/id_rsa.pubcopy into it. If there is already content in it, you can copy it directly.

Important:
Click on the account name (the above method is admin), and import the above key content into the ssh key.
This operation needs to be performed before deploying the node.

8. List and deploy servers
Now MAAS is ready to enlist and commission machines.

Set all the servers to PXE boot
Boot each machine once. You should see these machines appear in MAAS
If your machines do not have a IPMI based BMC, proceed to edit them and enter their BMC details
Select all the machines and “Commission” them using the “Take action” button
When machines have a “Ready” status you can start deploying

Go to the Images tab, select the image to be deployed, and MAAS will automatically start the download. It will take a long time.
Note: In order to speed up the download progress, the host file needs to be changed to speed up the download speed.

(Optional customization, choose Tsinghua source, https://mirrors.tuna.tsinghua.edu.cn/ubuntu-cloud-images/daily/streams/v1/index.json)

After MAAS downloads the system image, it is ready to deploy machines.

Set other physical machines to network boot (PXE boot), and turn off other boot methods.
After startup, you can see in the machines tab of MAAS that the status is New.
If the machines do not have IPMI based BMC, proceed to edit them and enter their BMC details.
Select machines and select "Take action" as "Commission".
When the machine status changes to "Ready", and then execute "deploy" again, you can select the operating system version to install.
Note: After ready, before deploy, click the interface tab, and enter the physical configuration under the action option on the right. You can configure the node network card address to be static. However, the network card can be configured in the commission state, but it will not take effect. In the deploy state, the network card cannot be configured as a static allocation form.

Insert picture description here

9. Log in to the node server After the
above operations are completed, use ssh ubuntu@$node_IP_address to log in to the node from the maas controller machine.

The user name is ubuntu, no password.
Then you can use Ansible to centrally control multiple nodes and execute ssh commands in batches.

in case

Guess you like

Origin blog.csdn.net/m0_49212388/article/details/108579434