This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Next revision Both sides next revision | ||
maas [2015/11/25 16:54] gsamfira |
maas [2016/12/15 12:00] sgiulitti |
||
---|---|---|---|
Line 13: | Line 13: | ||
This should be the case for all other hypervisors as well. Also, if using KVM/QEMU make sure that the block device controllers are IDE or SATA, unless you have bundeled virtio drivers when creating the PXE installation media. | This should be the case for all other hypervisors as well. Also, if using KVM/QEMU make sure that the block device controllers are IDE or SATA, unless you have bundeled virtio drivers when creating the PXE installation media. | ||
- | If you plan on deploying MaaS on Hyper-V using Generation 2 images, you will need to patch grubx64.efi located in: | + | If you plan on deploying MaaS on Hyper-V using Generation 2 images, you will need to disable secure boot in VMs and patch grubx64.efi located in: |
``` | ``` | ||
- | / | + | wget http:// |
+ | gunzip grubnetx64.efi.gz | ||
+ | cp grubnetx64.efi | ||
``` | ``` | ||
- | | + | |
- | Follow this article to compile GRUB with Generation 2 VM support: | + | or get the Ubuntu 16.10 grub2 version: |
``` | ``` | ||
- | http://wiki.cloudbase.it/hyperv-uefi-grub | + | wget http://archive.ubuntu.com/ |
+ | -O / | ||
``` | ``` | ||
+ | | ||
+ | Follow this article to [compile GRUB with Generation 2 VM support](http:// | ||
+ | |||
+ | **NOTE: this will be overwritten by maas every time something changes in boot images (eg: upload new image, maas updates images from simplestreams)** | ||
+ | |||
## | ## | ||
###Machine 1 – MAAS Controller | ###Machine 1 – MAAS Controller | ||
- | * Ubuntu | + | * Ubuntu |
* The external is connected to the internet, the private will be used for MAAS deployment. | * The external is connected to the internet, the private will be used for MAAS deployment. | ||
+ | |||
+ | ###Note | ||
+ | Ubuntu doesn' | ||
+ | instead you will see ens3 ens9 because of systemd renaming those. | ||
+ | Let's assume the ens3 is the primary one and ensp5s the second one. | ||
*Example interface configuration: | *Example interface configuration: | ||
```bash | ```bash | ||
# The primary network interface (external) | # The primary network interface (external) | ||
- | auto eth0 | + | auto ens3 |
- | iface eth0 inet dhcp | + | iface ens3 inet static |
+ | | ||
+ | | ||
+ | # usually this is virb0 address created by the virtual | ||
+ | # system that you are using mine is 192.168.122.1 | ||
+ | | ||
+ | | ||
# The secondary NIC (used internal for MAAS) | # The secondary NIC (used internal for MAAS) | ||
- | auto eth1 | + | auto ens9 |
- | iface eth1 inet static | + | iface ens9 inet static |
- | address | + | |
- | netmask 255.255.255.0 | + | |
+ | | ||
+ | | ||
+ | | ||
+ | | ||
``` | ``` | ||
Line 52: | Line 76: | ||
##Preparing MAAS Controller | ##Preparing MAAS Controller | ||
- | ###Install Ubuntu | + | ###Install Ubuntu |
Basic install | Basic install | ||
Line 61: | Line 85: | ||
sudo apt-get update | sudo apt-get update | ||
sudo apt-get upgrade | sudo apt-get upgrade | ||
+ | sudo apt-get dist-upgrade | ||
+ | sudo apt-get install openssh-server vlan | ||
sudo apt-get install software-properties-common -y | sudo apt-get install software-properties-common -y | ||
- | sudo add-apt-repository ppa:maas-maintainers/stable -y | + | sudo add-apt-repository ppa: |
sudo apt-get update | sudo apt-get update | ||
``` | ``` | ||
Line 70: | Line 96: | ||
```bash | ```bash | ||
- | sudo apt-get install maas maas-dhcp -y | + | sudo apt-get install maas maas-dns |
``` | ``` | ||
+ | |||
+ | NOTE: When asked for the Ubuntu MAAS API address, double check the detected URL uses ens3’s (external) IP address: http:// | ||
+ | You can later change this by running: | ||
+ | ```bash | ||
+ | sudo dpkg-reconfigure maas-rack-controller | ||
+ | ``` | ||
+ | Also, double check that running | ||
+ | ```bash | ||
+ | sudo dpkg-reconfigure maas-region-controller | ||
+ | ``` | ||
+ | shows the IP address of ensp5s (managed NIC), if not set it to 10.10.10.10! | ||
+ | |||
+ | |||
### | ### | ||
Line 88: | Line 127: | ||
sysctl -p | sysctl -p | ||
``` | ``` | ||
- | In this example | + | In this example |
### Create admin user | ### Create admin user | ||
Line 118: | Line 157: | ||
Edit the default cluster and enable DHCP and DNS on the interface where you will be serving DHCP (see the screenshot as an example). | Edit the default cluster and enable DHCP and DNS on the interface where you will be serving DHCP (see the screenshot as an example). | ||
- | Open `http://< | + | Open `http://< |
*Example:* | *Example:* | ||
- | Router IP = eth1's IP* | + | Router IP = ens9's IP* |
- | IP = eth1's IP | + | IP = ens9's IP |
![Screenshot](http:// | ![Screenshot](http:// | ||
+ | ### How to configure MAAS to be able to boot virtual machines with virsh | ||
+ | |||
+ | The libvirt-bin package needs to be installed to get the virsh command | ||
+ | ```bash | ||
+ | sudo apt-get -y install libvirt-bin | ||
+ | ``` | ||
+ | If you want to use ssh you'll need to generate a ssh key pair for the maas user. | ||
+ | By default there is no home directory created for the maas user. | ||
+ | ```bash | ||
+ | sudo mkdir -p ~maas | ||
+ | sudo chown maas:maas ~maas | ||
+ | ``` | ||
+ | Add a login shell for the maas user (we'll only need this for the ssh-copy-id command later; | ||
+ | if you're putting ssh keys in place manually or using a different mechanism, this step isn't strictly needed): | ||
+ | ```bash | ||
+ | sudo chsh -s /bin/bash maas | ||
+ | ``` | ||
+ | |||
+ | Generate a SSH keypair as the maas user (hit enter three times to accept the default path and empty password): | ||
+ | ```bash | ||
+ | sudo -u maas ssh-keygen | ||
+ | Generating public/ | ||
+ | Enter file in which to save the key (/ | ||
+ | Created directory '/ | ||
+ | Enter passphrase (empty for no passphrase): | ||
+ | Enter same passphrase again: | ||
+ | Your identification has been saved in / | ||
+ | Your public key has been saved in / | ||
+ | ``` | ||
+ | Then add the public key to ~ubuntu/ | ||
+ | ```bash | ||
+ | sudo -u maas -i ssh-copy-id ubuntu@192.168.122.1 | ||
+ | ``` | ||
+ | As the maas user, test virsh commands against libvirt at 192.168.122.1: | ||
+ | ```bash | ||
+ | sudo -u maas virsh -c qemu+ssh:// | ||
+ | ``` | ||
###Set upstream DNS | ###Set upstream DNS | ||
Line 145: | Line 221: | ||
### x509 keys | ### x509 keys | ||
- | Create a x509 certificate to use with WinRM | + | Create a x509 certificate to use with WinRM. This command is available on the MAAS node itself. |
```bash | ```bash | ||
maas-generate-winrm-cert | maas-generate-winrm-cert | ||
``` | ``` | ||
+ | |||
+ | For your convenience, | ||
+ | |||
Copy the outputed key to: | Copy the outputed key to: | ||
Line 157: | Line 236: | ||
## Creating a windows image for MaaS | ## Creating a windows image for MaaS | ||
- | To generate a new image for MaaS, you will need the following powershell | + | To generate a new image for MaaS, you will need the following powershell |
``` | ``` | ||
- | https:// | + | https:// |
``` | ``` | ||