前几个月写的,现在用不上了,留下框子做个备忘
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
#!/bin/sh net_test="public_oam" subnet_test="public_oam_subnet" source /root/admin-openrc #create NET neutron net-create --provider:network_type flat --provider:physical_network provider --shared $net_test #create SUB_NET net_test_id=`neutron net-list | grep $net_test |awk -F'|' '{print $2}'` neutron subnet-create $net_test 192.168.10.0/24 --allocation-pool start=192.168.10.10,end=192.168.10.20 --ip-version 4 --name $subnet_test #create PORT subnet_test_id=$(echo `neutron subnet-list | grep $subnet_test |awk -F'|' '{print $2}'`) neutron port-create $net_test_id --fixed-ip subnet_id=$subnet_test_id,ip_address=192.168.10.12 --name port_test #create instance PORT_ID1=`openstack port list | grep port_test | awk '{print $2}'` nova boot --poll --image cirros-0.3.5-x86_64-disk --flavor=m1.tiny --meta RESERVE01=1 --meta RESERVE02=1 \ --availability-zone nova --nic port-id=${PORT_ID1} instance_test |