-
Notifications
You must be signed in to change notification settings - Fork 0
Milestone9:OpenstackTutorials
Replace openstack with microstack.openstack
Run through the openstack ubuntu tutorials: https://ubuntu.com/openstack/tutorials
List all active openstack services with sudo microstack.openstack catalog list
List all active users with sudo microstack.openstack user list
List all images on the server with sudo microstack.openstack image list
List all the virtual networks on the server with sudo microstack.openstack network list
List the hypervisors with sudo microstack.openstack hypervisor list
This tutorial just goes over how to navigate the dashboard. I want to be able to reference it later, but I don't feel like taking notes on everything at this moment
https://ubuntu.com/tutorials/navigate-through-the-openstack-dashboard-menu#1-overview
You can create a new user with sudo microstack.openstack create user --project [project name - I used admin] --password [new user password] [new user username]
I don't have a screenshot of my output since it would show my password but this is how it should look

Download the image from this page: https://ubuntu.com/tutorials/manage-instance-templates-including-images-and-flavors#2-manage-images
Upload it to the openstack server with:
openstack image create --disk-format qcow2 --min-disk 8 --min-ram 512 --file ~/Downloads/focal-server-cloudimg-amd64-disk-kvm.img --private ubuntu-focal
This allows for 8gb minimum disk size and 512gb minimum RAM
Then list the images

You can do the same thing with the web ui
Go to project > compute > images, and create a new image


You can also create new flavors with open stack, you can run this command to make a new flavor with 1GB ram, 10 gb disk space, and 1 cpu
microstack.openstack flavor create --ram 1024 --disk 10 --vcpus 1 myflavor

List all the flavors with microstack.openstack flavor list

Through the web ui you can manage images by going to admin > compute > flavors


Create a new domain with microstack.openstack domain create mydomain, list active domains with microstack.openstack domain list

Create a domain user microstack.openstack user create --domain mydomain --password admin admin and add them to a role with microstack.openstack role add --domain mydomain --user-domain mydomain --user admin admin

Create a role called member and list all roles with the following:
microstack.openstack role create _member_microstack.openstack role list

Create a project and list all projects
microstack.openstack project create --domain mydomain myprojectmicrostack.openstack project list --domain mydomain
Create projects with the web ui
- Identity > projects, click create projects
Create and list all users
microstack.openstack user create --domain mydomain --password mypassword myusermicrostack.openstack user list --domain mydomain
Create and list groups
microstack.openstack group create --domain mydomain mygroupmicrostack.openstack group list --domain mydomain
Manage grouand users through the web ui
- Identity > Users
- Identity > Groups
Add a user to a group and assign the member role to a group in a project:
microstack.openstack group add user --group-domain mydomain --user-domain mydomain mygroup myusermicrostack.openstack role add --project myproject --project-domain mydomain --group mygroup --group-domain mydomain member
Assign roles to a user in the domain (finishing setting up the domain user)
microstack.openstack role add --project myproject --project-domain mydomain --user admin --user-domain mydomain membermicrostack.openstack role add --project myproject --project-domain mydomain --user admin --user-domain mydomain admin
This seems to be going over everything we've already learned from another perspective, so I will summarize:
Openstack supports multi-tenancy, which is the ability to manage multiple organizations within the form of domains, and multiple subsets of organizations in the form of projects. This allows users within a domain to only see and manage their own domain, and does not allow them to see the domains of other organizations.
I was not able to log in as "myuser" but we also learned how to create a list keypairs:
microstack.openstack keypair create --private-key ./mykeypair.pem --type ssh mykeypairmicrostack.openstack keypair list
From here on out I am not doing all of this because I don't want to set up a whole redundant network
You can view your network topology in Project > Network > Network Topology

You can create and list networks and subnets with the following commands:
-
microstack.openstack network create mynetwork -
microstack.openstack network list -
microstack.openstack subnet create --network mynetwork --subnet-range 192.168.0.0/24 --allocation-pool start=192.168.0.101,end=192.168.0.200 --dns-nameserver 8.8.8.8 mysubnet -
microstack.openstack subnet list
You can also do all of this in Project > Network > Network topology
To create and manage routers, use the following command:
microstack.openstack router create myroutermicrostack.openstack router list-
microstack.openstack router set --external-gateway external-network myrouter- sets the external gateway network for the router -
microstack.openstack router add subnet myrouter mysubnet- adds the router to a subnet
This can also be done in Project > Network > Routers
Allocate and list floating ips:
microstack.openstack floating ip create external-networkmicrostack.openstack floating ip list
This can also be done in Project > Network > Floating IPs
Manage Security groups:
microstack.openstack security group create mysecuritygroupmicrostack.openstack security group list-
microstack.openstack security group rule create --remote-ip 0.0.0.0/0 --dst-port 22:22 --protocol tcp --ingress mysecuritygroup- adds a rule to the security group -
microstack.openstack security group rule list mysecuritygroup- list all rules in the security group
This can also be done in Project > Network > Security Groups
Launch and list instances
microstack.openstack server create --flavor myflavor --image ubuntu --network mynetwork --key-name mykeypair --min 2 --max 2 myinstancemicrostack.openstack server list
This can also be done in Project > Compute > Instances
Associate a floating ip:
IP=$(microstack.openstack floating ip list | tail -n 2 | head -n 1 | awk '{print $4}')microstack.openstack server add floating ip myinstance-1 $IP
This can also be done in Project > Compute > Instances > Action on the instance
Attach a security group
Start by modifying the permissions in the keypair file
chmod 0400 ~/Downloads/mykeypair.pem
If you attempt to ssh, like so:
IP=$(microstack.openstack floating ip list | tail -n 2 | head -n 1 | awk '{print $4}')ssh -i ~/Downloads/mykeypair.pem -o StrictHostKeyChecking=no ubuntu@$IP
It will time out
This is because the default security group does not allow ssh connections. Attach a security group:
microstack.openstack server add security group myinstance-1 mysecuritygroup
This can also be done in Project > Compute > Instances > Actions, Edit Security Groups
After this you should be able to ssh into the instance
To delete instances:
microstack.openstack server delete myinstance-2
This can also be done in Project > Compute > Instances > Actions, delete instance
Find the home page and table of contents here