OpenStack之九: 创建一个实例

官网地址
https://docs.openstack.org/install-guide/launch-instance-networks-provider.html

#:导入变量

[root@cobbler ~]# source scripts/admin-stein.sh

#:创建一个网络

[root@cobbler ~]# openstack network create  --share --internal --provider-physical-network external --provider-network-type flat external-net

#:创建一个子网

[root@cobbler ~]# openstack subnet create --network external-net --allocation-pool start=192.168.6.100,end=192.168.6.200 --dns-nameserver 172.16.0.1 --gateway 192.168.7.254 --subnet-range 192.168.0.0/21 external-sub
官网地址
https://docs.openstack.org/install-guide/launch-instance.html#launch-instance-networks

#:创建一个镜像

[root@cobbler ~]# openstack flavor create --id 0 --vcpus 1 --ram 64 --disk 1 m1.nano

#:导入环境变量

[root@cobbler ~]# source scripts/admin-stein.sh 

#:创建Key

[root@cobbler ~]# ssh-keygen -q -N ""
[root@cobbler ~]# openstack keypair create --public-key ~/.ssh/id_rsa.pub mykey

#:列出key

[root@cobbler ~]# openstack keypair list

#:创建安全组

[root@cobbler ~]# openstack security group rule create --proto icmp default
[root@cobbler ~]#  openstack security group rule create --proto tcp --dst-port 22 default

 


 

官网地址
https://docs.openstack.org/install-guide/launch-instance-provider.html

#:导入环境变量

[root@cobbler ~]# source scripts/demo-stein.sh

#:测试

[root@cobbler ~]# openstack flavor list
[root@cobbler ~]# openstack image list
[root@cobbler ~]# openstack network list
[root@cobbler ~]# openstack security group list

#:创建一个实例

[root@cobbler ~]# openstack server create --flavor m1.nano --image cirros-0.4.0 --nic net-id=9c0a0cb4-73ee-4335-87d7-1baa93cd1db0 --security-group default --key-name mykey linux37-vm1


#:查看

[root@cobbler ~]# openstack server list

 

posted @ 2019-08-31 11:41  Linus小跟班  阅读(1195)  评论(0编辑  收藏  举报