Upgrading Landscape

December 2009


Landscape is the Ubuntu DTM tool. You can use it from the Canonical servers, but we have our own Landscape service. It runs as a KVM appliance on a server. When the service is to be upgraded, the appliance must be stopped, replaced by the new one, some scripts may have to run, and then it has to be started again...

  1. Fetching the new appliance

    Our contacts at Canonical provide us with an URL to download the new appliance from. Checking the md5sum must be done by hand, as the checksum still holds, but the file has been renamed after checksumming.

  2. Unpacking the new appliance

  3. Backing up the current system.

    Before putting the new appliance over the old one, I back it up:

    And I back up the database too:

    [Note]Note

    I can dump the entire database system, as I have only the Landscape database on it. You may have to be more specific.

  4. Copying the new appliance in place

  5. Running the install scripts

    cd appliance/
    sudo ./appliance_setup.py -r
    2009.12.11 12:18:34 - INFO - Landscape configuration started.
    2009.12.11 12:18:34 - INFO - Starting kvm instance ...
    2009.12.11 12:18:34 - INFO - kvm started with process id 11191.
    2009.12.11 12:18:34 - INFO - Waiting up to 60 seconds for login...
    2009.12.11 12:18:52 - INFO - Successfully scp'ed configuration file to vm.
    2009.12.11 12:18:52 - INFO - Successfully scp'ed SSL files to vm.
    2009.12.11 12:18:52 - INFO - Changing root password on the Landscape appliance ...

    Enter new UNIX password: v3r7s3cr3t0fc0ur3;)
    Retype new UNIX password: v3r7s3cr3t0fc0ur3;)
    passwd: password updated successfully

    2009.12.11 12:19:09 - INFO - Preparing Landscape virtual appliance ...
    2009.12.11 12:19:09 - INFO - Results of '/srv/landscape/landscape/landscape-guest-setup' command on virtual machine:


    2009.12.11 11:19:12 - INFO - Landscape virtual appliance - Setting up configured DNS servers ...
    2009.12.11 11:19:12 - INFO - Landscape virtual appliance - Setting up configured proxy server ...
    2009.12.11 11:19:12 - INFO - Landscape virtual appliance - Setting up main database configuration ...
    2009.12.11 11:19:12 - INFO - Landscape virtual appliance - Setting up pingserver database configuration ...
    2009.12.11 11:19:12 - INFO - Landscape virtual appliance - Setting up job-handler database configuration ...
    2009.12.11 11:19:12 - INFO - Landscape virtual appliance - Setting up maintenance database configuration ...
    2009.12.11 11:19:12 - INFO - Landscape virtual appliance - Setting up schema database configuration ...
    2009.12.11 11:19:12 - INFO - Landscape virtual appliance - Checking Landscape databases ...
    2009.12.11 11:19:12 - INFO - Landscape virtual appliance - Checking database schema ...
    2009.12.11 11:19:33 - INFO - Landscape virtual appliance - Schema configuration output:

    Loading site configuration...
    Setting up main schema...
    Grant UPDATE permission to landscape_maintenance on account table.
    Add availability_zone to ec2_cloud_instance.
    Set an high administrator limit for the standalone account.
    Rename global access contexts to 'Full access'.
    Patch standalone account administrators.
    Setting up account schemas...
    Add deliver_after_time timestamp to ComputerRequestDatas.

    Remove redundant ActivityGroup activities left over from the command/operation
    migration.


    Remove the activity_group.status column and add a new activity_group.data
    column.  Update the internal computer/status cache for all existing
    ActivityGroup's.

    0 of 87 took 0.18s
    50 of 87 took 3.73s
    87 of 87 took 2.01s
    Create 'Computer reboot required' rules for all accounts.
    Setting up resource schemas...
    Replace the patch.version sequence with a plain integer column.
    Setting up package schema...
    Modify the is_valid_package_id function to play well on different archs.
    Add indexes on provides_relation.
    Setting up session schema...
    Setting up knowledge schema...

    2009.12.11 11:19:33 - INFO - Landscape virtual appliance - Checking package database initial data ...
    2009.12.11 11:19:34 - INFO - Landscape virtual appliance - Package database already initialized.
    2009.12.11 11:19:34 - INFO - Landscape virtual appliance - Renaming stock hash-id stores ...
    2009.12.11 11:19:34 - INFO - Landscape virtual appliance - Stock package database not loaded, ignoring stock hash-id stores.
    2009.12.11 11:19:34 - INFO - Landscape virtual appliance - Cleaning up authorized_keys ...
    2009.12.11 11:19:34 - INFO - Landscape virtual appliance - Regenerating SSH keys ...
    Creating SSH2 RSA key; this may take some time ...
    Creating SSH2 DSA key; this may take some time ...
    * Restarting OpenBSD Secure Shell server sshd
      ...done.
    2009.12.11 11:19:35 - INFO - Landscape virtual appliance - Setting up Apache SSL configuration ...
    2009.12.11 11:19:35 - INFO - Landscape virtual appliance - Setting up landscape client configuration import file ...
    2009.12.11 11:19:35 - INFO - Landscape virtual appliance - Setting up Postfix email server configuration ...
    2009.12.11 11:19:35 - INFO - Landscape virtual appliance - Setting up /etc/mailname ...
    2009.12.11 11:19:35 - INFO - Landscape virtual appliance - Setting up email aliases ...
    2009.12.11 11:19:37 - INFO - Landscape virtual appliance - Shutting down Landscape Appliance ...
    2009.12.11 12:19:38 - INFO - Setting up VM init.d script ...
    2009.12.11 12:19:38 - INFO - Creating /etc/init.d/landscape-appliance ...
    2009.12.11 12:19:38 - INFO - Updating run levels for /etc/init.d/landscape-appliance ...

    System startup links for /etc/init.d/landscape-appliance already exist.

    2009.12.11 12:19:38 - INFO - Landscape configuration complete.

    Please restart the Landscape appliance by running
       /etc/init.d/landscape-appliance start
    or
       /etc/init.d/landscape-appliance force-start

    The Landscape appliance will now start on boot.

  6. Restarting the appliance

    After that, the new appliance takes a few more seconds to shut down. Wait until ps axu|grep landscape shows no virtual machines running any more, and then start the new service with:

    Now you should have a running server again.