Instance is a running virtual machine that has been created in a cloud supplier and
it has been bootstrapped a server configuration.
Types of Instances
When you create a testing instance you are creating a server that will be auto-destroyed after certain amount of time. This makes sense you are, for example, creating demo servers or testing environments. You will never forget an instance running in your infrastructure never again!
The production instances are the ones that will perdure in time. If you are orchestrating infrastructure you can assign a version to those servers.
Manageacloud allows you to orchestrate in different ways to cover different use cases.
You can deploy a server configuration into a
testing instance by clicking a single button,
production instance by following a three steps wizard.
Deploying from the web interface is only available from the SaaS.
You can bootstrap a server configuration from the command line. The following example installs nginx in a
mac instance create -b "apt-get install nginx -y" -r ubuntu:trusty
However, you might prefer to create a
mac instance create -b "apt-get install nginx -y" -r ubuntu:trusty -d production
If you are using Manageacloud Business or Start-Up, you can create a server configuration and invoke it when creating a new server instance:
mac instance create -c my_server_configuration -r ubuntu:trusty
If you are using Manageacloud Business or Start-Up you can decouple the commands from the mac cli by using server configurations. You can list your
mac configuration list
You can learn more about how to use the command line interface by reading the Mac cli documentation reference
Using a trigger
A trigger is a container running Ubuntu 14.04 that allows you to execute a set of arbitrary bash commands. A trigger is executed after a POST to an url is performed. For example, imagine that you want to deploy an brand new instance with an nginx server every time you perform a POST into an URL. The following trigger creates a brand new server with nginx installed:
#!/bin/bash set -x # view commands # configure mac cli credentials export MAC_USER=my_user export MAC_APIKEY=my_api_key # create the instance mac instance create -b "apt-get install nginx -y" -r ubuntu:trusty
Then you can invoke the trigger:
curl -X POST https://manageacloud.com/trigger/rjqh755rv7bhm80ft1qff3298i
Learn more about triggers by reading the full documentation.
You can list instances by via web interface or executing the following command:
mac instance list
You can destroy instances by clicking a button from the web interface or by executing:
mac instance destroy my_instance_id
You can update the instances in three different ways
Using the original server configuration
You re-run the bootstrap server configuration by executing from the cli:
mac instance update my_instance_id
Using a new server configuration
You can run a new server configuration in the instance executing:
mac instance update my_instance_id -c my_server_configuration
Executing a new bash script
You can execute a new command in the instance executing:
mac instance update my_instance_id -b 'apt-get update && apt-get install nginx -y'
When you are bootstrapping a script (-b parameter) you can define the commands directly, use a file or a URL.
You can access to the instances by two different ways
Using the original credentials
Manageacloud creates a set of credentials that allows to access to the server to execute commands. You can use those credentials to access the server:
mac instance ssh my_instance_id
Installing your own credentials
You can use your configuration management system to install your own credentials (eg ssh keys) allowing you to access the servers using your favourite way.
Removing Manageacloud default credentials
Manageacloud will install a set of credentials to allow to manage the server. Those credentials are used every time we want make an operation via SSH such as updating server configurations.
You can remove the default credentials. However, it will disable certain functionality at Manageacloud.