Creating a Context in CernVM Online
In order to minimize the size of the distributed CernVM images and in order to reduce the amount of work required to create your own, customized version of CernVM we provides a contextualization mechanism that applies your settings on a standard CernVM image during first boot.
CernVM online provides an easy-to-use interface for defining and storing such information. These information can be later applied to any CernVM instance using one of the supported contextualization mechanisms.
1. Logging in
To start you will need a CernVM online account. If you already have a CERN account you can start using CernVM online right away. Otherwise, click on the register link in the bottom-left side of the login box. When you are logged in you will see the CernVM dashboard.
2. Creating context
To create a new context click on the Create new context button. You will see the Context template interface. From here you can specify various customizations to your Virtual Machine.
In the General section specify a name for your new context. You may add a description that will help you identify your context later. This description is shown on the context lists.
If you want to make your context public (usable by everyone in CernVM Online) you can click on the Make this context visible on the public lists checkbox. You can also encrypt the context (a good idea if you intend to store sensitive informations like passwords) using an encryption key. To do so click on the Make this context visible on the public lists checkbox and fill the Secret key field. You should remember selected key because it is needed when you are trying to pair a machine with a context.
3. Setting up CVMFS
CernVM Filesystem (CVMFS) is one of the core components of CernVM. Most of the software that are frequently updated are delivered via CVMFS. If you are not going to use CVMFS skip this step.
Expand the CVMFS Configuration section and select your main software group from the drop-down menu. This will automatically populate the groups list. If it's needed you may add additional groups to your instance by dragging the available groups from the list on the left to the list on the right.
If your have a custom network configuration or if you have a local squid proxy you might also need to update the CVMFS HTTP Proxy option. Consult your network administrator for details.
4. Setting up Users
You can add users in your system via the Users section. Most of the fiels will be automatically populated based on the information you have provided so far. Usually you just need to set the user's password. Don't forget to click on the Add user button, otherwise the user will not be added!
5. Setting up boot services
From the Services section you can define which services you want to start on boot. You can drag boot-time services from the left list to the right in order to activate them. Keep in mind that not all CernVM versions provide the presented list of services.
If you want an application to start at boot-time you can provide it's full-path to the contextualization cmd field. You must also provide a valid system username on the Run command as field. The user can be any system user but not root!
5. Setting up environment
From the Environment section it is possible to add custom environment variables to your CernVM instance. Keep in mind that all the characters are escape and thus you cannot use other variables in your values (ex. $PATH).
5. Setting up CernVM Preferences
The CernVM Preferences section lets you tune-up the CernVM-Specific configuration. It provides the ability to change your configuration provider and the CernVM flavor (CernVM Edition).
The configuration provider is the URL from which CernVM will download at boot-time a set of additional contextualization parameters that usually change on every CernVM release.
Using the CernVM Edition drop-down you can configure (or migrate and configure) your CernVM instance. You can select one of the following options:
- Batch: lightweight nodes without administration interface that are used for job processing.
- Basic: basic CernVM installation with a local administration interface. To access the administration interface you must provide a log-in password for the admin user.
- Desktop: an extended version of the basic CernVM installation that contains X server and a standard desktop interface. Don't forget the Start X on startup if you want to boot directly to the graphics interface.
6. Setting up root user
There are cases where you need to log-in to a CernVM instance as root. Usually this is needed when no administration interface is available and no users are configured (for example in a batch node). CernVM Online provides the ability to pre-define the root user's SSH key in order to allow a remote user to connect.
If you already have generated a key, copy the public part of the key and paste it on the text field in the CernVM Root SSH Key section. If you don't have an SSH key pair, you can use ssh-keygen to create one:
a@A:~> ssh-keygen -t rsa -f root_key Generating public/private rsa key pair. Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in key. Your public key has been saved in key.pub. The key fingerprint is: 8e:c0:32:f2:69:bc:ef:e3:e9:59:0c:3a:61:9d:9d:34 root@cernvm17
You can then copy the contents of the root_key.pub to the text field. You can then log-in to your machine using:
ssh -i root_key root@my-machine-host
6. Setting up amiconfig modules
CernVM Online also provides a user-friendly interface to configure most of the amiconfig plugins that were available via the classic CernVM contextualization method. You have to explicitly enable and configure the plugins you want to use.