1、创建flavor
nova flavor- create - - is - public true dcTest_ram_1024_disk_1_vcpus_1 dcTest_ram_1024_disk_1_vcpus_1 1024 1 1
nova flavor- list
nova flavor- show dcTest_ram_1024_disk_1_vcpus_1
2、创建网络
openstack network create \
- - share - - external \
- - provider- physical- network provider \
- - provider- network- type flat provider
openstack subnet create \
- - network provider \
- - allocation- pool start= 10.0 .10 .100 , end= 10.0 .10 .250 \
- - dns- nameserver 8.8 .8 .8 \
- - gateway 10.0 .10 .1 \
- - subnet- range 10.0 .10 .0 / 24 provider
openstack network list
3、创建安全组
openstack help security
usage: openstack security group create
[ - h] [ - f { json, shell, table, value, yaml} ]
[ - c COLUMN] [ - - max - width < integer> ]
[ - - fit- width] [ - - print - empty]
[ - - noindent] [ - - prefix PREFIX]
[ - - description < description> ]
[ - - project < project> ]
[ - - project- domain < project- domain> ]
[ - - tag < tag> | - - no- tag]
< name>
openstack security group create dcTest
openstack security group list
4、创建密钥对
[ root@controller openstack]
usage: openstack keypair create [ - h] [ - f { json, shell, table, value, yaml} ]
[ - c COLUMN] [ - - max - width < integer> ]
[ - - fit- width] [ - - print - empty] [ - - noindent]
[ - - prefix PREFIX]
[ - - public- key < file > | - - private- key < file > ]
< name>
openstack keypair create dc_key
openstack keypair list
5、获取计算节点的host和zone名称
nova service- list
6、创建实例
[ root@controller openstack]
usage: nova boot [ - - flavor < flavor> ] [ - - image < image> ]
[ - - image- with < key= value> ] [ - - boot- volume < volume_id> ]
[ - - snapshot < snapshot_id> ] [ - - min - count < number> ]
[ - - max - count < number> ] [ - - meta < key= value> ]
[ - - key- name < key- name> ] [ - - user- data < user- data> ]
[ - - availability- zone < availability- zone> ]
[ - - security- groups < security- groups> ]
[ - - block- device- mapping < dev- name= mapping> ]
[ - - block- device key1= value1[ , key2= value2. . . ] ]
[ - - swap < swap_size> ]
[ - - ephemeral size= < size> [ , format = < format > ] ]
[ - - hint < key= value> ]
[ - - nic < auto, none, net- id = net- uuid, net- name= network- name, port- id = port- uuid, v4- fixed- ip= ip- addr, v6- fixed- ip= ip- addr, tag= tag> ]
[ - - config- drive < value> ] [ - - poll] [ - - admin- pass < value> ]
[ - - access- ip- v4 < value> ] [ - - access- ip- v6 < value> ]
[ - - description < description> ] [ - - tags < tags> ]
[ - - return - reservation- id ]
[ - - trusted- image- certificate- id < trusted- image- certificate- id > ]
[ - - host < host> ] [ - - hypervisor- hostname < hypervisor- hostname> ]
< name>
nova boot - - flavor dcTest_ram_1024_disk_1_vcpus_1 \
- - image cc034914- 479d - 4a71 - bf64- 2d8b67a15199 \
- - nic net- id = 8d9b550d - 0ef4 - 468b - acd9- 24c015f16222 \
- - security- groups f47ca95b- d699- 4aad - 8cc7 - 53b0d3947238 \
- - availability- zone nova \
- - host controller \
- - key- name dc_key \
dcTestInstance
7、查看创建的实例
nova list