Bare-metal cloud rapid deployment tool Ubuntu MAAS: the first in a series of stand-alone installation and testing tutorials

1. Test objectives and environmental requirements

If there is no corresponding physical server and network resources, how to install and test MAAS on a single physical server or personal computer is the goal of this blog. The stand-alone MAAS test requires the following environment:

  • 1 physical server or personal computer (can be a desktop computer, laptop) or a virtual machine that can support KVM virtualization. The minimum configuration is 2 core, 4G memory, 24G free space; if you need to further test Charmed Openstack or Charmed kurberntes, usually need to support 3-5 virtual machines, then configure at least 16G memory, 100G free space.
  • The personal computer or server supports Ubuntu 18.04.4 Server or Desktop; you can check whether there is a corresponding Ubuntu certification ( https://certification.ubuntu.com/ ).
  • Internet access, directly or through proxy; for additional settings and methods when proxying, please refer to section 3.3 of the extension and appendix.

2. MAAS installation test process and method

The following is the process and method for installing and testing Ubuntu MAAS on a single machine

  • Ubuntu Server or Ubuntu Desktop
  • Enable lxd container virtual machine and install MAAS server
  • Deployment of MAAS KVM POD and automatic provision of virtual machines
  • OS deployment and machine management

The following is the host name and network IP allocation of the test environment in this article

2.1 Install Ubuntu Server or Ubuntu Desktop

Installing Ubuntu usually requires downloading iso, using iso to make a DVD-ROM or bootable U disk. The download and production methods vary greatly depending on your existing environment. It is more convenient that you have terminal commands in your existing Linux environment. In the existing Linux environment, the following methods to download and make the corresponding boot U disk:

Note: In your environment, the U disk device is not necessarily / dev / sdc. You can judge from the listed disk partitions and sizes by sudo fdisk -l. In addition, the contents of the existing U disk will be overwritten.

$ wget -nd -c   http://releases.ubuntu.com/18.04.4/ubuntu-18.04.4-desktop-amd64.iso   
$ sudo dd if=ubuntu-18.04.4-desktop-amd64.iso of=/dev/sdc bs=1M 
$ wget -nd -c http://cdimage.ubuntu.com/releases/18.04.4/release/ubuntu-18.04.4-server-amd64.iso
$ sudo dd if=/ubuntu-18.04.4-server-amd64.iso of=/dev/sdc bs=1M  

If you need to create a DVD-ROM or boot a USB flash drive under Windows or Mac OS, please refer to the instructions on the following web page https://ubuntu.com/tutorials?topic=desktop

If it is a server, you can usually start the remote console through BMC management to directly load the iso to the virtual CD-ROM drive to start the installation. For details, refer to the server manufacturer's documentation and instructions.

Once I started the Ubuntu Desktop / Server installation program, the process and settings are quite simple and straightforward, if you need detailed guidance and instructions, you can refer to

After the system is installed and restarted, if you can log in, open a command line terminal, or sudo to switch to root privileges, this machine can access the Internet, you can continue the following MAAS installation and test steps.

2.2 Enable LXD container virtual machine and install MAAS server

Ubuntu LXD is an operating system virtualization technology based on container technology. It provides the same user experience as a virtual machine. It includes a complete system startup program, system logs, network and remote ssh login. It also has the density and speed advantages of containers. It does not have its own core but shares and uses the host core. In addition, Ubuntu has provided a variety of commonly used pre-made images, which can be downloaded directly from the corresponding image warehouse when creating the LXD container machine.

MAAS is usually and recommended to be installed and run directly on the host Ubuntu Server operating system, but for the Ubuntu desktop environment, because the network usually uses a more dynamic and intelligent management method, it is most suitable for installation and testing in the LXD virtual machine. In addition, choosing LXD can save the KVM configuration and virtual machine installation or import process. After MAAS work, you can use MAAS to automatically arrange KVM virtual and automatic deployment OS.

2.2.1 LXD initialization

LXD initialization allows you to configure the storage, network, IP address, etc. used by the LXD service and LXD container. The following default configuration is suitable for most situations. In the example, the # after the line or output is used for explanation and explanation. They are not the output of command input or command execution.

Note: The part highlighted in red is the part you input and pay attention to, the following is the same.

2.2.2 Create LXD container machine and install MAAS

2.2.3 LXD network and MAAS IP configuration

MAAS usually uses its own DHCP service to implement PXE network startup, so it is necessary to disable the DHCP service in the LXD service. Also configure maas-server as static IP.

2.2.4 Set iptables port forwarding to access MAAS management interface

Set iptables port forwarding to access the MAAS web management interface. If you are using the Ubuntu desktop test, this step is not necessary, because the local browser can directly access the 192.168.10.10 MAAS server from the local 192.168.10.1 address. If it is an Ubuntu Server environment, if other desktop computers on the network can often not directly access the MAAS IP (routing reason), it is most convenient to access MAAS through the port forwarding function.

2.2.5 MAAS management account

The following method creates a MAAS management account in the maas-server container:

root@maas-server:~# maas-region createadmin 
Username: root
Password: 
Again: 
Email: [email protected]         
Import SSH keys [] (lp:user-id or gh:user-id): 
root@maas-server:~#

2.2.7 Login and initial configuration of MAAS web management interface

Browser access to MAAS web management interface:

After completing the above operations, you will see the following screenshot:

* This tutorial was written by Zhanglei Mao, Canonical Cloud Architect.

Guess you like

Origin www.linuxidc.com/Linux/2020-04/162953.htm