Skip to content
Snippets Groups Projects

Documentation update

Merged Jaromír Hradil requested to merge feature/S3_loadballan_terraform into master
Files
12
+ 144
7
@@ -27,7 +27,7 @@ it is a form of token-based authentication providing easy and secure access with
## Setting Up
1. [Install](https://pypi.org/project/python-openstackclient/) and
[configure](https://docs.openstack.org/python-openstackclient/rocky/configuration/index.html)
[configure](https://docs.openstack.org/python-openstackclient/train/configuration/index.html)
OpenStack CLI client.
<div style="border-width:0;border-left:5px solid #b8d6f4;background-color:rgba(255,0,0,0.3);margin:20px 0;padding:10px 20px;font-size:15px;">
@@ -39,11 +39,21 @@ it is a form of token-based authentication providing easy and secure access with
<strong>volume_api_version: 3</strong>
</div>
2. Follow the official [Launch instances](https://docs.openstack.org/nova/rocky/user/launch-instances.html) guide.
2. Follow the official [Launch instances](https://docs.openstack.org/nova/train/user/launch-instances.html) guide.
---
## Creating a key-pair
You can either get your private key from dashboard or you can use **ssh-keygen** command to create new private key:
```
ssh-keygen -b 4096
```
then you will be asked to specify output file and passphrase for your key.
1. Assuming your ssh public key is stored in `~/.ssh/id_rsa.pub`
```
openstack keypair create --public-key ~/.ssh/id_rsa.pub my-key1
@@ -74,6 +84,10 @@ openstack network create my-net1
openstack subnet create --network my-net1 --subnet-pool private-192-168 my-sub1
```
##Router management
### Router Creation
2. Create router:
```
openstack router create my-router1
@@ -99,6 +113,73 @@ openstack port create --network my-net1 --disable-port-security --fixed-ip ip-ad
```
openstack router add port my-router1 my-net1-port1-gw
```
### Clear gateway
1. Find your router:
```
$ openstack router list
+--------------------------------------+-----------------------+--------+-------+-------------+------+----------------------------------+
| ID | Name | Status | State | Distributed | HA | Project |
+--------------------------------------+-----------------------+--------+-------+-------------+------+----------------------------------+
| 0bd0374d-b62e-429a-8573-3e8527399b68 | auto_allocated_router | ACTIVE | UP | None | None | f0c339b86ddb4699b6eab7acee8d4508 |
+--------------------------------------+-----------------------+--------+-------+-------------+------+----------------------------------+
```
2. Verify:
```
$ openstack router show 0bd0374d-b62e-429a-8573-3e8527399b68
+-------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Field | Value |
+-------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| admin_state_up | UP |
| availability_zone_hints | None |
| availability_zones | None |
| created_at | 2019-06-06T04:47:15Z |
| description | None |
| distributed | None |
| external_gateway_info | {"network_id": "8d5e18ab-5d43-4fb5-83e9-eb581c4d5365", "enable_snat": true, "external_fixed_ips": [{"subnet_id": "41e0cd1c-5ab8-465f-8605-2e7d6a3fe5b4", "ip_address": "147.251.124.177"}]} |
| flavor_id | None |
| ha | None |
| id | 0bd0374d-b62e-429a-8573-3e8527399b68 |
| interfaces_info | [{"port_id": "92c3f6fe-afa8-47c6-a1a6-f6a1b3c54f72", "ip_address": "192.168.8.193", "subnet_id": "e903d5b9-ac90-4ca8-be2c-c509a0153982"}] |
| location | Munch({'cloud': '', 'region_name': 'brno1', 'zone': None, 'project': Munch({'id': 'f0c339b86ddb4699b6eab7acee8d4508', 'name': None, 'domain_id': None, 'domain_name': None})}) |
| name | auto_allocated_router |
| project_id | f0c339b86ddb4699b6eab7acee8d4508 |
| revision_number | 24 |
| routes | |
| status | ACTIVE |
| tags | |
| updated_at | 2019-06-06T06:34:34Z |
+-------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
```
3. Unset gateway (by ID of the router):
```
$ openstack router unset --external-gateway 0bd0374d-b62e-429a-8573-3e8527399b68
```
### Set Gateway
1. Choose a new external network:
```
$ openstack network list
+--------------------------------------+--------------------------+--------------------------------------+
| ID | Name | Subnets |
+--------------------------------------+--------------------------+--------------------------------------+
| 410e1b3a-1971-446b-b835-bf503917680d | public-cesnet-78-128-251 | 937106e2-3d51-43cc-83b6-c779465011e5 |
| 8d5e18ab-5d43-4fb5-83e9-eb581c4d5365 | public-muni-147-251-124 | 41e0cd1c-5ab8-465f-8605-2e7d6a3fe5b4 |
| c708270d-0545-4be2-9b8f-84cf75ce09cf | auto_allocated_network | e903d5b9-ac90-4ca8-be2c-c509a0153982 |
| d896044f-90eb-45ee-8cb1-86bf8cb3f9fe | private-muni-10-16-116 | 3d325abf-f9f8-4790-988f-9cd3d1dea4f3 |
+--------------------------------------+--------------------------+--------------------------------------+
```
2. Set the new external network for the router
```
$ openstack router set --external-gateway public-cesnet-78-128-251 0bd0374d-b62e-429a-8573-3e8527399b68
```
## Create volume
<div style="border-width:0;border-left:5px solid #b8d6f4;background-color:rgba(228,240,251,0.3);margin:20px 0;padding:10px 20px;font-size:15px;">
@@ -121,13 +202,69 @@ openstack server create --flavor "standard.small" --volume my_vol1 \
--key-name my-key1 --security-group my-security-group --network my-net1 my-server1
```
## Assign floating ip address
## Floating ip address management
### Creating and assigning new FIP
1. Allocate new Floating IPs:
```
$ openstack floating ip create public-cesnet-78-128-251
+---------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Field | Value |
+---------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| created_at | 2019-06-06T06:56:51Z |
| description | |
| dns_domain | None |
| dns_name | None |
| fixed_ip_address | None |
| floating_ip_address | 78.128.251.27 |
| floating_network_id | 410e1b3a-1971-446b-b835-bf503917680d |
| id | d054b6b3-bbd3-485d-a46b-b80682df8fc8 |
| location | Munch({'cloud': '', 'region_name': 'brno1', 'zone': None, 'project': Munch({'id': 'f0c339b86ddb4699b6eab7acee8d4508', 'name': None, 'domain_id': None, 'domain_name': None})}) |
| name | 78.128.251.27 |
| port_details | None |
| port_id | None |
| project_id | f0c339b86ddb4699b6eab7acee8d4508 |
| qos_policy_id | None |
| revision_number | 0 |
| router_id | None |
| status | DOWN |
| subnet_id | None |
| tags | [] |
| updated_at | 2019-06-06T06:56:51Z |
+---------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
```
2. And assign it to your server:
1. Create and assign floating IP address:
```
FLOAT_IP=$(openstack floating ip create --description my-float1 -c floating_ip_address -f value public-muni-147-251-124)
openstack server add floating ip my-server1 $FLOAT_IP
$ openstack server add floating ip net-test1 78.128.251.27
```
### Remove existing floating ip
1. List your servers:
```
$ openstack server list
+--------------------------------------+-----------+--------+-------------------------------------------------------+-------+----------------+
| ID | Name | Status | Networks | Image | Flavor |
+--------------------------------------+-----------+--------+-------------------------------------------------------+-------+----------------+
| 1a0d4624-5294-425a-af37-a83eb0640e1c | net-test1 | ACTIVE | auto_allocated_network=192.168.8.196, 147.251.124.248 | | standard.small |
+--------------------------------------+-----------+--------+-------------------------------------------------------+-------+----------------+
```
2. remove floating ips:
```
$ openstack server remove floating ip net-test 147.251.124.248
$ openstack floating ip delete 147.251.124.248
```
## Cloud tools
You can inspect cloud tools [here](/tools)
## Full Reference
See [OpenStack CLI Documentation](https://docs.openstack.org/python-openstackclient/rocky/).
See [OpenStack CLI Documentation](https://docs.openstack.org/python-openstackclient/train/).
Loading