[OpenStack Heat] get_started.template

1.Prepare image

[root@chen tests]# glance image-create --name F17-x86_64-cfntools--disk-format=qcow2 --container-format=bare --is-public=true --file=F17-x86_64-cfntools.qcow2



2.Prepare network ,iptables rules and keypair


Assume neutron service can work well.

# Create flat network.

[root@chen tests]# neutron net-create net_flat --provider:network_type flat--provider:physical_network physnet1

[root@chen tests]# neutron subnet-create net_flat 10.20.1.0/24 --namesubnet_flat --gateway 10.20.1.1

# List all nets


# Routing 169.254.169.254 metadata ip to 10.11.0.16:8775

# Add another address to br-int,important, if not done, key may can not be injected into vm

[root@chen tests]# sudo ifconfig br-int:1 10.20.1.1

[root@chen tests]# sudo iptables -t nat -A PREROUTING -d 169.254.169.254/32 -p tcp -m tcp--dport 80 -j DNAT --to-destination 10.11.0.16:8775

[root@chen tests]# sudo iptables-save

# Create keypair

[root@chen tests]# ssh-keygen -t rsa

select 'y' if need, anddo not input password to avoidlater input when ssh

[root@chen tests]# nova keypair-add --pub_key ~/.ssh/id_rsa.pub root_key


3.Using Heat CLI and shell scripts to verify.



4.SSH to VM to verify

[root@chen tests]# ssh ec2-user@10.20.1.13

[ec2-user@wordpress-MyInstance-xghq7ah4xu7h ~]$

Now can login the VM successfully, and can do anything in this VM.


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值