Created
September 4, 2016 14:50
-
-
Save vinzent/799563b21f205e41f947dc05d036356b to your computer and use it in GitHub Desktop.
This file contains 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
nova keypair-add --pub-key ~/.ssh/id_rsa.pub tmueller | |
get_floating_ip() { | |
openstack ip floating list -f value -c "Floating IP Address" -c Port | grep 'None' | head -1 | cut -f1 -d" " | |
} | |
neutron net-create --port_security_enabled=False NetA | |
neutron subnet-create --name NetA_Sub1 --no-gateway --disable-dhcp NetA 192.168.0.0/24 | |
neutron net-create --port_security_enabled=False NetB | |
neutron subnet-create --name NetB_Sub1 --no-gateway --disable-dhcp NetB 192.168.1.0/24 | |
neutron net-create --port_security_enabled=False NetC | |
neutron subnet-create --name NetC_Sub1 --no-gateway --disable-dhcp NetC 192.168.2.0/24 | |
neutron net-create --port_security_enabled=False NetD | |
neutron subnet-create --name NetD_Sub1 --no-gateway --disable-dhcp NetD 192.168.3.0/24 | |
neutron port-create --name NetA_Port1 NetA | |
neutron port-create --name NetB_Port1 NetB | |
neutron port-create --name NetB_Port2 NetB | |
neutron port-create --name NetC_Port1 NetC | |
neutron port-create --name NetD_Port1 NetD | |
nova boot --flavor c1.micro --image "Debian Jessie 8.1 (SWITCHengines)" \ | |
--key-name=tmueller --nic net-name=private --poll r1 & | |
nova boot --flavor c1.micro --image "Debian Jessie 8.1 (SWITCHengines)" \ | |
--key-name=tmueller --nic net-name=private --poll r2 & | |
wait | |
nova interface-attach --port-id $(neutron port-show -F id -f value NetA_Port1) r1 | |
nova interface-attach --port-id $(neutron port-show -F id -f value NetB_Port1) r1 | |
nova interface-attach --port-id $(neutron port-show -F id -f value NetB_Port2) r2 | |
nova interface-attach --port-id $(neutron port-show -F id -f value NetC_Port1) r2 | |
nova interface-attach --port-id $(neutron port-show -F id -f value NetD_Port1) r2 | |
openstack ip floating add $(get_floating_ip) r1 | |
openstack ip floating add $(get_floating_ip) r2 |
Funktioniert nicht:
nova boot --flavor c1.micro --image "Debian Jessie 8.1 (SWITCHengines)" \
--key-name=tmueller --nic net-name=private --nic port-id=6be7a11d-cd4d-42c7-b0df-45ea775a2381 --poll r1
Output:
(venv) [tmueller@tmueller-notebook python]$ nova boot --flavor c1.micro --image "Debian Jessie 8.1 (SWITCHengines)" \
> --key-name=tmueller --nic net-name=private --nic port-id=6be7a11d-cd4d-42c7-b0df-45ea775a2381 --poll r1
+--------------------------------------+--------------------------------------------------------------------------+
| Property | Value |
+--------------------------------------+--------------------------------------------------------------------------+
| OS-DCF:diskConfig | MANUAL |
| OS-EXT-AZ:availability_zone | nova |
| OS-EXT-STS:power_state | 0 |
| OS-EXT-STS:task_state | scheduling |
| OS-EXT-STS:vm_state | building |
| OS-SRV-USG:launched_at | - |
| OS-SRV-USG:terminated_at | - |
| accessIPv4 | |
| accessIPv6 | |
| adminPass | vUwYNevcbT28 |
| config_drive | |
| created | 2016-09-06T14:57:19Z |
| flavor | c1.micro (baaba9ad-9ee5-4f1d-a7a1-dd4b55c18b63) |
| hostId | |
| id | 423cfe15-a504-4ce3-a61d-61a0c0293438 |
| image | Debian Jessie 8.1 (SWITCHengines) (f59d75e1-a648-44be-8495-1d57541f16e8) |
| key_name | tmueller |
| metadata | {} |
| name | r1 |
| os-extended-volumes:volumes_attached | [] |
| progress | 0 |
| security_groups | default |
| status | BUILD |
| tenant_id | b296d585336a466ea080f2465600e2e1 |
| updated | 2016-09-06T14:57:19Z |
| user_id | 6418adaa33c2444bafcf22ff0a967f37 |
+--------------------------------------+--------------------------------------------------------------------------+
Server building... 0% complete
Error building server
ERROR (ResourceInErrorState): <Server: r1>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Delete all!