Last active
March 17, 2021 11:32
-
-
Save gowatana/91a91818d61f0c3c735acd7e75e8b7fa to your computer and use it in GitHub Desktop.
Nutanix AHV の Custom Script(Cloud-Init)で kubectl むけ VM を作成する。
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#cloud-config | |
disable_root: true | |
ssh_pwauth: true | |
package_upgrade: false | |
users: | |
- name: nutanix | |
lock-passwd: false | |
passwd: $6$oDzrtJla$rMzS0vuH95Q2PjDgqVOsI30MqAYemPK5Y9uYsSpeQWd99R4hqm/JWoJqH4Y81SlbtTMkglp243leccceKNZ9h. | |
sudo: ALL=(ALL) NOPASSWD:ALL | |
packages: | |
- git | |
- unzip | |
- bash-completion | |
runcmd: | |
- mkdir /home/nutanix/bin | |
- curl -L -o /home/nutanix/bin/kubectl "https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl" | |
- chmod +x /home/nutanix/bin/kubectl | |
- echo 'source <(kubectl completion bash)' >> /home/nutanix/.bash_profile | |
- chown -R nutanix:nutanix /home/nutanix/bin |
AHV VM での Custom Script を acli ではなくPrism から利用する様子
https://blog.ntnx.jp/entry/2020/08/30/153906
cloud-init 導入済みの CentOS7 OS ディスク イメージを、CVM の acli コマンドでダウンロード&登録するコマンドライン例。
- ストレージ コンテナ名「default-container-XXXX」は、環境に合わせて変更する。
$ acli image.create CentOS-7-x86_64-GenericCloud-2003 image_type=kDiskImage container=default-container-XXXX source_url=https://cloud.centos.org/centos/7/images/CentOS-7-x86_64-GenericCloud-2003.qcow2
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
利用例
VM が起動したら下記で SSH ログインする。IP アドレスは、AOS の IPAM による DHCP 自動設定。