1 Star 0 Fork 0

aaawoyucheng / cloud-init-guide

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
05-file_injection.txt 2.55 KB
一键复制 编辑 原始数据 按行查看 历史
Matt Dorn 提交于 2016-04-27 03:43 . initial commit
# Create some files to inject
cat > ~/textfile.txt <<EOF
Welcome to OpenStack Summit Austin!
EOF
cat > ~/texas.txt <<EOF
| | \
| | |
| | |
| | |__
| | __ \______
| |/ \_____ |_________________
| O \___________________/ \
| \\*****; \ \
| \\***********; \ \
____________| \\************;;;;;;;;;;;;;;;;; \ \
/____________| \\***** ***; ; | |
\ \\*** *; ; \ \
| \\*** * ***;________________; | |
\_ \\*** ****;;;;;;;;;;;;;;;;;; | |
|_ \\***********;;;;;;;;;;;;;;;;;; _|_|
| \\*.***;*****;;;;;;;;;;;;;;;;;; _/_/
\ \\ ******;;;;;;;;;;;;;;;;;; _/_/
\ ____ \\ ;;;;;;;;;;;;;;;;;; /
|_/__/ \ \\ / /
\ \\ / /
\ \\ _ /_/
\ \\ / /
\ \\ _ / /
\ | |
\ / /
| / /
\ / /
| \ \
\ | |
\_ | |
\_ | |
\__|/
EOF
# Boot an instance injecting files
nova boot --image cirros --flavor m1.summit --file /home/cirros/textfile.txt=textfile.txt --file /home/cirros/texas.txt=texas.txt myfileinjectioninstance
# List instances, notice status of instance
nova list
# Get VNC console
nova get-vnc-console myfileinjectioninstance novnc
# Open the URL in your browser.
# username: cirros
# password: cubswin:)
# View files
sudo cat textfile.txt
sudo cat texas.txt
# List block devices
sudo blkid
# Mount config drive
sudo mount /dev/sr0 /mnt
# Examine contents of config drive
cd /mnt/openstack/content
ls
# Examine contents of first file
cat 0000
# Examine contents of the second file
cat 0001
# Log out of instance
exit
######!!!From Your SSH Session!!!######
# Delete the instance
nova delete myfileinjectioninstance
1
https://gitee.com/aaawoyucheng/cloud-init-guide.git
git@gitee.com:aaawoyucheng/cloud-init-guide.git
aaawoyucheng
cloud-init-guide
cloud-init-guide
master

搜索帮助