Importing classic virtual system patterns

You can import classic virtual system patterns.

Classic virtual system patterns are topology definitions for repeatable deployment that can be shared. You can export a command line script that reconstructs a classic virtual system pattern on a different instance than the one on which it was created. Use this script to import classic virtual system patterns.
Note: Do not use this script with virtual system patterns.
Using the artifacts that are generated by the exportPattern.py script, you can export classic virtual system patterns from one instance and import them to another instance. This command-line interface (CLI) script reconstructs the original classic virtual system pattern on another instance by using the importPatterns.py script. The reconstructed classic virtual system pattern contains the same properties as the original script:
  • Parts
  • Property values and metadata
  • Scripts
  • Script parameter values
  • Advanced options
  • Add-ons
  • Add-on parameter values
  • Ordering
  • Status (read-only)
Note: When importing virtual images through the command line interface, if you encounter Error code 503 (Service temporarily unavailable), try the import again after user interface restarts.

Importing a virtual system pattern

Use the samples/importPatterns.py script to import the classic virtual system pattern. Use the standard CLI parameters to specify the host name, user ID, and password to access the classic virtual system pattern, and the location of the importPatterns.py script. In addition, use the -a parameter, which you can also format as --acceptcert, so that SSL certificates from the system are automatically accepted. Specify both the file name and classic virtual system pattern, as shown in the following example:
pure -h <hostname.com> -u <user> -p <password> --acceptcert -f ../samples/importPatterns.py -s <target_source_directory>

Options

Use the following options with the importPatterns.py script:
-s <target_source_directory> or --source <target_source_directory>
Indicates that the patterns and the associated artifacts are uploaded from the specified source folder or file name for the .tgz/.tar.gz file.
The process to import the pattern uses the same JSON serialization format that is used in the pattern export process. Likewise, the associated artifacts are uploaded with the same file layout as shown in the preceding section.

Updating the referenced virtual image

The script uses the values specified in the references definition of the JSON file to match the virtual image in the target environment.
        "references": {
            "virtual_images": [
                {"name": "IMAGE NAME", "version": "IMAGE_VERSION", "build": "REFID"},  ...
         ] ,
In some cases, you might need to update the references definition for an exported pattern to match the target environment in which the pattern is imported.
CAUTION:
Ensure that the updated virtual image accepts the same set of configuration properties. Otherwise, an exception will occur during the import process.
In the following example, the virtual image of the exported pattern is at the WebSphere Application Server Hypervisor Edition Version 8.0.0.1 level.
  • The original references definition:
                "virtual_images": [
                    {"name": "IBM WebSphere Application Server Hypervisor Edition 8.0.0.1", "version": "8.0.0.1", "build": "34964.449"}, ...      ] ,
To match the target environment, the virtual image of the imported pattern is then updated to the Version 8.0.0.2 level.
  • The updated references definition:
                "virtual_images": [
                    {"name": "WebSphere Application Server 8.0.0.2", "version": "8.0.0.2", "build": "112022.490"},  ...          ] ,

Providing native language support

To provide native language support for the classic virtual system pattern name and description, you can add the messages.properties file of each locale in the locales directory. In the following example, the locales directory contains message files in English, French, and Simplified Chinese. The format of the messages.properties file follows Java internationalization specifications.
	/
		patterns.json
		...
		/locales 
			messages.properties
			messages_en.properties
			messages_fr.properties
			messages_zh_CN.properties 

Using a web server to host the virtual images referenced by the classic virtual system pattern

Because the size of the virtual image can be larger than several gigabytes, you can host the virtual image on a web server to import it in several different environments. Update the virtual image values in the references definition as shown in the following example:
"references": {
            "virtual_images": [
                {"name": "IMAGE NAME", "version": "IMAGE_VERSION",""build": "REFID", "url", "OVA_URL_FOR_IMPORT", "user": "USER", "password": "PASSWORD"}, ...
            ] ,
The "url" value is the HTTP or HTTPS URL for the virtual images. The optional "user" and "password" values are used for basic authorization.