Help:Instances

From Wikitech
Jump to: navigation, search

This page contains information how to set up a Cloud VPS instance. Instances are not projects: see Help:Terminology and the full list of projects with their members.

An instance is a virtual machine, see Help:Terminology.

Creating an instance

You must have Project Admin rights (see Help:Terminology) in a project to create and manage its instances. You can ask an existing Project Admin in a project to grant you the role. See http://tools.wmflabs.org/openstack-browser/project/<project name> for a list of project admins.

In a project you can create as many instances as you'd like up to its quota. A wikitech admin can increase a project's limits as needed. To request additional quota follow the quota request instructions in Phabricator.

If you are in the cloudadmin group on this wiki, and have two-factor authentication enabled, you can add members to any project.

Before you create an instance, make sure your project has an appropriate security group for the instance's networking needs. For example, a web server or wiki requires access on port 80, the default port for HTTP requests; the security group for this is often named "Web" or "web-servers".

Add Instance link

  1. Log in to https://horizon.wikimedia.org/.
  2. Use the dropdown at top to select the project you want to work on.
  3. Click 'Instances' in the sidebar.
  4. Click the 'Launch instance' button.
  5. Choose the parameters you want and launch the instance.

Initial settings

Instance information

  1. Instance name
    The name of your instance will also be its hostname. Important: it’s a good idea to name your instance using the following format project-instance, e.g, project name is myproject, instance is coolbot, so the resulting instance name would be myproject-coolbot
  2. Instance type
    The drop-down contains a range of possible instance types indicating RAM, number of CPUs, and Hard Drive space. Further information on Instance Types also known as Flavors.
    The drop-down contains a list of system images available with your most likely choice at the top.
  3. Security groups
    A list of available security groups for your instance is listed; select any security groups you think you need for this instance; it is usually best to make sure that at least the default security group is selected.
    nb: if the projectadmin for the project has not created any additional security groups, besides the default group, you will only see the default security group listed.

Build the Instance

When happy with the configuration, click on the [Submit] button.

The instance will be created, but it will be a short while until the instance is ready to be logged into. You can check the process of the build by viewing the instance's console log (see § Managing Instances). When the puppet run finishes, you can log into it with ssh (see Help:Access).

Managing Instances

Once your instance is created, a new row appears in the instances list. You can click on the instance name to get more information about it. The following 4 tabs are displayed:

  1. Overview: general description;
  2. Log: show console output;
  3. Action Log: list OpenStack operations, such as instance creation;
  4. Puppet Configuration: set up the instance with available Puppet roles.

Puppet information

Wikimedia Labs uses Puppet to manage instance configurations.

You can also ssh to your instance and administer it from the command line. You can use apt-get (Ubuntu’s documentation, also see Debian's package management) or other package manager if you wish. But if you are developing something that will eventually get deployed to Wikimedia servers, you have to use puppet to configure it, see Help:Standalone_puppetmaster.

Configuring Instances

When you click on the Puppet Configuration tab, you get a list of various puppet roles available for your instance. If you're setting up a test MediaWiki server, role::labs::mediawiki_vagrant is all you need, see MediaWiki-Vagrant in Labs.

Once you submit the change, you can either run puppet by running sudo puppet agent -tv or just wait until puppet runs on your instance. If you encounter a problem running the sudo command above, then you might need be added as a sudo user for the project you're working on. Any user with the projectadmin role for the project can do that – see Help:Sudo_Policies for more information.

See also: Help:LAMP instances.

Understanding the Instance lifecycle

Periodically we verify use and cleanup unused resources to keep them available for active projects

Instance lifecycle