Chapter 3. Administering SUSE Studio Onsite Servers

Contents

3.1. Logging in to SUSE Studio Onsite
3.2. Inviting New Users
3.3. Managing Your Repositories
3.4. Managing Builds and Appliances
3.5. Adding New Cron Jobs
3.6. Backing Up SUSE Studio
3.7. Setting the Read-Only Mode
3.8. Extending Disk Storage
3.9. Enabling OVF Format
3.10. Changing Maximum Number of Slots

Abstract

In this chapter, learn how to log in to SUSE Studio Onsite and how to execute basic administration tasks, like viewing statistics or checking events on your server, how to manage repositories, builds and appliances, and how to add cron jobs.

3.1. Logging in to SUSE Studio Onsite

To log in to the SUSE Studio Onsite Web interface, enter the URL of your SUSE Studio Onsite server in your browser and click Create account/Sign in (in the upper right hand corner).

After you have successfully logged in, your home page of SUSE Studio Onsite gives you an overview of all your appliances. To switch to the administration settings, click on your login name to show the administration panel, see Figure 3.1, “The Administration Panel”.

Figure 3.1. The Administration Panel

The Administration Panel

3.2. Inviting New Users

Accessing SUSE Studio Onsite is permission-based. Access can be granted by the administrator based on a user access request or via administrator invitation:

  1. User Issues an Account Request:  The user requests an account from the SUSE Studio Onsite home page by entering an appropriate e-mail address as shown in Figure 3.2, “Requesting an Account” and clicking the Send request button. A request is generated and sent to the SUSE Studio Onsite administrator for approval.

    Figure 3.2. Requesting an Account

    Requesting an Account

  2. Administrator Initiates Account:  The administrator issues an invitation to a user (without a prior user request).

For both approval and invitation of a user, use the administration panel. To approve a request you have received, select Advanced+Users+Signups and click the Invite link.

If you want to initiate an account, select Advanced+Users+Invitations and enter the e-mail address of the user you want to invite.

After administrator approval or by direct invitation, a user account will be created and an invitation e-mail is sent to the specified e-mail address. The user must activate the account by following the instructions in the invitation e-mail. Activation requires the user to log into SUSE Studio Onsite with a username and a password.

It is possible to disable user requests by modifying the SUSE Studio Onsite configuration file. See Example 1.1, “Central Configuration File /srv/studio/options.yml for additional details.

3.3. Managing Your Repositories

Information about the repositories available for your appliance builds can be accessed in the administration panel by clicking Advanced+Repositories. Use one of the following options to add repositories:

  • From media (CD/DVD).  Insert the media and press the Scan button to search for packages. This feature is able to copy packages from SUSE Linux Enterprise repositories of the installation media, but only those that have metadata already downloaded from SMT or Novell Customer Center.

  • From a SMT server.  Insert your SMT server hostname and press the Add button to search for packages.

  • From an URL.  Insert the name and URL into the corresponding text fields and press the Add button.

To modify an already configured repository, click the Details link on the right. This will display a page containing the details of the selected repository, see Figure 3.3, “Editing Repository Information”. Make the desired changes, such as setting the Trusted or Internal flag and click the Save changes button when finished.

Figure 3.3. Editing Repository Information

Editing Repository Information

Next to the label Used by a link indicates the number of appliances built using this repository. Click the link to modify or replace the references to this repository. With the action buttons at the bottom of the page you enable or disable automatic updates to the repository or delete the repository from your system. You can also disallow the URL for future addition to the repository list by clicking Ban this URL & delete repository.

3.4. Managing Builds and Appliances

To get an overview of all your builds, go to Builds+Appliances. The page shows a tabular view of all appliances that have already been built, see Figure 3.4, “Overview of Built Appliances”.

Figure 3.4. Overview of Built Appliances

Overview of Built Appliances

Clicking the filter icon next to the author will filter the displayed list to only show appliances created by this author. As can be seen in Figure 3.4, “Overview of Built Appliances”, the table shows details for each appliance, like the appliance name, a description, the author, the version and other information. In the right most column of the table the following action links are available:

Show

Displays information about this appliance, like its ID or name.

Diary

Displays the events diary for this appliance.

Edit

Allows you to grant other users read and write permissions.

Delete

Allows you to delete this appliance and its configuration from the server after confirming the respective pop-up message.

3.5. Adding New Cron Jobs

SUSE Studio allows you to easily set up preconfigured periodic task. These are also known as cron jobs. The following table provides a list of the available preconfigured jobs:

Table 3.1. Description of Cron Jobs

Task

Description

cleanup_testdrives

This job removes expired test drives and makes sure that test drive sessions ended by users are removed.

delete_expired_images

This job removes all appliance images that are older than one week. The configuration of the appliances is not affected by this job—the appliance configuration is retained and will continue to be displayed in the Web interface for the given user. Activating this job can help you reduce the disk space requirements for SUSE Studio.

delete_old_testdrive_images

This job removes uncompressed image files that are older than one week. These uncompressed files are only used for test drives. If a test drive is started for a build whose uncompressed image file was removed, it is regenerated on the fly. Activating this job can help you reduce the disk space requirements for SUSE Studio. However, accessing the test drive feature for a particular appliance may take initial time as the appliance image has to be extracted.

process_queues

Internal job to process the build queues.

