标签:
============================================================================================================
上传镜像 ===kilo new=== glance image-create --name "cirros2" --file cirros-0.3.4-x86_64-disk.img --disk-format qcow2 --container-format bare --visibility public --progress ===kilo old=== glance image-create --name "cirros" --file cirros-0.3.4-x86_64-disk.img --disk-format qcow2 --container-format bare --is-public True --progress 用户admin source /home/admin-openrc.sh 创建外网 neutron net-create ext-net --router:external --provider:physical_network external --provider:network_type flat 创建外网子网 neutron subnet-create ext-net 9.111.222.0/24 --name ext-subnet --allocation-pool start=9.111.222.241,end=9.111.222.250 --disable-dhcp --gateway 9.111.222.1
用户demo source /home/demo-openrc.sh
创建网络 neutron net-create demo-net
创建网络子网 neutron subnet-create demo-net 192.168.1.0/24 --name demo-subnet --gateway 192.168.1.1 创建路由 neutron router-create demo-router
把子网绑到路由上 neutron router-interface-add demo-router demo-subnet 设置路由器网关出外网 neutron router-gateway-set demo-router ext-net 准备启动虚机进行key设置 nova keypair-add demo-key nova keypair-add demo-key 启动虚机 nova boot --flavor m1.tiny --image cirros-0.3.4-x86_64 --nic net-id=f685957e-fe1e-4756-b7cf-a345af734a72 --security-group default --key-name demo-key demo-instance1 得到虚机vnc的ip地址 nova get-vnc-console demo-instance1 novnc 设置安全访问规则 nova secgroup-add-rule default icmp -1 -1 0.0.0.0/0 nova secgroup-add-rule default tcp 22 22 0.0.0.0/0 得到浮动ip neutron floatingip-create ext-net => get a floating ip 例如: 9.111.222.243
分配浮动ip nova floating-ip-associate demo-instance1 9.111.222.243
这样就可以直接从外网ssh到这个虚机上了
ssh cirros@9.111.222.243 ==============================================================================================================
openstack 上床镜像, 创建网络, 创建虚拟机 命令
标签:
原文地址:http://www.cnblogs.com/juandx/p/4826935.html