Skip to content

Openstack Usage and Examples

T20A02 edited this page Nov 10, 2023 · 10 revisions

Openstack Usage

This short guide will outline the usage of some simple commands for openstack/microstack. This includes service usage, dashboard settings, and more.

Services

To Check running services

microstack.openstack catalog list

Output Example:

image


List Microstack users

microstack.openstack user list

Output Example

image


List available images

``microstack.openstack image list```

Example Output:

image


List system networks

microstack.openstack network list

Example Output

image


List Hypervisor hosts

microstack.openstack hypervisor list

Example Output

image

Dashboard Settings

Configuring themes

Themes can be changed in the login menu from the webpage.

Example:

image


Changing User Password:

The User password for the Openstack dashboard can be changed if know, by going to Settings > Change Password.

Example

image

If the Password is not known, it can be retrieved from the CLI on the host:

sudo snap get microstack config.credentials.keystone-password

Example Output

image

Managing Templates

Managing templates can be done from the web dashboard, this includes managing images, and templates.

To create an image navigate to Admin > Compute > images

Here you can list and search images available to the system


Flavors

Flavors are a crucial part of your workflow with openstack, allowing you to create hardware templates to allow the quick creation of new guests

To create a new flavor, from cli run the following and replacing the resources respectively with what is needed

microstack.openstack flavor create --ram 1024 --disk 10 --vcpus 1 testflavor

Example Output

image


List the flavors on the system:

microstack.openstack flavor list

Example output

image

This can also be managed through the flavors tab of the dashboard at Admin > Compute > Flavors.

Here you can and remove flavors from the system dashboard

Domain / identities

In this section we are outlining the commands and usage for creating, and changes domains in openstack, not to be confused with domains related to AD

Create a new Domain

microstack.openstack domain create --description "DESCRIPTION" domain.local

Example output:

image


List domains

microstack.openstack domain list

Example:

image


Create domain user's

microstack.openstack user create --domain domain.local --password username passsword

Example:

image


Creating roles

microstack.openstack role add --domain domain.local --user-domain domain.local --user username password

No output is provided form this command

Note: To allow multi domain logins on the web page, you need to append the following config file to allow the domain entry box to be used at the login screen:

Command:

image


Managing Roles

To add a new role:

microstack.openstack role create _member_

Example:

image

To add a new project:

microstack.openstack project create --domain domain.local projectname

Example:

image

To List projects:


**Example:**

![image](https://github.com/T20A026/SYS-350-Enterprise-Virtualization/assets/70958837/6e4b1054-8be8-4e12-9965-69cc66587911)

These Same actions can be achived via the web UI, found in "Identity > Projects"

![image](https://github.com/T20A026/SYS-350-Enterprise-Virtualization/assets/70958837/c18ef7a5-acfb-4aa6-b3cb-e01a0720e95b)

***

### Managing User's and groups

To create a domain user:

```microstack.openstack user create --domain domain.local --password password username```

**Example:**

![image](https://github.com/T20A026/SYS-350-Enterprise-Virtualization/assets/70958837/dbb0d5ae-a2c9-4ef5-9155-a34a56c810f5)

To List Users:

```microstack.openstack user list --domain domain.local```

**Example:**

![image](https://github.com/T20A026/SYS-350-Enterprise-Virtualization/assets/70958837/7fe9db05-dab3-4bab-a9f9-278cd1648440)

To Create a new group:

```microstack.openstack group create --domain domain.local grouname```

**Example:**

![image](https://github.com/T20A026/SYS-350-Enterprise-Virtualization/assets/70958837/b2bb88d6-3b90-4ead-9ab3-d2a0e08d2bb2)

To list groups:

```microstack.openstack group list --domain domain.local```

**Example:**

![image](https://github.com/T20A026/SYS-350-Enterprise-Virtualization/assets/70958837/340ca3a9-c22c-40fa-ad7b-f04e3a808990)

***

### Managing membership and assignments

To add a user to a group:

```microstack.openstack group add user --group-domain domain.local --user-domain domain.local group username```

To assign a group to a rile:

```microstack.openstack role add --project projectname --project-domain domain.local --group groupname --group-domain domain.local group```

***

### Elevating domain user's

Finishing making the domain admin account an administrator

```microstack.openstack role add --project myproject --project-domain mydomain --user admin --user-domain mydomain admin```

Then make some changes to the RC file

Download the new RC file from the top left user menu:

Then rename it:

```mv ~/Downloads/myproject-openrc.sh ~/Downloads/admin-openrc.sh```

Then Execute it with:

```source ~/Downloads/admin-openrc.sh```

***

## Tenancy

### Fix's and tenancy

We had to install some further packages to have the command work correctly. Run the following to fix issues with tenancy changes:

```sudo apt install python3-openstackclient```

Now that that has been installed you can call openstack without microstack:

List active running images:

![image](https://github.com/T20A026/SYS-350-Enterprise-Virtualization/assets/70958837/87c5be2e-3cff-4814-858f-5760cc52d1f7)

To Create Tenancy keypairs:

```openstack keypair create --private-key ./mykeypair.pem --type ssh mykeypair```

**Example:**

![image](https://github.com/T20A026/SYS-350-Enterprise-Virtualization/assets/70958837/be6e774d-7ec5-4900-b751-5671596dcb85)

To list keypairs:

```openstack keypair list```

**Example:**

![image](https://github.com/T20A026/SYS-350-Enterprise-Virtualization/assets/70958837/7ac95414-c9f0-41bb-9864-d836d750b9de)

***

## Network

Create a new network:

```openstack --insecure network create networkname```

**Example**

![image](https://github.com/T20A026/SYS-350-Enterprise-Virtualization/assets/70958837/fcde55a1-1308-45cd-af36-67b45691cd8b)

List Networks:

```openstack --insecure network list```

**Example**

![image](https://github.com/T20A026/SYS-350-Enterprise-Virtualization/assets/70958837/e3b0b625-64c9-432e-bd5b-2a9bc5b3c7d6)

Clone this wiki locally