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
Merge requests
!43
OpenStack CLI how-to
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
OpenStack CLI how-to
feat/openstack-cli
into
master
Overview
4
Commits
2
Pipelines
7
Changes
2
Merged
Josef Němec
requested to merge
feat/openstack-cli
into
master
2 years ago
Overview
4
Commits
2
Pipelines
7
Changes
2
Expand
0
0
Merge request reports
Compare
master
version 1
ffe2d3f2
2 years ago
master (base)
and
version 1
latest version
2a8bdf3e
2 commits,
2 years ago
version 1
ffe2d3f2
1 commit,
2 years ago
2 files
+
89
−
0
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
2
Search (e.g. *.vue) (Ctrl+P)
topics/compute/openstack/docs/how-to-guides/command-line-interface.md
0 → 100644
+
88
−
0
Options
---
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
Loading