# source keystonerc_admin
# openstack project create --domain Default --description "cli-project" cli-project
# openstack project list
# openstack user create --domain Default --project cli-project --password-prompt cli-user
# openstack user list
# openstack role add --project cli-project --user cli-user _member_
# openstack flavor create --id 6 --vcpus 1 --ram 1024 --disk 10 m1.micro
# openstack network create --project admin --provider-network-type flat --provider-physical-network extnet --external External-Network
# openstack network list // 네트워크 리스트 확인
# openstack subnet create --network External-Network --project admin --subnet-range 192.168.0.0/20 --allocation-pool start=192.168.8.129,end=192.168.8.254 --gateway 192.168.0.1 --no-dhcp External-Subnet
# vi keystonerc_cli-user
unset OS_SERVICE_TOKEN
export OS_USERNAME=cli-user
export OS_PASSWORD='#########'
export OS_REGION_NAME=RegionOne
export OS_AUTH_URL=http://192.168.0.##:5000/v3
export PS1='[\u@\h \W(keystone_cli-user)]\$ '
export OS_PROJECT_NAME=cli-project
export OS_USER_DOMAIN_NAME=Default
export OS_PROJECT_DOMAIN_NAME=Default
export OS_IDENTITY_API_VERSION=3
# vi /etc/neutron/policy.yaml
"create_network:provider:network_type": "role:admin or project_id:%(project_id)s"
"create_floatingip:floating_ip_address": "role:admin or project_id:%(project_id)s"
# openstack network create --project $projectID --provider-network-type vxlan Internal-Network
openstack subnet create --network Internal-Network --subnet-range 10.22.0.0/20 --gateway 10.22.0.1 --dhcp --dns-nameserver 8.8.8.8 Internal-Subnet
# openstack router create Router
# openstack router set --external-gateway External-Network Router
# openstack router add subnet Router Internal-Subnet
# openstack security group create SG-WEB
# openstack security group rule create --protocol icmp --ingress SG-WEB
# openstack security group rule create --protocol tcp --dst-port 22:22 SG-WEB
# openstack security group rule create --protocol tcp --dst-port 80:80 SG-WEB
# openstack security group create SG-DB
# openstack keypair create --public-key ~/.ssh/id_rsa.pub cli-key
openstack image create --file CentOS-7-x86_64-GenericCloud-2111.qcow2
--disk-format qcow2 --container-format bare CentOS7
CentOS7
Ubuntu18
# openstack floating ip create External-Network
# openstack floating ip list
# openstack floating ip create --floating-ip-address 192.168.8.222 External-Network
# openstack server create --flavor m1.micro --image CentOS7 --security-group SG-WEB --network Internal-Network --boot-from-volume 10 --key-name cli-key --user-data httpd.file WEBSERVER
# openstack server add floating ip WEBSERVER 192.168.8.222
# openstack server create --flavor m1.micro --image Ubuntu18 --security-group SG-DB --network Internal-Network --boot-from-volume 10 --key-name cli-key DBSERVER