MAAS/VirtualBox 呼叫「http://169.254.169.254/2009-04-04/meta-data/instance-id」失敗且 SSH 失敗

MAAS/VirtualBox 呼叫「http://169.254.169.254/2009-04-04/meta-data/instance-id」失敗且 SSH 失敗

設定

出於測試目的,我在 VirtualBox VM 中安裝了 MAAS,並希望它以 PXE 方式啟動第二個 VM。

兩台虛擬機器都連接到 VirtualBox 內部網路。

MAAS VM 是 Ubuntu Server 14.04.2,我安裝了以下軟體套件的版本 1.7.5+bzr3369-0ubuntu1~trusty1:

maas
maas-region-controller
maas-cluster-controller
maas-dhcp
maas-dns

在 MAAS GUI 的「影像」部分中,我從預設檔案中新增了 14.04 LTS 影像 (http://archive.ubuntu.com/ubuntu)。預設集群(「集群主控」)隨後能夠成功同步。

在 MAAS VM 上,我還產生了 ssh 金鑰並將ssh-keygen其保存在預設位置 (~/.ssh/)。然後在 GUI 的使用者首選項部分中,我新增了 SSH 公鑰。

在 GUI 的「叢集」部分中,我為「Cluster Master」新增了一個介面 (eth2),並將其配置為管理 dhcp 和 dns。介面 eth2 連接到另一個虛擬機器(透過 VirtualBox 內部網路)。

在 GUI 中,我為「預設叢集」新增了一個節點,並將「電源類型」留空,因為 Wake On Lan 不適用於 VirtualBox。

問題

手動啟動客戶端 VM 後,它會取得 IP 位址並成功開始啟動程序。然而,在某些時候,它會掛起整整 120 秒,並重複以下訊息多次:

url_helper.py[警告]:呼叫 'http://169.254.169.254/2009-04-04/meta-data/instance-id'失敗[70/120秒]:請求錯誤[HTTPConnectionPool(主機='169.254.269.254',連接埠=80):超過最大重試次數,網址:/2009-04-04/meta-data/instance-id(由下列原因引起: [Errno 101]網路無法存取)]

在網上閱讀有關此內容後,我發現由於這是 Ubuntu 的雲端映像,因此它正在嘗試檢索實例元資料。

1)我該如何禁止這種行為?

2) 我將如何運行元資料(cloud-init?)服務(在哪裡?在 MAAS VM 上?)來提供實例元資料?

我不確定這是否與第一個問題有關。 120 秒後,啟動程序恢復,並出現登入提示。上網查了一下發現本地無法登入。相反,我必須透過 ssh 使用公鑰身份驗證進行連接。如上所述,我已經產生了 ssh 金鑰並將它們新增至 MAAS,但我的 ssh 連線被拒絕。

test@ubuntuServer1404:~$ ssh [email protected] -v
OpenSSH_6.6.1, OpenSSL 1.0.1f 6 Jan 2014
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug1: Connecting to 192.168.7.101 [192.168.7.101] port 22.
debug1: Connection established.
debug1: identity file /home/test/.ssh/id_rsa type 1
debug1: identity file /home/test/.ssh/id_rsa-cert type -1
debug1: identity file /home/test/.ssh/id_dsa type -1
debug1: identity file /home/test/.ssh/id_dsa-cert type -1
debug1: identity file /home/test/.ssh/id_ecdsa type -1
debug1: identity file /home/test/.ssh/id_ecdsa-cert type -1
debug1: identity file /home/test/.ssh/id_ed25519 type -1
debug1: identity file /home/test/.ssh/id_ed25519-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_6.6.1p1 Ubuntu-2ubuntu2
debug1: Remote protocol version 2.0, remote software version OpenSSH_6.6.1p1 Ubuntu-2ubuntu2
debug1: match: OpenSSH_6.6.1p1 Ubuntu-2ubuntu2 pat OpenSSH_6.6.1* compat 0x04000000
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-ctr [email protected] none
debug1: kex: client->server aes128-ctr [email protected] none
debug1: sending SSH2_MSG_KEX_ECDH_INIT
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: Server host key: ECDSA 06:16:8e:d2:22:3a:0b:67:64:3d:7b:17:69:fb:ee:29
debug1: Host '192.168.7.101' is known and matches the ECDSA host key.
debug1: Found key in /home/test/.ssh/known_hosts:2
debug1: ssh_ecdsa_verify: signature correct
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: Roaming not allowed by server
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey
debug1: Next authentication method: publickey
debug1: Offering RSA public key: /home/test/.ssh/id_rsa
debug1: Authentications that can continue: publickey
debug1: Trying private key: /home/test/.ssh/id_dsa
debug1: Trying private key: /home/test/.ssh/id_ecdsa
debug1: Trying private key: /home/test/.ssh/id_ed25519
debug1: No more authentication methods to try.
Permission denied (publickey).

任何幫助表示讚賞。謝謝。

答案1

我也遇到了同樣的問題,這是因為maas配置了錯誤的IP(我第一次建造機器時是DHCP)。運行後問題解決

dpkg-reconfigure maas-region-controller 

並提供正確的IP。

相關內容