Skip to main content

osimages import

This command imports OS images and custom files from a remote server to the repository.

To import a new file, follow these steps:

  1. Start a job to import the file using osimages import -t <image_type>.

  2. Import the file using osimages import -t <image_type> -o <settings_JSON>, where the settings JSON includes the job ID that was returned in step 1.

  3. Monitor the status of the import job using tasks –j <job_id>.

When you import an OS image, Lenovo XClarity Administrator creates one or more OS-image profiles in the OS image repository. The profile includes both the OS image and the installation options for that image.

Syntax

osimages import  -h

osimages import -t <image_type> [-v <filter>]

osimages import -t <image_type> -o <settings_JSON> [-v <filter>]

Options

{-h | --help}
Displays the syntax and brief usage information for this command.
{-o | --osimages_dict} <settings_JSON>

Specifies the OS image settings, in JSON format.

If not specified, this command create a job to perform the import operation.

ParametersRequired / OptionalTypeDescription
jobIDRequiredIntegerID of the job that was created to import files using the osimages import -t <image_type> command.
checksumTypeOptionalIntegerSpecify the type of checksum to be used. This can be one of the following values.
  • MD5
  • SHA1
  • SHA256

It is added as an item of the multi-part body.

checksumValueOptionalIntegerChecksum string of the .ISO file. It is added as an item of the multi-part body.
imageNameRequiredIntegerName of the OS image to which you want to add the device driver (for example, redhat7.0)
Note
The operating-system image must exist in the OS images repository.
imageTypeRequiredIntegerType of image being imported. This can be one of the following values.
  • BOOT. Boot-options file. This is available for only customized Windows operating-system profiles.
  • BUNDLE. Bundle file (in .zip format). This is available for only customized Windows operating-system profiles.
  • BUNDLESIG. Bundle signature files (in .asc format). This is available for only customized Windows operating-system profiles.
  • CONFIG. Configuration-settings file (in JSON format)
  • DUD. Device driver. This is available for customized Windows and Linux operating-system profiles.
  • OS. (default) OS image
  • OSPROFILE. Customized OS image profile
  • SCRIPT. Installation-script file
  • SOFTWARE. Archive file (in .zip or .tar.gz format) that encapsulates the post-install software payload
  • UNATTEND. Unattend file (in kickstart .cfg, autoyast .xml, or Windows .xml format)
osRequired when --imagetype is BOOT, CONFIG,DUD, SCRIPT, SOFTWARE, or UNATTENDIntegerOperating system that is associated with the uploaded file. This can be one of the following values.
  • esxi

  • rhels

  • sles

  • win

pathOptionalIntegerFull path to the OS image on the remote file server
Note
This field is applicable only when serverId is specified.
serverIdOptionalIntegerProfile ID for the remote file server
Tip
To obtain the profile ID, use the osimages remotefileservers method.

For example,

{
"description": "rhel 76 iso",
"imageName": "RHEL76",
"file": "/home/naval/osimage_test/RHEL-7.6-20181010.0-Server-x86_64-dvd1.iso",
"jobId": 87,
"os": "rhels",
"osrelease": "7.6"
}

{-t | --imagetype} <image_type>

Imports an image of the specified type. This can be one of the following values.

  • BOOT. Boot-options file. This is available for only customized Windows operating-system profiles.
  • BUNDLE. Bundle file (in .zip format). This is available for only customized Windows operating-system profiles.
  • BUNDLESIG. Bundle signature files (in .asc format). This is available for only customized Windows operating-system profiles.
  • CONFIG. Configuration-settings file (in JSON format)
  • DUD. Device driver. This is available for customized Windows and Linux operating-system profiles.
  • OS. (default) OS image
  • OSPROFILE. Customized OS image profile
  • SCRIPT. Installation-script file
  • SOFTWARE. Archive file (in .zip or .tar.gz format) that encapsulates the post-install software payload
  • UNATTEND. Unattend file (in kickstart .cfg, autoyast .xml, or Windows .xml format)
Note
Unattend files and custom configuration-schema files are specific to a custom OS-image profile and are added and modified using osimages hostplatforms
{-v | --view} <filter>
Identifies the view to use for the returned data. If a filter is not specified, the default view is used.

You can also create custom views (see Creating custom views).

Examples

The following example creates a job to import an OS image and then imports the image from the remote server using the job ID.

connect --url https://192.0.2.0 --user ADMIN -noverify 
osimages import -t OS -v import_job
osimages import -v result -t OS -o '{"imageName": "fixed", "jobId": 26, "os": "rhels",
"path": "iso/rhel73.iso", "serverId": "1"}'

The following example creates a job to import an OS image and then imports the image from the remote server using the job ID.

connect --url https://192.0.2.0 --user ADMIN -noverify 
osimages import -t OS -v import_job
osimages import -v result -t OS -o ' {"description": "rhel 76 iso", "imageName": "RHEL76",
"file": "/home/naval/osimage_test/RHEL-7.6-20181010.0-Server-x86_64-dvd1.iso",
"jobId": 87, "os": "rhels", "osrelease": "7.6"} '

The following example creates a job to import a custom script and then imports the custom script from the remote server using the job ID.

connect --url https://192.0.2.0 --user ADMIN -noverify 
osimages import -t SCRIPT -v import_job
osimages import -v result -t OS -o '{"imageName": "Test", "file": "/home/naval/test.py",
"jobId": 26, "os": "rhels"}'