Skip to content

Instantly share code, notes, and snippets.

@justyns
Forked from eriweb/templateupgrade.md
Created August 23, 2014 03:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save justyns/043f1861eb55dd2d96f4 to your computer and use it in GitHub Desktop.
Save justyns/043f1861eb55dd2d96f4 to your computer and use it in GitHub Desktop.

If your system vm is not currently working you have to make it work. On XenServer you can do this by SSH'ing to it and upgrade java.

apt-get update && apt-get -y install openjdk-7-jre-headless openjdk-7-jre-lib && apt-get -y remove openjdk-6-jre-headless

and it should now work. In some rare cases you have to restart the cloud service

service cloud stop && sleep 3 && service cloud start

and in some even rarer cases you have to restart the ssvm. Do that from the Apache CloudStack UI.

If you experience problems upgrading due to lack of free space then stop the cloud service, and remove any log files, they can be big.

When your SSVM is properly working again add a new template. Depending on your hypervisor it should be named as follows:

XenServer:

systemvm-xenserver-4.4

KVM:

systemvm-kvm-4.4

Use the same in the description, set OS to the latest Debian (64-bit) release available.

Choose the correct template from this location as the URL, but make sure to use the 64 bit one. http://cloudstack.apt-get.eu/systemvm/4.4/

It should look like this for a XenServer installation: Imgur

After the template is successfully downloaded, connect to your cloud database and run the following queries:

    # this will get you the id to use later. anywhere xenserver is mentioned you replace with your hypervisor
    # if there is more than one (it shouldn't really...), use the highest id as $fromfirststep
    mysql> select id,name from vm_template where name = 'systemvm-xenserver-4.4';
    
    # this will change the template's type to SYSTEM
    mysql> update vm_template set type='SYSTEM' where id = $fromfirststep;
    
    # this will update any existing system vm to use the new template
    # XenServer:
    mysql> update vm_instance set vm_template_id = $fromfirststep where type <> 'USER' and hypervisor_type = 'XenServer';
    
    # KVM: 
    mysql> update vm_instance set vm_template_id = $fromfirststep where type <> 'USER' and hypervisor_type = 'KVM';
    
    # this will update the global configuration option for VRs to use the new template
    # XenServer:
    mysql> update configuration set value = 'systemvm-xenserver-4.4' where name = 'router.template.xen';
    
    # KVM:
    mysql> update configuration set value = 'systemvm-kvm-4.4' where name = 'router.template.kvm';

Now restart cloudstack-management, and hopefully your system vm's should work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment