Release Notes for LDS Beta 11.10

Below are the current release notes for LDS Beta 11.10 (also known as "Beta 1").

  • Old style license file no longer supported. Please redownload your license file from landscape.canonical.com.
  • API
  • Repository Management
  • USN database is now downloaded from https://usn.ubuntu.com/, make sure new outgoing connection is allowed from wherever LDS is installed

  • new master script to control all services: lsctl
  • cron jobs now only send email in the case of errors
  • non-quickstart upgrades from LDS 11.07 and earlier are not yet supported
  • all log files have a numeric suffix to their basename now, like job-handler-1.log. That doesn't mean that all services that produce these logs can have multiple copies running. For now, only appserver, msgserver and pingserver can.

To get started using the new API and Repository Management features, please refer to the Getting Started sections of this page.

Known issues version 11.10.20111021-2

  • sync operations that error only set "Progress" to the value "-1", without any further error message. Please check the LDS server logs for details, in particular job-handler-1.log.
  • noisy upgrade. Messages like the one below can be safely ignored:

WARNING:root:Invalid statsd or dbstats section: No option 'client-report' in section: 'statsd'
  • saved searches can only be manipulated via the API for now. The existing saved searches will be displayed in the UI, though, and can be used.
  • don't use the extra sources parameter in repository profiles because it is going to change in the next release, and upgrades won't convert the data used with this parameter

API Getting Started

  • install the package landscape-api from the LDS Beta repository:

sudo apt-get install landscape-api
  • logon on your LDS installation and click on your username in the top right corner:

attachment:settings.png

  • if you don't see any API credentials in the next page (access key and secret key), click on "Generate API credentials":

attachment:api_creds.png

  • export the three following shell variables, or place them in your ~/.bashrc or equivalent file, replacing the values accordingly:

export LANDSCAPE_API_KEY="<API access key>"
export LANDSCAPE_API_SECRET="<API secret key>"
export LANDSCAPE_API_URI="https://<lds-hostname>/api/"

If you are using a custom Certificate Authority (CA), you will also need to tell the API tool where to find that certificate:

export LANDSCAPE_API_SSL_CA_FILE="/path/to/ca/file"

All these variables can also be specified as command-line options to the landscape-api tool.

You are now ready to use the API. Type landscape-api for a list of the available commands, check out its manpage and see the detailed API documentation available in your LDS installation. Just click on "API DOCUMENTATION" at the bottom of any Landscape page.

Using the API as a Python module

The Landscape API can also be used as a Python module. Here is a quick example that will get information about all computers that have the laptop tag set:

   1 #!/usr/bin/python
   2 import os, json, sys
   3 from landscape_api.base import API, HTTPError
   4 
   5 uri = os.getenv("LANDSCAPE_API_URI")
   6 key = os.getenv("LANDSCAPE_API_KEY")
   7 secret = os.getenv("LANDSCAPE_API_SECRET")
   8 ca = os.getenv("LANDSCAPE_API_SSL_CA_FILE", None)
   9 
  10 if not uri or not key or not secret:
  11     print "Please set all of LANDSCAPE_API_URI, LANDSCAPE_API_KEY and LANDSCAPE_API_SECRET"
  12     sys.exit(1)
  13 
  14 api = API(uri, key, secret, ca)
  15 try:
  16     # it will throw an exception if the tag doesn't exist
  17     result = api.get_computers(query="tag:laptop")
  18 except HTTPError, e:
  19     error = json.loads(e.message)
  20     print "\nGot server error:\nStatus: %d\n" % e.code
  21     print "Error code: %s\nError message: %s\n" % (
  22            error["error"], error["message"])
  23     sys.exit(1)
  24 
  25 computers = json.loads(result)
  26 for computer in computers:
  27     print "Id:", computer["id"]
  28     print "Title:", computer["title"]
  29     print "Hostname:", computer["hostname"]
  30     print "Last ping:", computer["last_ping_time"]
  31     print "Memory:", computer["total_memory"]
  32     if computer["reboot_required_flag"]:
  33         print "Needs to reboot!"
  34     print
  35 

Repository Management Terminology

Term

Meaning

Examples

distribution

Like Ubuntu

ubuntu, debian

series

A distribution release

lucid, natty, oneiric

pockets

Where packages are stored

updates, security, release(*)

components

Like in an apt sources.list line

main, extra, universe

suite

The combination of a series and a pocket

lucid-updates

architecture

The machine architecture/cpu type

i386, amd64, source (for source packages)

  • {i} The special pocket called release never gets mentioned in a suite. We will never have something called lucid-release and will just use lucid instead.

In a sources.list line, we would have:

deb http://archive.ubuntu.com/<distribution>/ <series>-<pocket> <component> [component ...]

Repository Management Getting Started

This is a quick tutorial showing how to mirror an upstream repository. For the sake of brevity, instead of mirroring the whole of, say, Lucid, we will just mirror the restricted component which is smaller.

