【发布时间】:2022-01-14 22:06:13
【问题描述】:
我已按照 Azure 官方文档中列出的教程进行操作。 Automate VM Deployment
这是我在 Azure 官方教程中遵循的步骤。
- 在下面创建一个 yaml 文件
## Install packages on first boot
package_upgrade: true
packages:
- docker
- nodejs
- python3.9
- 在创建 Ubuntu 实例时将 cloud-config 的内容粘贴到 cloud init 中。
当我尝试检查 Python 版本时,它仍然是 Python3.8,而且我无法调用 docker。当我查看/var/log/cloud-init.log时,docker已经安装成功了。
less /var/log/cloud-init.log的日志
2021-12-10 06:03:55,535 - subp.py[DEBUG]: Running command ['eatmydata', 'apt-get', '--option=Dpkg::Options::=--force-confold', '--option=Dpkg::options::=--force-unsafe-
io', '--assume-yes', '--quiet', 'install', 'docker'] with allowed return codes [0] (shell=False, capture=False)
2021-12-10 06:03:57,901 - util.py[DEBUG]: apt-install [eatmydata apt-get --option=Dpkg::Options::=--force-confold --option=Dpkg::options::=--force-unsafe-io --assume-ye
s --quiet install docker] took 2.365 seconds
【问题讨论】:
标签: azure virtual-machine cloud-init