-
-
Save officialmofabs/d1fb72f201764c9eac224bbf4a51e42b to your computer and use it in GitHub Desktop.
Create a config drive iso for cloud-init
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
cat <<EOF > user-data | |
#cloud-config | |
debug: True | |
disable_root: False | |
ssh_deletekeys: False | |
ssh_pwauth: True | |
ssh_authorized_keys: | |
- ssh-rsa XXX | |
# users: | |
# - name: clouduser | |
# gecos: User | |
# sudo: ["ALL=(ALL) NOPASSWD:ALL"] | |
# groups: users | |
# ssh_pwauth: True | |
# ssh-authorized-keys: | |
# - ssh-rsa XXXXXX | |
chpasswd: | |
list: | | |
root:linux | |
expire: False | |
EOF | |
cat <<EOF > meta-data | |
instance-id: id-12345 | |
local-hostname: cloudy | |
EOF | |
popd | |
# generate the seed images | |
genisoimage -output seed.img -volid cidata -joliet -rock $tmpdir/ | |
# for vfat | |
truncate --size 2M seed-vfat.img | |
mkfs.vfat -n cidata seed-vfat.img | |
mcopy -oi seed-vfat.img $tmpdir/user-data $tmpdir/meta-data :: | |
rm -rf $tmpdir | |
# then try: | |
# qemu-system-x86_64 -m 512 -net nic -net user,hostfwd=tcp::2222-:22 -drive file=SLE12-Base.qcow2,if=virtio -drive file=seed.img,if=virtio |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment