Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions examples/firmware/DirectFirmwareUpgrade.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Uncomment the following script and provide the below information to set up Intersight environment.
<#
$intersightEnv = @{
BasePath = if ($env:INTERSIGHT_ENDPOINT) { $env:INTERSIGHT_ENDPOINT } else { "https://intersight.com" }
ApiKeyId = "xxxxxxxxxxxxxxxxxx/xxxxxxxxxxxxxxxx/xxxxxxxxxxxxxxxxxx"
ApiKeyFilePath = "C:\\Users\\admin\\Downloads\\ProductionSecretKey.txt"
HttpSigningHeader = @("(request-target)", "Host", "Date", "Digest")
}

Set-IntersightConfiguration @intersightEnv
#>

$Source1 = Initialize-IntersightSoftwarerepositoryNfsServer -FileLocation "10.xx.xx.xx/shared/ucsc-845a-m8-huu-2.0.1.250000D.iso" -ObjectType "SoftwarerepositoryNfsServer"
$Account1 = Get-IntersightIamAccount -Name "my-account"
$Organization1 = Get-IntersightOrganizationOrganization -Name "test_new_org" -Account $Account1
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why to provide $account1 any specific region because API key is generated for account and it works within account boundry

$Catalog1 = Get-IntersightSoftwarerepositoryCatalog -Name "user-catalog" -Organization $Organization1
$FirmwareDistributable = New-IntersightFirmwareDistributable -Name "ucsc-845a-m8-huu-2.0.1.250000D" -ImportAction "None" -SupportedModels @("CAI-845A-M8") -Version "-" -Origin "User" -Source $Source1 -Catalog $Catalog1
$Organization2 = Get-IntersightOrganizationOrganization -Name "test_new_org" -Account $Account1
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why to call $organization2 when we have already $organization1

$Catalog2 = Get-IntersightSoftwarerepositoryCatalog -Name "user-catalog" -Organization $Organization2
$UpdatedFirmwareDistributable = $FirmwareDistributable | Set-IntersightFirmwareDistributable -Source $Source1 -Version "2.0(1.250000D)" -Catalog $Catalog2 -Name "ucsc-845a-m8-huu-2.0.1.250000D" -SupportedModels @("CAI-845A-M8") -Description "invalid CIFS image"
$DirectDownload3 = Initialize-IntersightFirmwareDirectDownload -ObjectType "FirmwareDirectDownload"
$NetworkShare3 = Initialize-IntersightFirmwareNetworkShare -Upgradeoption "NwUpgradeFull" -MapType "Nfs" -ObjectType "FirmwareNetworkShare"
$Server3 = Get-IntersightComputeRackUnit -DeviceMoId "69a54b3a6f72613101af857f" -Dn "/redfish/v1/Systems/system"
$FirmwareUpgrade = New-IntersightFirmwareUpgrade -UpgradeType "NetworkUpgrade" -Distributable $UpdatedFirmwareDistributable -DirectDownload $DirectDownload3 -NetworkShare $NetworkShare3 -Server $Server3 -ExcludeComponentList @()
34 changes: 34 additions & 0 deletions examples/os/InstallOS.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Uncomment the following script and provide the below information to set up Intersight environment.
<#
$intersightEnv = @{
BasePath = if ($env:INTERSIGHT_ENDPOINT) { $env:INTERSIGHT_ENDPOINT } else { "https://intersight.com" }
ApiKeyId = "xxxxxxxxxxxxxxxxxx/xxxxxxxxxxxxxxxx/xxxxxxxxxxxxxxxxxx"
ApiKeyFilePath = "C:\\Users\\admin\\Downloads\\ProductionSecretKey.txt"
HttpSigningHeader = @("(request-target)", "Host", "Date", "Digest")
}

Set-IntersightConfiguration @intersightEnv
#>

$Servers11 = Get-IntersightComputeRackUnit -DeviceMoId "698d5fcb6f726131016e23d4" -Dn "sys/rack-unit-1"
$ValidInstallTarget = New-IntersightOsValidInstallTarget -Servers @($Servers11)
$OsSupport = New-IntersightOsOsSupport -OsVersion "ESXi 8.0"
$Account1 = Get-IntersightIamAccount -Name "my-account"
$Organization1 = Get-IntersightOrganizationOrganization -Name "Org-Auto-8332" -Account $Account1
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do you need to pass account to get account?

please add comment before the main cmdlet operation so that user can read and understand it

$Catalog1 = Get-IntersightSoftwarerepositoryCatalog -Name "user-catalog" -Organization $Organization1
$Image31 = Get-IntersightSoftwarerepositoryOperatingSystemFile -Name "Esxi80u2_embedded" -Catalog $Catalog1
$OsduImage31 = Get-IntersightFirmwareServerConfigurationUtilityDistributable -Name "ucsxe-scu-7.1.7.260010.iso" -Catalog $Catalog1
$IpV4Config31 = Initialize-IntersightCommIpV4Interface -ObjectType "CommIpV4Interface" -Gateway "" -IpAddress "" -Netmask ""
$IpConfiguration31 = Initialize-IntersightOsIpv4Configuration -ObjectType "OsIpv4Configuration" -IpV4Config $IpV4Config31
$Answers31 = Initialize-IntersightOsAnswers -ObjectType "OsAnswers" -Hostname "google" -IpConfigType "DHCP" -IpConfiguration $IpConfiguration31 -IsRootPasswordCrypted $false -Nameserver "" -NetworkDevice "" -ProductKey "" -Source "Template" -RootPassword "123456"
$Organization4 = Get-IntersightOrganizationOrganization -Moid "5da9f0b76972652d30b3bae7"
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do we receive for the organization when using the Moid? Will it work the same way in the customer environment? How should customers determine whether they need to provide the $organization1 Moid or the $organization4 Moid?

if ($Organization4) {
$Catalog3 = Get-IntersightOsCatalog -Name "shared" -Organization $Organization4
} else {
$Catalog3 = Get-IntersightOsCatalog -Name "shared"
}
$ConfigurationFile31 = Get-IntersightOsConfigurationFile -Name "ESXi8.0ConfigFile" -Catalog $Catalog3
$InstallTarget31 = Initialize-IntersightOsPhysicalDisk -ObjectType "OsPhysicalDisk" -Name "Disk 1" -SerialNumber "W0K40V960000K141L1Z5" -StorageControllerSlotId "MRAID"
$Body31 = Initialize-IntersightOsInstall -Description "" -InstallMethod "VMedia" -Image $Image31 -OsduImage $OsduImage31 -OverrideSecureBoot $true -Organization $Organization1 -Answers $Answers31 -ConfigurationFile $ConfigurationFile31 -InstallTarget $InstallTarget31 -Server $Servers11
$Requests13 = Initialize-IntersightBulkRestSubRequest -ObjectType "BulkRestSubRequest" -Body $Body31
$BulkInstallRequest = New-IntersightBulkRequest -Verb "POST" -Uri "/v1/os/Installs" -Requests @($Requests13)