phausman / maas-sandbox

Quickly launch a virtual MAAS sandbox with a few PXE-booted nodes using Vagrant and libvirt.
10 stars 11 forks source link

Could not connect to snap store and get maas and give it the ip 172.16.106.118 #2

Open malkahtani opened 3 years ago

malkahtani commented 3 years ago

I created the networks as in the design in the doc file but I was not able to connect to snap store to get maas as in the log file text. My network interface ens160 has the configuration and IP as in the picture netplan.

Can I get some help to install this virtual system. It might be routing the networks to the network interface to access the internet and snap store; I am not a professional user in libvirt and vagrant.

netplan

Networks in virsh libvirt.docx os-vm-log-1.txt

malkahtani commented 3 years ago

When I assigned different network interfaces as master to the bridges and set all bridges up, I was not able to get IPs. I tried nat and route networks for the three virtual networks in libvirt. OpenStack local VM log file.docx

phausman commented 3 years ago

hi @malkahtani, thanks for reaching out. First thing I'd try is to manually run snap install maas --channel 2.7/stable on some manually created VM and see if it's successful. Maybe snap store was not available when you were trying to run this before? Or maybe you're in the proxy environment that does not allow the traffic to the snap store?

malkahtani commented 3 years ago

Was network issue and fixed by fixing vagrant and virsh virtual network by installing Dnsmasq https://thekelleys.org.uk/dnsmasq/doc.html I used this tutorial to install it https://computingforgeeks.com/install-and-configure-dnsmasq-on-ubuntu/ Then this tutorial to fix vagrant DNS resolution (NAT) https://fabianlee.org/2018/10/22/kvm-using-dnsmasq-for-libvirt-dns-resolution/

I have a problem bootstrap juju controller since the internet connectivity still a problem got this error Running machine configuration script... packet_write_wait: Connection to 192.168.10.11 port 22: Broken pipe ERROR failed to bootstrap model: subprocess encountered error code 255

As you know MAAS has the IP 192.168.10.2 and is reaching the internet but the new VM with 192.168.10.11 cannot reach same subnet, same network but I get errors?! which are not logical.

First bootstrap asks for the image ubuntu/bionic that is installed on maas andI got the error above no internet: juju bootstrap maas-cloud maas-cloud-controller Creating Juju controller "maas-cloud-controller" on maas-cloud Looking for packaged Juju agent version 2.9.5 for amd64 Located Juju agent version 2.9.5-ubuntu-amd64 at https://streams.canonical.com/juju/tools/agent/2.9.5/juju-2.9.5-ubuntu-amd64.tgz Launching controller instance(s) on maas-cloud... ERROR failed to bootstrap model: cannot start bootstrap instance: unexpected: ServerError: 400 Bad Request ({"distro_series": ["'focal' is not a valid distro_series. It should be one of: '', 'ubuntu/bionic'."]})

Second bootstrap I sync the focal image on maas ubuntu 20.04, and waiting for configuration

vagrant@maas:~/juju$ juju bootstrap maas-cloud maas-cloud-controller Creating Juju controller "maas-cloud-controller" on maas-cloud Looking for packaged Juju agent version 2.9.5 for amd64 Located Juju agent version 2.9.5-ubuntu-amd64 at https://streams.canonical.com/juju/tools/agent/2.9.5/juju-2.9.5-ubuntu-amd64.tgz Launching controller instance(s) on maas-cloud...

Hopefully, I can fix the configuration problem soon.

malkahtani commented 3 years ago

I found out that maas is reaching the internet using 192.168.121.0/24 subnet and 192.168.10.0/24 and 192.168.11.0/24 still cannot reach the internet. This is the reason why I was not able to install the controller. The subnets 192.168.10.0/24 and 192.168.11.0/24 do not use DHCP and that is the only difference between the two subnets and 192.168.121.0/24 which uses DHCP in /var/lib/libvirt/dnsmasq/vagrant-libvirt.conf and /var/lib/libvirt/dnsmasq/OAM.conf /var/lib/libvirt/dnsmasq/FloatingIP.conf
The default network 192.168.122.0/24 /var/lib/libvirt/dnsmasq/default.conf is not usable in this project but it uses DHCP.

malkahtani commented 3 years ago

Another issue is that I can only ssh maas not all nodes because the ssh key is in IdentityFile /root/maas-sandbox/id_rsa and only one host is defined Host maas, the nodes do not defined automatically to ssh them with the key.

vagrant ssh-config Host maas HostName 192.168.121.58 User vagrant Port 22 UserKnownHostsFile /dev/null StrictHostKeyChecking no PasswordAuthentication no IdentityFile /root/maas-sandbox/id_rsa IdentityFile /root/.vagrant.d/insecure_private_key IdentitiesOnly yes LogLevel FATAL

The provider for this Vagrant-managed machine is reporting that it is not yet ready for SSH. Depending on your provider this can carry different meanings. Make sure your machine is created and running and try again. Additionally, check the output of vagrant status to verify that the machine is in the state that you expect. If you continue to get this error message, please view the documentation for the provider you're using.

malkahtani commented 3 years ago

Thus, we I ssh maas machine then try to ssh one of the nodes I get

While when I install juju controller I see it connected to ssh

Attempting to connect to 192.168.10.14:22 Connected to 192.168.10.14 Running machine configuration script...

When I ssh from maas

vagrant@maas:~$ ssh 192.168.10.14 The authenticity of host '192.168.10.14 (192.168.10.14)' can't be established. ECDSA key fingerprint is SHA256:3fi/po4DHPNRJ1SmGrtHaVSmWNaPlKvF6HVzJ//bdUw. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added '192.168.10.14' (ECDSA) to the list of known hosts. vagrant@192.168.10.14: Permission denied (publickey). vagrant@maas:~$ ssh node04 ssh: Could not resolve hostname node04: Temporary failure in name resolution vagrant@maas:~$ ssh root@192.168.10.14 Please login as the user "NONE" rather than the user "root".

Connection to 192.168.10.14 closed. vagrant@maas:~$ ssh NONE@192.168.10.14 NONE@192.168.10.14: Permission denied (publickey). vagrant@maas:~$