sync_all_runners

Internal job to keep the state of the different services synchronized.


To create a new cron job, proceed as follows:

  1. From your administration panel select Advanced+Cron.

  2. Click New Cron Job.

  3. Choose a task from the pop-up menu, see the description in Table 3.1, “Description of Cron Jobs”.

  4. Modify the Frequency (in minutes) value to change the cron job execution frequency.

  5. Optionally, change the initial start date and time by modifying the date and time entries.

  6. Click Create. The configured cron job will be executed at the configured intervals.

3.6. Backing Up SUSE Studio

If you need to backup your SUSE Studio server, proceed as follows:

Procedure 3.1. Creating Backups of SUSE Studio

  1. Log in as root.

  2. Stop the services RMDS, Thoth, and Apache with:

    rcrmds stop
    rcthoth stop
    rcapache2 stop
  3. Create a dump of the PostgreSQL database:

    cd /root
    pg_dump -Ft -b studio | gzip > studio_db.tar.gz
  4. Create a tar archive of the complete /studio directory with:

    tar cfz studio.tar.gz --absolute-names \
    --preserve-permissions --dereference /studio
  5. Copy the tar archives (studio_db.tar.gz, and studio.tar.gz) to some persistent storage device.

  6. Restart the services:

    rcrmds start
    rcthoth start
    rcapache2 start

To restore the backup, proceed as follows:

Procedure 3.2. Restoring Backups of SUSE Studio

  1. Log in as root.

  2. Stop the services RMDS, Thoth, Apache, and restart the PostgreSQL database with:

    rcrmds stop
    rcthoth stop
    rcapache2 stop
    rcstudio_delayed_job stop
    rcpostgresql restart
  3. Drop the old database schema with:

    echo "drop database studio;" | psql template1
     echo "create database studio;" | psql template1
  4. Unpack the old archives:

    gunzip studio_db.tar.gz
  5. Restore the PostgreSQL database:

    pg_restore -c -d studio studio_db.tar
  6. Populate database:

    cd /srv/studio/ui-server
    RAILS_ENV=production rake db:migrate
  7. Restore backup files"

    tar -C / -x -z -f studio.tar.gz
  8. Restart the services:

    rcrmds start
    rcthoth start
    rcapache2 start
    rcstudio_delayed_job start
  9. Check sphinx. To make sure the sphinx indexer does work, check if its configuration file exists:

    ls /srv/studio/ui-server/config/production.sphinx.conf

    If the file is missing, create it and assign to the wwwrun user. Then restart sphinx:

    touch /srv/studio/ui-server/config/production.sphinx.conf
    chown wwwrun /srv/studio/ui-server/config/production.sphinx.conf
    rcstudio_sphinx restart

3.7. Setting the Read-Only Mode

Whenever you administer your SUSE Studio server it is recommended to set the site status to read-only prior to any changes. No new jobs can be started in this mode. Any user who is logged in is notified about the read-only state.

Go to Advanced+Scheduler and press the Put the site in read-only mode button. The site is in read-only mode now. To switch back, press the Reenable site button.

3.8. Extending Disk Storage

The disk storage requirements for SUSE Studio Onsite may be very high depending on your usage patterns. Therefore you may wish to mount the /studio/filestore directory or its subdirectories to different storage devices, particularly if you are running low on disk space.

Before moving the files in this directory, stop all SUSE Studio Onsite's services by running the following commands:

/etc/init.d/studio_crontick stop
/etc/init.d/studio_delayed_job stop
/usr/sbin/rcapache2 stop
/usr/sbin/rcrmds stop
/usr/sbin/rcthoth stop

After the disk operations are complete, start the services again:

/etc/init.d/studio_crontick start
/etc/init.d/studio_delayed_job start
/usr/sbin/rcapache2 start
/usr/sbin/rcrmds start
/usr/sbin/rcthoth start

After the services are started, SUSE Studio Onsite should be using the new storage device to store its data.

3.9. Enabling OVF Format

As already mentioned in Section “Appliance Formats” (Chapter 2, Creating Appliances, ↑User Guide), OVF format is disabled by default as we cannot distribute the VMware ovftool officially. To enable OVF format, proceed as follows:

  1. Download and install the VMware ovftool from http://communities.vmware.com/community/vmtn/vsphere/automationtools/ovf. You need to register to download the file.

  2. Install the downloaded file with the following command, for example:

    sudo sh VMware-ovftool-2.0.1-260188-lin.x86_64.sh

    The correct version might be different in your case.

  3. Enable the OVF format after installing with the following command (one line):

    cd /srv/studio/ui-server && ./script/runner -e production
     'ImageType.find_by_key("ovf").update_attributes!(:enabled => true)'

The OVF build format will now appear in the build tab of the appliance editor.

3.10. Changing Maximum Number of Slots

The scheduler controls runners. Runners are used to build the image or control the test drive. Each runner contains a maximum slot value, which describes how many builds or test drives a runner can handle concurrently. In most cases, the default value is sufficient and you can skip this section. It is recommended to leave this value as it is and only change it, if you know what you do.

If you need to change the maximum number of slots for a runner, go to Advanced+Scheduler in the administration panel. Click Show on the corresponding runner type to get an overview of the load average, the used and maximum slots, and other information. Go to Edit and change the value in the text field. Finish with Save.