|
|
@@ -1,162 +1,86 @@ |
|
|
|
# microstack |
|
|
|
# MicroStack |
|
|
|
|
|
|
|
[](https://build.snapcraft.io/user/CanonicalLtd/microstack) |
|
|
|
[![Snap Status][snap-build-badge]][snap-build-status] |
|
|
|
|
|
|
|
OpenStack in a snap that you can run locally on a single machine! Excellent for ... |
|
|
|
MicroStack is a single-machine, snap-deployed OpenStack cloud. |
|
|
|
|
|
|
|
* Development and Testing of Openstack Workloads |
|
|
|
* CI |
|
|
|
* Edge Clouds (experimental) |
|
|
|
Common purposes include: |
|
|
|
|
|
|
|
`microstack` currently provides Nova, Keystone, Glance, Horizon and Neutron OpenStack services. |
|
|
|
* Development and testing of OpenStack workloads |
|
|
|
* Continuous integration (CI) |
|
|
|
* IoT and appliances |
|
|
|
* Edge clouds (experimental) |
|
|
|
* Introducing new users to OpenStack |
|
|
|
|
|
|
|
If you want to roll up your sleeves and do interesting things with the services and settings, look in the .d directories in the filesystem tree under `/var/snap/microstack/common/etc`. You can add services with your package manager, or take a look at `CONTRIBUTING.md` and make a code based argument for adding a service to the default list. :-) |
|
|
|
Currently provided OpenStack services are: Nova, Keystone, Glance, Horizon, and |
|
|
|
Neutron. |
|
|
|
|
|
|
|
MicroStack is frequently updated to provide the latest stable updates of the |
|
|
|
most recent OpenStack release. |
|
|
|
|
|
|
|
## Installation |
|
|
|
|
|
|
|
`microstack` is frequently updated to provide the latest stable updates of the most recent OpenStack release. The quickest was to get started is to install directly from the snap store. You can install `microstack` using: |
|
|
|
|
|
|
|
``` |
|
|
|
sudo snap install microstack --classic --beta |
|
|
|
``` |
|
|
|
|
|
|
|
## Quickstart |
|
|
|
To quickly configure networks and launch a vm, run |
|
|
|
|
|
|
|
`sudo microstack.init` |
|
|
|
|
|
|
|
This will configure various Openstack databases. Then run: |
|
|
|
|
|
|
|
`microstack.launch cirros --name test`. |
|
|
|
|
|
|
|
This will launch an instance for you, and make it available to manage via the command line, or via the Horizon Dashboard. |
|
|
|
|
|
|
|
To access the Dashboard, visit http://10.20.20.1 in a web browser, and login with the following credentials: |
|
|
|
|
|
|
|
``` |
|
|
|
username: admin |
|
|
|
password: keystone |
|
|
|
``` |
|
|
|
|
|
|
|
To ssh into the instance, use the username "cirros" and the ssh key written to ~/.ssh/id_microstack: |
|
|
|
|
|
|
|
`ssh -i ~/.ssh/id_microstack cirros@<IP>` (Where 'IP' is listed in the output of `microstack.launch`) |
|
|
|
|
|
|
|
To run openstack commands, run `microstack.openstack <some command>` |
|
|
|
|
|
|
|
For more detail and control, read the rest of this README. :-) |
|
|
|
> **Requirements**: |
|
|
|
You will need at least 2 CPUs, 8 GiB of memory, and 100 GiB of disk space. |
|
|
|
|
|
|
|
## Accessing OpenStack |
|
|
|
See the full [MicroStack documentation][microstack-docs]. |
|
|
|
|
|
|
|
`microstack` provides a pre-configured OpenStack CLI to access the local OpenStack deployment; its namespaced using the `microstack` prefix: |
|
|
|
|
|
|
|
``` |
|
|
|
microstack.openstack server list |
|
|
|
``` |
|
|
|
|
|
|
|
You can setup this command as an alias for `openstack` if you wish (removing the need for the `microstack.` prefix): |
|
|
|
|
|
|
|
``` |
|
|
|
sudo snap alias microstack.openstack openstack |
|
|
|
``` |
|
|
|
|
|
|
|
Alternatively you can access the Horizon OpenStack dashboard on `http://127.0.0.1` with the following credentials: |
|
|
|
|
|
|
|
``` |
|
|
|
username: admin |
|
|
|
password: keystone |
|
|
|
``` |
|
|
|
|
|
|
|
## Creating and accessing an instance |
|
|
|
|
|
|
|
Create an instance in the usual way: |
|
|
|
|
|
|
|
``` |
|
|
|
microstack.openstack server create --flavor m1.small --nic net-id=test --key-name microstack --image cirros my-microstack-server |
|
|
|
``` |
|
|
|
|
|
|
|
For convenience, we've used items that the initialisation step provided |
|
|
|
(flavor, network, keypair, and image). You are free to manage your own. |
|
|
|
|
|
|
|
To access the instance, you'll need to assign it a floating IP address: |
|
|
|
|
|
|
|
``` |
|
|
|
ALLOCATED_FIP=`microstack.openstack floating ip create -f value -c floating_ip_address external` |
|
|
|
microstack.openstack server add floating ip my-microstack-server $ALLOCATED_FIP |
|
|
|
``` |
|
|
|
|
|
|
|
Since MicroStack is just like a normal OpenStack cloud you'll need to enable |
|
|
|
SSH and ICMP access to the instance (this may have been done by the |
|
|
|
initialisation step): |
|
|
|
## Installation |
|
|
|
|
|
|
|
``` |
|
|
|
SECGROUP_ID=`microstack.openstack security group list --project admin -f value -c ID` |
|
|
|
microstack.openstack security group rule create $SECGROUP_ID --proto tcp --remote-ip 0.0.0.0/0 --dst-port 22 |
|
|
|
microstack.openstack security group rule create $SECGROUP_ID --proto icmp --remote-ip 0.0.0.0/0 |
|
|
|
``` |
|
|
|
At this time you can install from the `--beta` or `--edge` snap channels: |
|
|
|
|
|
|
|
You should now be able to SSH to the instance: |
|
|
|
sudo snap install microstack --classic --beta |
|
|
|
|
|
|
|
``` |
|
|
|
ssh -i ~/.ssh/id_microstack cirros@$ALLOCATED_FIP |
|
|
|
``` |
|
|
|
## Initialisation |
|
|
|
|
|
|
|
Happy `microstack`ing! |
|
|
|
Initialisation will set up databases, networks, flavors, an SSH keypair, a |
|
|
|
CirrOS image, and open ICMP/SSH security groups: |
|
|
|
|
|
|
|
## Stopping and starting microstack |
|
|
|
sudo microstack.init --auto |
|
|
|
|
|
|
|
You may wish to temporarily shutdown microstack when not in use without un-installing it. |
|
|
|
## OpenStack client |
|
|
|
|
|
|
|
`microstack` can be shutdown using: |
|
|
|
The OpenStack client is bundled as `microstack.openstack`. For example: |
|
|
|
|
|
|
|
``` |
|
|
|
sudo snap disable microstack |
|
|
|
``` |
|
|
|
microstack.openstack network list |
|
|
|
microstack.openstack flavor list |
|
|
|
microstack.openstack keypair list |
|
|
|
microstack.openstack image list |
|
|
|
microstack.openstack security group rule list |
|
|
|
|
|
|
|
and re-enabled latest using: |
|
|
|
## Creating an instance |
|
|
|
|
|
|
|
``` |
|
|
|
sudo snap enable microstack |
|
|
|
``` |
|
|
|
To create an instance (called "awesome") based on the CirrOS image: |
|
|
|
|
|
|
|
## Raising a Bug |
|
|
|
microstack.launch cirros --name awesome |
|
|
|
|
|
|
|
Please report bugs to the microstack project on launchpad: https://bugs.launchpad.net/microstack |
|
|
|
## SSH to an instance |
|
|
|
|
|
|
|
## Clustering Preview |
|
|
|
The launch output will show you how to connect to the instance. For the CirrOS |
|
|
|
image, the user account is 'cirros'. |
|
|
|
|
|
|
|
The latests --edge version of the clustering snap contains a preview of microstack's clustering functionality. If you're interested in building a small "edge" cloud with microstack, please take a look at the notes below. Keep in mind that this is preview functionality. Interfaces may not be stable, and the security of the preview is light, and not suitable for production use! |
|
|
|
ssh -i ~/.ssh/id_microstack cirros@<ip-address> |
|
|
|
|
|
|
|
To setup a cluster, you first must setup a control node. Do so with the following commands: |
|
|
|
## Horizon |
|
|
|
|
|
|
|
``` |
|
|
|
sudo snap install microstack |
|
|
|
sudo microstack.init |
|
|
|
``` |
|
|
|
The launch output will also provide information for the Horizon dashboard. Its |
|
|
|
credentials are: |
|
|
|
|
|
|
|
Answer the questions in the interactive prompt as follows: |
|
|
|
username: admin |
|
|
|
password: keystone |
|
|
|
|
|
|
|
``` |
|
|
|
Clustering: yes |
|
|
|
Role: control |
|
|
|
IP Address: Note and accept the default |
|
|
|
``` |
|
|
|
## Customising and contributing |
|
|
|
|
|
|
|
On a second machine, run: |
|
|
|
To customise services and settings, look in the `.d` directories under |
|
|
|
`/var/snap/microstack/common/etc`. You can add services with your package |
|
|
|
manager, or take a look at `CONTRIBUTING.md` and make a code based argument for |
|
|
|
adding a service to the default list. |
|
|
|
|
|
|
|
``` |
|
|
|
sudo snap install microstack |
|
|
|
sudo microstack.init |
|
|
|
``` |
|
|
|
## Reporting a bug |
|
|
|
|
|
|
|
Answer the questions in the interactive prompt as follows: |
|
|
|
Please report bugs to the [MicroStack][microstack] project on Launchpad. |
|
|
|
|
|
|
|
``` |
|
|
|
Setup clustering: yes |
|
|
|
Role: compute |
|
|
|
Control IP: the ip address noted above |
|
|
|
Compute IP: accept the default |
|
|
|
``` |
|
|
|
<!-- LINKS --> |
|
|
|
|
|
|
|
You should now have a small, two node cloud, with the first node serving as both the control plane and a hypvervisor, and the second node serving as a hypervisor. You can create vms on both. |
|
|
|
[microstack-docs]: https://microstack.run/docs/ |
|
|
|
[snap-build-badge]: https://build.snapcraft.io/badge/CanonicalLtd/microstack.svg |
|
|
|
[snap-build-status]: https://build.snapcraft.io/user/CanonicalLtd/microstack |
|
|
|
[microstack]: https://bugs.launchpad.net/microstack |