< Back

Set-iBMCOSDeployConfig

Tue Jan 14, 2020 3:09 am

NAME Set-iBMCOSDeployConfig



SYNOPSIS

Update Smart Provisioning OS deploy configuration.





SYNTAX

Set-iBMCOSDeployConfig [-Session] <RedfishSession[]> [-ConfigFileURI] <String[]> [<CommonParameters>]





DESCRIPTION

Update Smart Provisioning OS deploy configuration.

Tips:

- This function only supports V5 servers with BIOS version later than 0.39.

- This function can only be used with a valid license.





PARAMETERS

-Session <RedfishSession[]>

iBMC redfish session object which is created by Connect-iBMC cmdlet.

A session object identifies an iBMC server to which this cmdlet will be executed.



Required? true

Position? 1

Default value

Accept pipeline input? true (ByValue, ByPropertyName)

Accept wildcard characters? false



-ConfigFileURI <String[]>

Indicates the configuration file path of Smart Provisioning OS deployment.

The URI should be a local file with JSON format that could be read directly.

For examples:

- local: C:\\ibmc-os-deploy-config-centos.json

- CIFS: \\\\192.168.1.2\\ibmc-os-deploy-config-centos.json



You can get the specification of OS deployment configuration file at segment 2.2.64 in document

https://support.huawei.com/enterprise/e ... 82482%7C21

149487



One simple example for deploy CentOS:



{

"InstallMode": "Recommended",

"OSType": "CentOS7U3",

"BootType": "UEFIBoot",

"RootPwd": "Chajian12#$",

"HostName": "puppet",

"Language": "en_US.UTF-8",

"TimeZone": "Asia/Shanghai",

"Keyboard": "us",

"CheckFirmware": false,

"AutoPosition": true,

"Autopart": true,

"Software": [

{

"FileName": "iBMA"

}

],

"Partition": [],

"NetCfg": [],

"Packages": []

}



Required? true

Position? 2

Default value

Accept pipeline input? true (ByValue, ByPropertyName)

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS



OUTPUTS

PSObject

Returns current Smart Provisioning OS deploy configuration if cmdlet executes successfully.

In case of an error or warning, exception will be returned.





-------------------------- EXAMPLE 1 --------------------------



PS C:\\>$credential = Get-Credential



PS C:\\> $session = Connect-iBMC -Address 10.1.1.2 -Credential $credential -TrustCert

PS C:\\> $ConfigFileURI = 'C:\\ibmc-os-deploy-config-centos.json'

PS C:\\> $DeployConfig = Set-ibmcOSDeployConfig -Session $session -ConfigFileURI

PS C:\\> $DeployConfig



Host : 10.1.1.2

Id : 1

Name : SP OS Install Parameter

InstallMode : Recommended

OSType : CentOS7U3

BootType : UEFIBoot

RootPwd : This1sNotSecure

HostName : SP-OS-deploy

Autopart : True

AutoPosition : True

Language : en_US.UTF-8

TimeZone : Asia/Shanghai

Keyboard : us

CheckFirmware : False

Partition : {}

Software : {@{FileName=iBMA}}

NetCfg : {}

Packages : {@{PackageName=System.Object[]; PatternName=System.Object[]}}





this example shows how to update the OS deploy config









-------------------------- EXAMPLE 2 --------------------------



PS C:\\># update iBMC OS deploy configuration



PS C:\\> $credential = Get-Credential

PS C:\\> $session = Connect-iBMC -Address 10.1.1.2 -Credential $credential -TrustCert

PS C:\\> $ConfigFileURI = 'C:\\ibmc-os-deploy-config-centos.json'

PS C:\\> Set-iBMCOSDeployConfig -Session $session -ConfigFileURI



# connect virtual media to a CentOS 7.3 image

PS C:\\> Disconnect-iBMCVirtualMedia $session

PS C:\\> $OSImageFileURI = 'nfs://10.10.10.3/CentOS-7-x86_64-Minimal-1611.iso'

PS C:\\> Connect-iBMCVirtualMedia $session -ImageFilePath $OSImageFileURI



# Enable Smart Provisioning service

PS C:\\> Set-iBMCSPService -Session $session -StartEnabled $true -SysRestartDelaySeconds 60



# Restart OS

PS C:\\> Set-iBMCServerPower -Session $session -ResetType ForceRestart





This example shows the workflow of the OS deployment











RELATED LINKS

https://github.com/Huawei/Huawei-iBMC-Cmdlets



Get-iBMCOSDeployConfig

Set-iBMCOSDeployConfig

Set-iBMCSPService

Connect-iBMCVirtualMedia

Disconnect-iBMCVirtualMedia

Connect-iBMC

Disconnect-iBMC