Last active
November 13, 2018 10:27
-
-
Save mangelajo/072224626dc8221fc6de2dfae23056e3 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
source ~/overcloudrc | |
curl https://cloud.centos.org/centos/7/images/CentOS-7-x86_64-GenericCloud.qcow2c > \ | |
CentOS-7-x86_64-GenericCloud.qcow2c | |
openstack image create "centos7" --file CentOS-7-x86_64-GenericCloud.qcow2c \ | |
--disk-format qcow2 --container-format bare \ | |
--public | |
curl -k https://ajo.es/binaries/cirros-0.4.0-x86_64-disk.img > cirros-0.4.0-x86_64-disk.img | |
openstack image create "cirros" --file cirros-0.4.0-x86_64-disk.img \ | |
--disk-format qcow2 --container-format bare \ | |
--public | |
openstack network create public --provider-physical-network datacentre \ | |
--provider-network-type vlan \ | |
--provider-segment 10 \ | |
--external --share || \ | |
openstack network create public --provider-physical-network datacentre \ | |
--provider-network-type flat \ | |
--external --share | |
openstack subnet create --network public public --subnet-range 10.0.0.0/24 \ | |
--allocation-pool start=10.0.0.20,end=10.0.0.250 \ | |
--dns-nameserver 8.8.8.8 --gateway 10.0.0.1 \ | |
--no-dhcp | |
openstack network create private | |
openstack subnet create --network private private --subnet-range 192.168.99.0/24 | |
openstack router create router1 | |
neutron router-gateway-set router1 public | |
neutron router-interface-add router1 private | |
openstack security group create test | |
openstack security group rule create --ingress --protocol tcp --dst-port 22 test | |
openstack security group rule create --ingress --protocol icmp test | |
openstack security group rule create --egress test | |
openstack flavor create m1.tiny --disk 1 --vcpus 1 --ram 64 | |
openstack flavor create m1.medium --disk 10 --vcpus 1 --ram 512 | |
PRIV_NET=$(openstack network show private -c id -f value) | |
openstack server create --flavor m1.tiny --image cirros --nic net-id=$PRIV_NET \ | |
--security-group test --min 3 --max 3 cirros | |
for n in $(seq 0 2); do | |
echo creating FIP 10.0.0.13$n | |
openstack floating ip create --floating-ip-address 10.0.0.13$n public | |
done | |
cports=( $(openstack port list --device-owner compute:nova -c ID -f value) ) | |
for n in $(seq 0 2); do | |
echo attaching FIP 10.0.0.13$n | |
openstack floating ip set --port ${cports[$n]} 10.0.0.13$n | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment