Reinstall MAAS

Reinstall MAASΒΆ

If your MAAS instance is lost or broken, you can reinstall it. This section describes how to install MAAS from the Ubuntu Server 16.04 qcow2 image.

To reinstall MAAS:

  1. Create a cloud-config disk:

    1. For example, create a configuration file named config-drive.yaml:

      #cloud-config
      debug: True
      ssh_pwauth: True
      disable_root: false
      chpasswd:
        list: |
          root:r00tme
          ubuntu:r00tme
        expire: False
      

      Note

      You must change the default password.

    2. Create the configuration drive:

      export VM_CONFIG_DISK="/var/lib/libvirt/images/maas/maas-config.iso"
      cloud-localds  --hostname maas01 --dsmode local ${VM_CONFIG_DISK}  config-drive.yaml
      
  2. Create a VM system disk using the preloaded qcow2 image. For example:

    wget http://cloud-images.ubuntu.com/releases/xenial/release-20180306/ubuntu-16.04-server-cloudimg-amd64-disk1.img -O \
    /var/lib/libvirt/images/maas/maas-system-backend.qcow2
    
    export VM_SOURCE_DISK="/var/lib/libvirt/images/maas/maas-system.qcow2"
    qemu-img create -b /var/lib/libvirt/images/maas/maas-system-backend.qcow2 -f qcow2 ${VM_SOURCE_DISK} 100G
    
  3. Create a VM using the predefine-vm script. For example:

    export MCP_VERSION="master"
    wget https://github.com/Mirantis/mcp-common-scripts/blob/${MCP_VERSION}/predefine-vm/define-cfg01-vm.sh
    
    chmod 0755 define-vm.sh
    export VM_NAME="maas01.[CLUSTER_DOMAIN]"
    

    Note

    You may add other optional variables that have default values and set them according to your deployment configuration. These variables include:

    • VM_MGM_BRIDGE_NAME="br-mgm"
    • VM_CTL_BRIDGE_NAME="br-ctl"
    • VM_MEM_KB="8388608"
    • VM_CPUS="4"

    The br-mgm and br-ctl values are the names of the Linux bridges. See MCP Deployment Guide: Prerequisites to deploying MCP DriveTrain for details. Custom names can be passed to a VM definition using the VM_MGM_BRIDGE_NAME and VM_CTL_BRIDGE_NAME variables accordingly.

  4. Boot the created VM.

  5. Log in to the VM using the previously defined password.

  6. Proceed with installing MAAS:

    sudo apt-get install maas
    
  7. Configure MAAS as required to complete the installation.

  8. Verify the installation by opening the MAAS web UI:

    http://<MAAS-IP-ADDRESS>:5240/MAAS
    
  9. If you have installed MAAS from the packages, create an initial (administrative) user first to log in to the MAAS web UI:

    sudo maas createadmin --username=<PROFILE> --email=<EMAIL_ADDRESS>