Importing and Exporting Templates

You can import and export appliance templates. When exporting, an archive is created of the appliance template. This archive includes a meta-data file describing the appliance template (based on the hammr specification) as well as any bundled software that was initially uploaded as part of the template creation.

Likewise, an archive can be imported to the UForge platform, creating a new appliance template in your Appliance Library under the Imported Appliances section.

Warning

If you want to export an appliance template with software bundles in UForge 3.7 and import it in UForge 3.8 or more, you will need to modify your template to make it compatible. Refer to Updating a 3.7 Appliance Template Before Exporting For 3.8.

Exporting

To export an existing appliance:

  1. Go to your Appliance Library.
  2. Click on the export icon on the right hand side of the appliance template in question to export.
../../_images/export-appliance.png
  1. A pop-up will appear, allowing you to select the format you would like (yaml or json).
../../_images/export-appliance-format.png
  1. Click export. This will start the export process.
../../_images/exporting-appliance.png
  1. Once the export is complete, you will be prompted to download the archive file.
../../_images/export-download.png

The equivalent export feature is available when editing an appliance template.

Note

An exported Windows-based template does not contain the “Activation Key” to ensure this data remains confidential.

Importing

Warning

You will only be able to import a Windows appliance to a UForge that has the same golden image as the one used by the appliance. If the golden does not exist on the target UForge you must export the appliance without OS Profile or remove some OS section fields in template file. Refer to Updating a Windows Appliance Before Import.

To import an archive:

  1. Go to your Appliance Library.
  2. Click on the import button at the top right hand side of the view.
../../_images/import-appliance.png
  1. A number of options are proposed. Select the method of import and click the folder icon to select the archive to import.
../../_images/import-options2.png
  1. Click import. This will start the import process. The import progress will be shown.
../../_images/importing-appliance.png
  1. Once the import is complete, a new appliance template can be found in the Imported Appliances sub-section of your Appliance Library.

Updating a Windows Appliance Before Import

When you import a Windows appliance, UForge checks if the golden image used to create the appliance exists on the UForge server. If it does not exist, the import will fail. In order to import the template, you must export the appliance and remove the OS profile.

For example, in order to remove some OS section fields before importing your Windows appliance:

  1. Go to your Appliance Library.
  2. Click on the export icon on the right hand side of the appliance template to export.
  3. Once the export is complete, you will be prompted to download the archive file.
  4. Open the archive file. The OS section should look something like:
os:
  name: "Windows"
  version: "Server2012R2"
  arch: "x86_64"
  profile: "Win2K12R2 scan Scan #1"
  windowsEdition: "standard"
  windowsType: "full"
  windowsLanguage: "English"
  1. Update the OS section to remove the lines profile, windowsEdition, windowsType, windowsLanguage. For example:
os:
  name: "Windows"
  version: "Server2012R2"
  arch: "x86_64"
  1. Save the file.
  2. Go to your Appliance Library.
  3. Click on the import button at the top right hand side of the view.
  4. A number of options are proposed. Select the method of import and click the folder icon to select the archive to import.
  5. Click import. This will start the import process.

You can also remove the OS Profile from the UI by going to the Stack page of the appliance before exporting.

Updating a 3.7 Appliance Template Before Exporting For 3.8

When you export an appliance in UForge 3.7 that contains software bundles, and import it to UForge 3.8, you will encounter compatibility issues. In order to import the template, you must modify the file containing the description of your appliance (template.yml or template.json).

In this file, there is a section bundles, that contains a subsection oses. You need to remove the entire content of the subsection oses, and replace it by a section restrictionRule. Refer to Restricting Software Components for OSes and Formats for detailed documentation about restriction rules.

For example, if your oses subsection is like this:

- name: "CentOS"
  version: "7"
  arch: "x86_64"
- name: "Debian"
  version: "8"
  arch: "x86_64"

Then you need to write this restriction rule instead:

(Distribution#name=CentOS && Distribution#version=7 && Distribution#arch=x86_64) || (Distribution#name=Debian && Distribution#version=8 && Distribution#arch=x86_64)

When you export a Windows appliance in UForge 3.7, you will also encounter compatibility issues. In order to import the template, you must modify the file containing the description of your appliance (template.yml or template.json).

In this file, there is a section os that contains various information and in particular the profile name. The new 3.8 template now has the following additional fields: windowsEdition, windowsType and windowsLanguage. You will need to add these fields to be able to import the template.

For example, if your os section is like this for 3.7:

name: "Windows"
version: "Server2012R2"
arch: "x86_64"
updateTo: "12-19-2016 10:32:07 GMT"
profile: "Standard Full English"

Then you should update it with the new fields, and it should look something like:

name: "Windows"
version: "Server2012R2"
arch: "x86_64"
updateTo: "12-19-2016 10:32:07 GMT"
profile: "Standard Full English"
windowsEdition: "standard"
windowsType: "full"
windowsLanguage: "English"

The profile should exist on the target UForge platform, otherwise you must delete the profile field and import the template like this:

name: "Windows"
version: "Server2012R2"
arch: "x86_64"
updateTo: "12-19-2016 10:32:07 GMT"

Thus, your appliance will be imported and you will be able to setup the OSProfile manually in the UI.