This shows you the differences between two versions of the page.
Both sides previous revision Previous revision | Next revision Both sides next revision | ||
maas [2016/12/15 11:18] sgiulitti |
maas [2016/12/15 11:50] sgiulitti |
||
---|---|---|---|
Line 165: | Line 165: | ||
![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): | ||
+ | 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@10.0.0.2 | ||
+ | ``` | ||
+ | As the maas user, test virsh commands against libvirt at 10.0.0.2: | ||
+ | ```bash | ||
+ | sudo -u maas virsh -c qemu+ssh:// | ||
+ | ``` | ||
###Set upstream DNS | ###Set upstream DNS | ||