Skip to main content

Import-LXCAOSImage

This cmdlet imports a local OS image or device driver into the OS-images repository.

Note
You cannot pipe objects to this cmdlet.

Syntax

Import-LXCAOSImage [-Connection LXCAConnection] 
-ImagePath String
[-ChecksumType String]
[-ChecksumValue String]
[-AsJob]
[-WaitForJob String]
[CommonParameter]

Import-LXCAOSImage [-Connection LXCAConnection]
-ImagePath String
-DeviceDriver
[-DeviceDriver]
-OSImageName String
[-AsJob]
[-WaitForJob String]
[CommonParameter]

Parameters

-Connection LXCAConnection
Specifies the connection to the Lenovo XClarity Administrator server. If no connection is specified, the result from the last Connect-LXCA cmdlet is used.
-ImagePath String
Specifies the file path and file name to be imported.
-ChecksumType String
Specifies the checksum type. You can specify one of the following values:
  • MD5
  • SHA1
  • SHA256

If you specify the checksum types, you must also specify the -ChecksumValue parameter.

-ChecksumValue String
Specifies the checksum value to be used to check the integrity and security of the uploaded file.
-DeviceDriver
If specified, indicates that the import file is a device driver.
-OSImageName String
Specifies the name of the OS image to which you want to add the device driver (for example, redhat7.0).
Note
The OS image must exist in the OS images repository.
-AsJob
When specified, the cmdlet runs as background job and returns a Job object immediately.
-WaitForJob String
When specified with the -AsJob parameter, PowerShell waits for this background job in XClarity Administrator to either start or complete before running the next cmdlet in the script. This can be one of the following values.
  • ToStart. PowerShell waits until this background job starts in XClarity Administrator, so multiple jobs can run synchronously.

  • ToEnd. PowerShell waits until this background job completes in XClarity Administrator, so that only one job runs at a time.

If this parameter is not specified, this cmdlet does not wait. The next cmdlet in the script runs regardless of whether this background job starts or completes.

If -AsJob is not specified, this parameter is ignored.

CommonParameters
This cmdlet supports the following common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -WarningAction, -WarningVariable, -OutBuffer, -PipelineVariable, -OutVariable. For detailed information about each common parameter, see the Microsoft PowerShell Common Parameters webpage.

Results

This cmdlets imports the image into the image repository. If you specify the -AsJob parameter, this cmdlets returns a Job object.

Examples

  • The following example imports an operating-system image into the OS-images repository in synchronous mode.

    $cred = Get-Credential
    Connect-LXCA -Host 192.0.2.0 -Credential $cred

    Import-LXCAOSImage -ImagePath c:\ESXi-5.1.1-1065491-RTM-Lenovo-20130607-GA.iso
    $osimages = Get-LXCAOSImage

    Disconnect-LXCA
  • The following example imports a local OS image into the OS-images repository as a job that runs in the background and uses a loop to wait until the job completes.

    $cred = Get-Credential
    Connect-LXCA -Host 192.0.2.0 -Credential $cred

    $job = Import-LXCAOSImage -ImagePath c:\ESXi-5.1.1-1065491-RTM-Lenovo-20130607-GA.iso -AsJob
    while($job.State -eq "Running")
    {
    Start-Sleep -Seconds 5
    }
    $osimages = Get-LXCAOSImage

    Disconnect-LXCA
  • The following example imports a local OS image into the OS-images repository as a job that runs in the background and waits until the job completes.

    $cred = Get-Credential
    Connect-LXCA -Host 192.0.2.0 -Credential $cred

    $job = Import-LXCAOSImage -ImagePath c:\ESXi-5.1.1-1065491-RTM-Lenovo-20130607-GA.iso -AsJob -WaitForJob ToEnd

    $osimages = Get-LXCAOSImage

    Disconnect-LXCA