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:
Start a job to import the file using osimages import -t <image_type>.
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.
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.
Parameters Required / Optional Type Description jobID Required Integer ID of the job that was created to import files using the osimages import -t <image_type> command. checksumType Optional Integer Specify 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.
checksumValue Optional Integer Checksum string of the .ISO file. It is added as an item of the multi-part body. imageName Required Integer Name of the OS image to which you want to add the device driver (for example, redhat7.0) NoteThe operating-system image must exist in the OS images repository.imageType Required Integer Type of image being imported. This can be one of the following values. os Required when --imagetype is BOOT,
CONFIG,
DUD,
SCRIPT,
SOFTWARE,
orUNATTEND
Integer Operating system that is associated with the uploaded file. This can be one of the following values. esxi
rhels
sles
win
path Optional Integer Full path to the OS image on the remote file server NoteThis field is applicable only whenserverId is specified. serverId Optional Integer Profile ID for the remote file server TipTo obtain the profile ID, use theosimages 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.
NoteUnattend files and custom configuration-schema files are specific to a custom OS-image profile and are added and modified usingosimages 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"}'