We assume here that you have setup the API client already as explained elsewhere and that the landscape-api command is working.

   1 # import a secret GPG key. This will be used by LDS to sign the repository.
   2 # export a GPG secret key using gpg --export-secret-keys -a <keyid> > secret-key.pem
   3 # Note: the secret key must NOT have a passphrase. To remove the passphrase from a key,
   4 # use gpg --edit-key <keyid> before exporting it. See gpg(1) for details.
   5 $ landscape-api import-gpg-key secret-key secret-key.pem
   6 {u'fingerprint': u'5c49:8483:3dbf:5aaf:382e:000e:bc0e:d36a:1703:785b',
   7  u'has_secret': True,
   8  u'id': 7,
   9  u'name': u'secret-key'}
  10 
  11 # create a distribution
  12 $ landscape-api create-distribution ubuntu
  13 {u'creation_time': u'2011-10-14T19:44:13Z', u'name': u'ubuntu', u'series': []}
  14 
  15 # now create a series and some pockets, which are what hold the actual packages.
  16 # This will create a "lucid" series, with pockets for "release" and "main"
  17 # of the "restricted" component, and for the i386 arch. It won't mirror any packages
  18 # yet.
  19 $ landscape-api create-series --pockets release,updates --components restricted --architectures i386 --gpg-key secret-key --mirror-uri http://archive.ubuntu.com/ubuntu/ --mirror-series lucid lucid ubuntu
  20 {u'creation_time': u'2011-10-14T19:44:57Z',
  21  u'name': u'lucid',
  22  u'pockets': [{u'apt_source_line': u'deb http://biriba.canonical.com/repository/standalone/ubuntu lucid restricted',
  23 (...)
  24 
  25 # now, let's sync the pockets. This will start the actual mirroring process:
  26 $ landscape-api sync-mirror-pocket release lucid ubuntu
  27 {u'children': [],
  28  u'computer_id': None,
  29  u'creation_time': u'2011-10-14T19:45:51Z',
  30  u'creator': {u'email': u'stan@example.com',
  31               u'id': 1,
  32               u'name': u'Stan Peters'},
  33  u'id': 101,
  34  u'parent_id': None,
  35  u'pocket_id': 5,
  36  u'pocket_name': u'release',
  37  u'progress': 0,
  38  u'summary': u"Sync pocket 'release' of series 'lucid' in distribution 'ubuntu'",
  39  u'type': u'SyncPocketRequest'}
  40 
  41 
  42 # the result of the above command is an activity, and it has an id.
  43 # We can query its progress by using get-activities with the activity id, and inspect the "progress" result, which is a percentage:
  44 $ landscape-api get-activities --query id:101
  45 (...)
  46   u'id': 101,
  47   u'parent_id': None,
  48   u'pocket_id': 5,
  49   u'pocket_name': u'release',
  50   u'progress': 35,
  51 (...)
  52 
  53 # it's almost done. We can only issue another sync-mirror-pocket call once the above is finished.
  54 # Once it's finished, we can issue another call, this time to sync the updates pocket:
  55 $ landscape-api sync-mirror-pocket updates lucid ubuntu
  56 (...)
  57  u'id': 102,
  58 (...)
  59 
  60 # while the sync happens, we can create a repository profile which we will later apply to computers:
  61 $ landscape-api create-repository-profile --description "This profile is for LDS servers." lds-profile
  62 {u'all_computers': False,
  63  u'description': u'This profile is for LDS-servers.',
  64  u'id': 5,
  65  u'name': u'lds-profile',
  66  u'pockets': [],
  67  u'tags': []}
  68 
  69 # now we associate computers with the tag "lds" to this repository profile:
  70 $ landscape-api associate-repository-profile --tags lds lds-profile
  71 {u'all_computers': False,
  72  u'description': u'This-profile-is-for-LDS-servers.',
  73  u'id': 5,
  74  u'name': u'lds-profile',
  75  u'pockets': [],
  76  u'tags': [u'lds']}
  77 
  78 # finally, we say which pockets are part of this repository profile:
  79 $ landscape-api add-pockets-to-repository-profile lds-profile release,updates lucid ubuntu
  80 True
  81 

At the end of the above script, computers with the "lds" tag will get an entry in /etc/apt/sources.list.d/ pointing to our newly created release and updates repository for Lucid restricted component.

The repositories are also visible with a web browser at these URLs: http://<lds-server>/repository/standalone/ubuntu/pool/ and http://<lds-server>/repository/standalone/ubuntu/dists/

Quickstart deployment

Please follow the standard instructions for a quickstart deployment given to you on https://landscape.canonical.com/account/<your-account>/how-to-get-dedicated, except use the source.list line that was given to you via email.

Please see LDS/RecommendedDeployment-11.10.

LDS/BetaReleaseNotes (last edited 2012-09-24 12:24:23 by ahasenack)