创建网络==>根据网络创建子网。
创建路由==>将路由和子网绑定。
创建安全组==>给安全组添加规则
创建浮动ip==>绑定虚机port-id
查看域
neutron availability-zone-list
创建网络
neutron net-create test_net --availability-zone-hint
删除网络
neutron net-delete net_id
创建子网
neutron subnet-create test_net 192.168.10.0/24 --name test_subnet
删除子网
neutron subnet-delete subnet_id
创建路由
neutron router-create test_router
路由和网络绑定
neutron router-interface-add test_router test_subnet
路由和网络解绑
在删除网络和路由时,要先进行解绑才可删除。
neutron router-interface-delete test_router test_subnet
创建安全组
neutron security-group-create test_group
删除安全组
neutron security-group-delete group_id
安全组放通规则
neutron security-group-rule-create test_group --direction ingress --ethertype IPv4 --remote-ip-prefix 0.0.0.0/0 --protocol none
查询availability-zone
nova availability-zone-list
查询az
nova service-list
查询flavor
nova flavor list
创建虚机(net-id为neutron subnet-show test-subnet看到的network id)
nova boot vm01 --flavor <flavor-id> --nic net-id=<network_id> --block-device source=image,id=id,dest=volume,volumetype=<volume_type>,size=<volume_size>,shutdown=remove,bootindex=0 --availability-zone <test_zone> --security-groups <group_id>
查看浮动ip列表
neutron floatingip-list
查看浮动ip的详细信息
neutron floatingip-show <floatingip_uuid>
删除浮动ip
neutron floatingip-delete <floatingip_uuid>
创建浮动IP
neutron floatingip-create <ext_net_id>
虚拟机绑定浮动IP
neutron floatingip-associate <floatingip_uuid> --port-id <vm_port_id>
查询net-id
neutron net-show net-id
查询port id
neutron port-list | grep subnet-id
解绑
neutron floatingip-disassociate <floatingip_uuid>
创建volume
cinder create --name test-data --volume-type type
删除volume
cinder delete <volume-id>
强制删除
cinder force-delete <volume-id>
挂载volume
nova volume-attach <server-id> <volume-id>
卸载volume
nova volume-detach <server-id> <volume-id>
修改规格
nova resize <server-id>
vnc登录
nova get-vnc-console <server-id> novnc