Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
documentation
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Harbor Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
e-INFRA.cz
documentation
Commits
ffe2d3f2
Verified
Commit
ffe2d3f2
authored
2 years ago
by
Josef Němec
Browse files
Options
Downloads
Patches
Plain Diff
OpenStack CLI how-to
parent
8048683c
No related branches found
No related tags found
1 merge request
!43
OpenStack CLI how-to
Pipeline
#267475
waiting for manual action
Stage: deploy
Changes
2
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
topics/compute/openstack/docs/how-to-guides/command-line-interface.md
+88
-0
88 additions, 0 deletions
...te/openstack/docs/how-to-guides/command-line-interface.md
topics/compute/openstack/mkdocs.yml
+1
-0
1 addition, 0 deletions
topics/compute/openstack/mkdocs.yml
with
89 additions
and
0 deletions
topics/compute/openstack/docs/how-to-guides/command-line-interface.md
0 → 100644
+
88
−
0
View file @
ffe2d3f2
---
title
:
Command Line Interface
search
:
exclude
:
false
---
# Command Line Interface
## Getting Application Credentials
In order to have access to OpenStack's API, you have to use so-called OpenStack Application Credentials. In short,
it is a form of token-based authentication providing easy and secure access without the use of passwords.
There is a comprehensive guide for
[
Obtaining API Key
](
../how-to-guides/obtaining-api-key.md
)
.
## Create a key-pair
You can either get your private key from the dashboard or you can use
**ssh-keygen**
command to create a new private key:
```
ssh-keygen -b 4096
```
then you will be asked to specify the 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
```
## Create a security group
1.
Create:
```
openstack security group create my-security-group
```
2.
Add rules to your security group:
```
openstack security group rule create --description "Permit SSH" --remote-ip 0.0.0.0/0 --protocol tcp --dst-port 22 --ingress my-security-group
openstack security group rule create --description "Permit ICMP (any)" --remote-ip 0.0.0.0/0 --protocol icmp --icmp-type -1 --ingress my-security-group
```
3.
Verify:
```
openstack security group show my-security-group
```
## Create networking
Refer to the CLI section of
[
Create Networking
](
../how-to-guides/create-networking.md
)
.
## Create router
Refer to the CLI section of
[
Create Router
](
../how-to-guides/create-router.md
)
.
## Create volume
!!! caution
Skipping this section can lead to unreversible loss of data!
Volumes are created automatically when creating an instance in GUI, but we need to create them manually in the case of CLI
1.
Create bootable volume from image(e.g. centos):
```
openstack volume create --image "centos-7-1809-x86_64" --size 40 my_vol1
```
## Create server
1.
Create the instance:
```
openstack server create --flavor "standard.small" --volume my_vol1 \
--key-name my-key1 --security-group my-security-group --network my-net1 my-server1
```
## Floating IP address management
Refer to the CLI section of
[
Managing Floating IPs
](
../how-to-guides/managing-floating-ips.md
)
.
## Cloud tools
You might want to manage resources
[
Using Cloud Tools
](
../additional-information/using-cloud-tools.md
)
.
## Full Reference
See
[
OpenStack CLI Documentation
](
https://docs.openstack.org/python-openstackclient/train/
)
.
\ No newline at end of file
This diff is collapsed.
Click to expand it.
topics/compute/openstack/mkdocs.yml
+
1
−
0
View file @
ffe2d3f2
...
...
@@ -12,6 +12,7 @@ nav:
-
how-to-guides/attaching-interface.md
# - how-to-guides/attaching-remote-storage.md
-
how-to-guides/changing-vm-resources.md
-
how-to-guides/command-line-interface.md
-
how-to-guides/create-networking.md
-
how-to-guides/create-router.md
-
how-to-guides/deploying-loadbalancers.md
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment