New-AzGalleryImageVersion

Katalógus képverziója.

Syntax

New-AzGalleryImageVersion
   [-ResourceGroupName] <String>
   [-GalleryName] <String>
   [-GalleryImageDefinitionName] <String>
   [-Name] <String>
   [-AsJob]
   -Location <String>
   [-DataDiskImage <GalleryDataDiskImage[]>]
   [-OSDiskImage <GalleryOSDiskImage>]
   [-PublishingProfileEndOfLifeDate <DateTime>]
   [-PublishingProfileExcludeFromLatest]
   [-ReplicaCount <Int32>]
   [-SourceImageId <String>]
   [-StorageAccountType <String>]
   [-SourceImageVMId <String>]
   [-Tag <Hashtable>]
   [-TargetRegion <Hashtable[]>]
   [-TargetExtendedLocation <Hashtable[]>]
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]

Description

Katalógus képverziója.

Példák

1. példa: Képverzió létrehozása virtuális gépről

$rgName = "myResourceGroup"
$galleryName = "myGallery"
$galleryImageDefinitionName = "myImage"
$galleryImageVersionName = "1.0.0"
$location = "eastus"
$sourceImageId = "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myVMRG/providers/Microsoft.Compute/virtualMachines/myVM"
New-AzGalleryImageVersion -ResourceGroupName $rgName -GalleryName $galleryName -GalleryImageDefinitionName $galleryImageDefinitionName -Name $galleryImageVersionName -Location $location -SourceImageId $sourceImageId

Adjon hozzá egy új képverziót egy virtuális gépről a képdefinícióhoz.

2. példa: Képverzió létrehozása felügyelt rendszerképből

$rgName = "myResourceGroup"
$galleryName = "myGallery"
$galleryImageDefinitionName = "myImage"
$galleryImageVersionName = "1.0.0"
$location = "eastus"
$sourceImageId = "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myImageRG/providers/Microsoft.Compute/images/myImage"
$storageAccountType = "StandardSSD_LRS"

New-AzGalleryImageVersion -ResourceGroupName $rgName -GalleryName $galleryName -GalleryImageDefinitionName $galleryImageDefinitionName -Name $galleryImageVersionName -Location $location -StorageAccountType $storageAccountType -SourceImageId $sourceImageId

Vegyen fel egy új rendszerképverziót egy felügyelt rendszerképből a képdefinícióba.

3. példa: Képverzió létrehozása egy másik rendszerképverzióból

$rgName = "myResourceGroup"
$galleryName = "myGallery"
$galleryImageDefinitionName = "myImage"
$galleryImageVersionName = "1.0.0"
$location = "eastus"
$sourceImageId = "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myImageRG/providers/Microsoft.Compute/galleries/myOtherGallery/images/myImageDefinition/versions/1.0.0"
New-AzGalleryImageVersion -ResourceGroupName $rgName -GalleryName $galleryName -GalleryImageDefinitionName $galleryImageDefinitionName -Name $galleryImageVersionName -Location $location -SourceImageId $sourceImageId

Képverzió másolása másik képverzióba

4. példa: Új lemezképverzió hozzáadása felügyelt lemezről

$rgName = "myResourceGroup"
$galleryName = "myGallery"
$galleryImageDefinitionName = "myImage"
$galleryImageVersionName = "1.0.0"
$location = "eastus"
$osDisk = @{Source = @{Id = "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myDiskRG/providers/Microsoft.Compute/disks/myOSDisk" }}
New-AzGalleryImageVersion -ResourceGroupName $rgName -GalleryName $galleryName -GalleryImageDefinitionName $galleryImageDefinitionName -Name $galleryImageVersionName -Location $location -OSDiskImage $osDisk

Lemezképverzió létrehozása felügyelt lemezről

5. példa: Új lemezverzió hozzáadása felügyelt lemezről, és további adatlemezek hozzáadása

$rgName = "myResourceGroup"
$galleryName = "myGallery"
$galleryImageDefinitionName = "myImage"
$galleryImageVersionName = "1.0.0"
$location = "eastus"
$osDisk = @{Source = @{Id = "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myDiskRG/providers/Microsoft.Compute/disks/myOSDisk" }}
$dataDisk0 = @{Source = @{Id = "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myDiskRG/providers/Microsoft.Compute/disks/myDataDisk" }; Lun = 0; }
$dataDisks = @($dataDisk0)
New-AzGalleryImageVersion -ResourceGroupName $rgName -GalleryName $galleryName -GalleryImageDefinitionName $galleryImageDefinitionName -Name $galleryImageVersionName -Location $location -OSDiskImage $osDisk  -DataDiskImage $dataDisks

Rendszerkép-verzió létrehozása operációs rendszer és adatlemezek megadásával

6. példa: Új képverzió hozzáadása operációsrendszer-lemez pillanatképéből

$rgName = "myResourceGroup"
$galleryName = "myGallery"
$galleryImageDefinitionName = "myImage"
$galleryImageVersionName = "1.0.0"
$location = "eastus"
$osSnapshot = @{Source = @{Id = "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mySnapshotRG/providers/Microsoft.Compute/snapshots/myOSSnapshot" }}
New-AzGalleryImageVersion -ResourceGroupName $rgName -GalleryName $galleryName -GalleryImageDefinitionName $galleryImageDefinitionName -Name $galleryImageVersionName -Location $location -OSDiskImage $osSnapshot

Lemezképverzió létrehozása lemezpillanatképből

7. példa: Új képverzió hozzáadása egy operációsrendszer-lemez pillanatképéből, és további adatlemezek hozzáadása

$rgName = "myResourceGroup"
$galleryName = "myGallery"
$galleryImageDefinitionName = "myImage"
$galleryImageVersionName = "1.0.0"
$location = "eastus"
$osSnapshot = @{Source = @{Id = "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mySnapshotRG/providers/Microsoft.Compute/snapshots/myOSSnapshot" }}
$dataSnapshot0 = @{Source = @{Id = "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mySnapshotRG/providers/Microsoft.Compute/snapshots/myDataSnapshot" }; Lun = 0; }
$dataDisks = @($dataSnapshot0)
New-AzGalleryImageVersion -ResourceGroupName $rgName -GalleryName $galleryName -GalleryImageDefinitionName $galleryImageDefinitionName -Name $galleryImageVersionName -Location $location -OSDiskImage $osSnapshot  -DataDiskImage $dataDisks

Hozzon létre egy képverziót az operációs rendszer és az adatlemezek pillanatképeinek megadásával.

8. példa: Új képverzió hozzáadása lemezek és pillanatképek kombinációjából

$rgName = "myResourceGroup"
$galleryName = "myGallery"
$galleryImageDefinitionName = "myImage"
$galleryImageVersionName = "1.0.0"
$location = "eastus"
$osSnapshot = @{Source = @{Id = "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mySnapshotRG/providers/Microsoft.Compute/snapshots/myOSSnapshot" }}
$dataDisk0 = @{Source = @{Id = "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myDiskRG/providers/Microsoft.Compute/disks/myDataDisk" }; Lun = 0; }
$dataDisks = @($dataDisk0)
New-AzGalleryImageVersion -ResourceGroupName $rgName -GalleryName $galleryName -GalleryImageDefinitionName $galleryImageDefinitionName -Name $galleryImageVersionName -Location $location -OSDiskImage $osSnapshot  -DataDiskImage $dataDisks

Hozzon létre egy képverziót egy pillanatkép operációsrendszer-lemezként és egy felügyelt lemez adatlemezként való megadásával.

9. példa: Új képverzió hozzáadása és másolása további régiókba.

$rgName = "myResourceGroup"
$galleryName = "myGallery"
$galleryImageDefinitionName = "myImage"
$galleryImageVersionName = "1.0.0"
$location = "eastus"

$sourceImageId = "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myVMRG/providers/Microsoft.Compute/virtualMachines/myVM"
$replicaCount = 1
$storageAccountType = "Standard_ZRS"

$region_eastus = @{Name = 'East US';ReplicaCount = 3;StorageAccountType = 'Standard_LRS'}
$region_westus = @{Name = 'West US'}
$region_ukwest = @{Name = 'UK West';ReplicaCount = 2}
$region_southcentralus = @{Name = 'South Central US';StorageAccountType = 'Standard_LRS'}

$targetRegions = @($region_eastus, $region_westus, $region_ukwest, $region_southcentralus)

New-AzGalleryImageVersion -ResourceGroupName $rgName -GalleryName $galleryName -GalleryImageDefinitionName $galleryImageDefinitionName -Name $galleryImageVersionName -Location $location -SourceImageId $sourceImageId -ReplicaCount 1 -StorageAccountType $storageAccountType -TargetRegion $targetRegions

Hozzon létre egy képverziót négy régióban. Ebben a példában a globális replikaszám 1, a globális tárfiók típusa pedig Standard_ZRS. Az USA keleti régiója 3 replikával rendelkezik, amelyek mindegyike Standard_LRS fióktárolóban lesz tárolva. Az USA nyugati régiója örökli a globális beállításokat, és 1 replikát tárol a Standard_ZRS. Az Egyesült Királyság nyugati régiója 2 replikaszámot fog tárolni Standard_ZRS. Az USA déli középső régiójában egy replika lesz tárolva Standard_LRS.

10. példa: Új képverzió hozzáadása titkosítással több régióban

$rgName = "myResourceGroup"
$galleryName = "myGallery"
$galleryImageDefinitionName = "myImage"
$galleryImageVersionName = "1.0.0"
$location = "eastus"
$sourceImageId = "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myVMRG/providers/Microsoft.Compute/virtualMachines/myVM"
$replicaCount = 1
$storageAccountType = "Standard_ZRS"

# East US regional settings
$eastUSdes = "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myDESrg/providers/Microsoft.Compute/diskEncryptionSets/myEastUSDES"
$encryption_eastus_os = @{DiskEncryptionSetId = $eastUSdes }
$encryption_eastus_dd0 = @{DiskEncryptionSetId = $eastUSdes; Lun = 0 }
$encryption_eastus_dd = @($encryption_eastus_dd0)
$eastus_encryption = @{OSDiskImage = $eastus_encryption_os; DataDiskImages = $eastus_encryption_dd }
$region_eastus = @{Name = 'East US';ReplicaCount = 3;StorageAccountType = 'Standard_LRS'; Encryption = $encryption_eastus}

# West US regional settings
$westUS2des = "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myDESrg/providers/Microsoft.Compute/diskEncryptionSets/myWestUSDES"
$encryption_westus_os = @{DiskEncryptionSetId = $westUSdes }
$encryption_westus_dd0 = @{DiskEncryptionSetId = $westUSdes; Lun = 0 }
$encryption_westus_dd = @($encryption_westus_dd0)
$westus_encryption = @{OSDiskImage = $encryption_westus_os; DataDiskImages = $encryption_westus_dd }
$region_westus = @{Name = 'West US'; Encryption = $westus_encryption}

# Create images
$targetRegions = @($region_eastus, $region_westus)
New-AzGalleryImageVersion -ResourceGroupName $rgName -GalleryName $galleryName -GalleryImageDefinitionName $galleryImageDefinitionName -Name $galleryImageVersionName -Location $location -SourceImageId $sourceImageId -TargetRegion $targetRegions

Hozzon létre egy képverziót titkosítással két régióban. A lemeztitkosítási készletek regionális erőforrások, és minden régióban más lemeztitkosítási csoportot kell használni.

11. példa: Képverzió létrehozása és kizárása a legújabb verzióból

$rgName = "myResourceGroup"
$galleryName = "myGallery"
$galleryImageDefinitionName = "myImage"
$galleryImageVersionName = "1.0.0"
$location = "eastus"
New-AzGalleryImageVersion -ResourceGroupName $rgName -GalleryName $galleryName -GalleryImageDefinitionName $galleryImageDefinitionName -Name $galleryImageVersionName -Location $location -SourceImageId $sourceImageId -PublishingProfileExcludeFromLatest

Adjon hozzá egy új képverziót egy képdefinícióhoz, de ne vegye figyelembe a legújabb verziót a képdefinícióban.

12. példa: Képverzió létrehozása és élettartamának beállítása

$rgName = "myResourceGroup"
$galleryName = "myGallery"
$galleryImageDefinitionName = "myImage"
$galleryImageVersionName = "1.0.0"
$location = "eastus"
$endOfLifeDate = "2024-08-02T00:00:00+00:00"
New-AzGalleryImageVersion -ResourceGroupName $rgName -GalleryName $galleryName -GalleryImageDefinitionName $galleryImageDefinitionName -Name $galleryImageVersionName -Location $location -SourceImageId $sourceImageId -PublishingProfileEndOfLifeDate $endOfLifeDate

Ez a példa a képverzió élettartamának lejárati dátumát 2024. augusztus 2-ra állítja mignight UTC időpontban. A képdefiníciókhoz és a képverziókhoz is megadható élettartam-dátum. A képverziók az élettartam lejárta után is használhatók.

13. példa: Képverzió létrehozása bizalmas virtuális géphez

$rgName = "myResourceGroup"
$galleryName = "myGallery"
$galleryImageDefinitionName = "cvmImage"
$galleryImageVersionName = "1.0.0"
$location = "North Europe"

$sourceImageId = "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myVMRG/providers/Microsoft.Compute/virtualMachines/myVM"
$cvmDiskEncryptionSetId = "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myVMRG/providers/Microsoft.Compute/diskEncryptionSets/cvmDiskEncryptionSet"
$dataDiskEncryptionSetId = "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myVMRG/providers/Microsoft.Compute/diskEncryptionSets/dataDiskEncryptionSet"

$cvmOsDiskEncryption = @{CVMEncryptionType='EncryptedWithCmk'; CVMDiskEncryptionSetID=$cvmDiskEncryptionSetId}

$cvmDataDiskEncryption_lun0 = @{DiskEncryptionSetId = $dataDiskEncryptionSetId ; Lun = 0}
$cvmDataDiskEncryption = @($cvmDataDiskEncryption_lun0)

$cvmEncryption = @{OSDiskImage = $cvmOsDiskEncryption; DataDiskImages = $cvmDataDiskEncryption}
$region_northEurope = @{Name = 'NorthEurope';ReplicaCount = 3;StorageAccountType = 'Standard_LRS'; Encryption = $cvmEncryption}
$targetRegions = @($region_northEurope)

New-AzGalleryImageVersion -ResourceGroupName $rgName -GalleryName $galleryName -GalleryImageDefinitionName $galleryImageDefinitionName -Name $galleryImageVersionName -Location $location -SourceImageId $sourceImageId -ReplicaCount 1 -StorageAccountType "Standard_LRS" -TargetRegion $targetRegions

Ebben a példában a Bizalmas virtuális gép (CVM) rendszerképe ügyfél által felügyelt kulccsal (CMK) a BizalmasVM biztonsági típust támogató képdefiníció alatt jön létre.

14. példa: Képverzió létrehozása kiterjesztett célhelyen

$rgName = "myResourceGroup"
$galleryName = "myGallery"
$galleryImageDefinitionName = "cvmImage"
$galleryImageVersionName = "1.0.0"
$location = "EastUs"
$sourceImageId = "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myVMRG/providers/Microsoft.Compute/virtualMachines/myVM"

$replicaCount = 1  
$extendedLocation = @{Name = 'microsoftlosangeles1';Type='EdgeZone'}
$edgezone_losangeles = @{Location = "westus";ExtendedLocation=$extendedLocation;ReplicaCount = 3;StorageAccountType = 'StandardSSD_LRS'}  
$targetExtendedLocations = @($edgezone_losangeles) 

New-AzGalleryImageVersion -ResourceGroupName $rgName -GalleryName $galleryName -GalleryImageDefinitionName $galleryImageDefinitionName -Name $galleryImageVersionName -Location $location -SourceImageId $sourceImageId -ReplicaCount 1 -StorageAccountType "Standard_LRS" -TargetExtendedLocation $targetExtendedLocations

Ez a példa létrehoz egy kivonatolót a megcélzott kiterjesztett hely tulajdonságaihoz, és a -TargetExtendedLocation paraméterrel adja át.

Paraméterek

-AsJob

Parancsmag futtatása a háttérben

Type:SwitchParameter
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Confirm

Jóváhagyást kér a parancsmag futtatása előtt.

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-DataDiskImage

Adatlemezképek. pl. @{Source = @{Id = <source_id>}; Lun = 1; SizeInGB = 100; HostCaching = "ReadOnly" }

Type:GalleryDataDiskImage[]
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-DefaultProfile

Az Azure-ral való kommunikációhoz használt hitelesítő adatok, fiók, bérlő és előfizetés.

Type:IAzureContextContainer
Aliases:AzContext, AzureRmContext, AzureCredential
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-GalleryImageDefinitionName

A katalógus neve.

Type:String
Aliases:GalleryImageName
Position:2
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-GalleryName

A katalógus neve.

Type:String
Position:1
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-Location

Erőforrás helye

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-Name

A katalógus képverziójának neve.

Type:String
Aliases:GalleryImageVersionName
Position:3
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-OSDiskImage

Operációsrendszer-lemezkép, például @{Source = @{Id = <source_id>}; SizeInGB = 100; HostCaching = "ReadOnly" }

Type:GalleryOSDiskImage
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-PublishingProfileEndOfLifeDate

A katalógus képverziójának lejárati dátuma.

Type:DateTime
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-PublishingProfileExcludeFromLatest

Ha be van állítva, a rendszerképdefiníció legújabb verziójából üzembe helyezett virtuális gépek nem fogják használni ezt a rendszerképverziót.

Type:SwitchParameter
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-ReplicaCount

A létrehozandó képverzió replikáinak száma régiónként.

Type:Int32
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-ResourceGroupName

Az erőforráscsoport neve.

Type:String
Position:0
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-SourceImageId

Annak a forrásrendszerképnek az azonosítója, amelyből a rendszerképverzió létrejön.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-SourceImageVMId

A forrás virtuális gép erőforrás-azonosítója. Csak akkor szükséges, ha egy virtuális gépet rögzít a katalógus képverziója forrásként.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-StorageAccountType

Megadja a rendszerkép tárolásához használandó tárfiók típusát. Ez a tulajdonság nem frissíthető. Az elérhető értékek Standard_LRS, Standard_ZRS és Premium_LRS.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-Tag

Erőforráscímkék

Type:Hashtable
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-TargetExtendedLocation

A célként megadott kiterjesztett helyek, ahová a rendszerképverzió replikálva lesz. Ez a tulajdonság frissíthető.

Type:Hashtable[]
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-TargetRegion

Azok a célrégiók, amelyekbe a rendszerképverzió replikálva lesz.

Type:Hashtable[]
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-WhatIf

Bemutatja, mi történne a parancsmag futtatásakor. A parancsmag nem fut.

Type:SwitchParameter
Aliases:wi
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

Bevitelek

String

Hashtable

Int32

SwitchParameter

DateTime

Hashtable[]

Kimenetek

PSGalleryImageVersion