共用方式為


Set-AzureRmVmssStorageProfile

設定 VMSS 的記憶體設定檔屬性。

警告

自 2024 年 2 月 29 日起,AzureRM PowerShell 模組已正式淘汰。 建議使用者從 AzureRM 遷移至 Az PowerShell 模組,以確保持續支援和更新。

雖然 AzureRM 模組可能仍可運作,但不再維護或支援它,但會根據用戶的判斷權和風險放置任何繼續使用。 如需轉換至 Az 模組的指引,請參閱我們的 移轉資源

語法

Set-AzureRmVmssStorageProfile
   [-VirtualMachineScaleSet] <PSVirtualMachineScaleSet>
   [[-ImageReferencePublisher] <String>]
   [[-ImageReferenceOffer] <String>]
   [[-ImageReferenceSku] <String>]
   [[-ImageReferenceVersion] <String>]
   [[-OsDiskName] <String>]
   [[-OsDiskCaching] <CachingTypes>]
   [[-OsDiskCreateOption] <String>]
   [[-OsDiskOsType] <OperatingSystemTypes>]
   [[-Image] <String>]
   [[-VhdContainer] <String[]>]
   [-ImageReferenceId <String>]
   [-OsDiskWriteAccelerator]
   [-DiffDiskSetting <String>]
   [-ManagedDisk <String>]
   [-DataDisk <VirtualMachineScaleSetDataDisk[]>]
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]

Description

Set-AzureRmVmss 儲存體 Profile Cmdlet 會設定虛擬機擴展集 (VMSS) 的記憶體配置檔屬性。

範例

範例 1:設定 VMSS 的記憶體設定檔屬性

PS C:\> Set-AzureRmVmssStorageProfile -VirtualMachineScaleSet "ContosoVMSS" -Name "Test" -OsDiskCreateOption "FromImage" -OsDiskCaching "None" `
            -ImageReferenceOffer $ImgRef.Offer -ImageReferenceSku $ImgRef.Skus -ImageReferenceVersion $ImgRef.Version `
            -ImageReferencePublisher $ImgRef.PublisherName -VhdContainer $VhdContainer

此命令會設定名為 ContosoVMSS 之 VMSS 的記憶體設定檔屬性。

參數

-Confirm

執行 Cmdlet 之前先提示您確認。

類型:SwitchParameter
別名:cf
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-DataDisk

指定數據磁碟物件。

類型:VirtualMachineScaleSetDataDisk[]
Position:Named
預設值:None
必要:False
接受管線輸入:True
接受萬用字元:False

-DefaultProfile

用於與 azure 通訊的認證、帳戶、租用戶和訂用帳戶。

類型:IAzureContextContainer
別名:AzureRmContext, AzureCredential
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-DiffDiskSetting

指定作業系統磁碟的差異磁碟設定。

類型:String
Position:Named
預設值:None
必要:False
接受管線輸入:True
接受萬用字元:False

-Image

指定使用者映像的 Blob URI。 VMSS 會在使用者映像的相同容器中建立作業系統磁碟。

類型:String
Position:9
預設值:None
必要:False
接受管線輸入:True
接受萬用字元:False

-ImageReferenceId

指定影像參考標識碼。

類型:String
Position:Named
預設值:None
必要:False
接受管線輸入:True
接受萬用字元:False

-ImageReferenceOffer

指定虛擬機映像 (VMImage) 供應項目的類型。 若要取得映像供應專案,請使用 Get-AzureRmVMImageOffer Cmdlet。

類型:String
Position:2
預設值:None
必要:False
接受管線輸入:True
接受萬用字元:False

-ImageReferencePublisher

指定 VMImage 發行者的名稱。 若要取得發行者,請使用 Get-AzureRmVMImagePublisher Cmdlet。

類型:String
Position:1
預設值:None
必要:False
接受管線輸入:True
接受萬用字元:False

-ImageReferenceSku

指定 VMImage SKU。 若要取得 SKU,請使用 Get-AzureRmVMImageSku Cmdlet。

類型:String
Position:3
預設值:None
必要:False
接受管線輸入:True
接受萬用字元:False

-ImageReferenceVersion

指定 VMImage 的版本。 若要使用最新版本,請指定latest的值,而不是特定版本。

類型:String
Position:4
預設值:None
必要:False
接受管線輸入:True
接受萬用字元:False

-ManagedDisk

指定受控磁碟。

類型:String
Position:Named
預設值:None
必要:False
接受管線輸入:True
接受萬用字元:False

-OsDiskCaching

指定作業系統磁碟的快取模式。 此參數可接受的值為:

  • ReadOnly
  • ReadWrite 預設值為 ReadWrite。 如果您變更快取值,Cmdlet 將會重新啟動虛擬機。 此設定會影響磁碟的一致性和效能。
類型:Nullable<T>[CachingTypes]
接受的值:None, ReadOnly, ReadWrite
Position:6
預設值:None
必要:False
接受管線輸入:True
接受萬用字元:False

-OsDiskCreateOption

指定此 Cmdlet 如何建立 VMSS 虛擬機。 此參數可接受的值為:

  • 附加:當您使用特製化磁碟來建立 VMSS 虛擬機時,會使用此值。
  • FromImage :當您使用映射來建立 VMSS 虛擬機時,會使用此值。 如果您使用平臺映像,您也會使用 imageReference 參數。
類型:String
Position:7
預設值:None
必要:False
接受管線輸入:True
接受萬用字元:False

-OsDiskName

指定作業系統磁碟的名稱。

類型:String
別名:Name
Position:5
預設值:None
必要:False
接受管線輸入:True
接受萬用字元:False

-OsDiskOsType

指定磁碟上的作業系統類型。 這僅適用於使用者映像案例,而不是平臺映像。

類型:Nullable<T>[OperatingSystemTypes]
接受的值:Windows, Linux
Position:8
預設值:None
必要:False
接受管線輸入:True
接受萬用字元:False

-OsDiskWriteAccelerator

指定OS磁碟上是否應啟用或停用 WriteAccelerator。

類型:SwitchParameter
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-VhdContainer

指定用來儲存 VMSS 作業系統磁碟的容器 URL。

類型:String[]
Position:10
預設值:None
必要:False
接受管線輸入:True
接受萬用字元:False

-VirtualMachineScaleSet

指定 VMSS 物件。 若要取得物件,請使用 New-AzureRmVmssConfig 物件。

類型:PSVirtualMachineScaleSet
Position:0
預設值:None
必要:True
接受管線輸入:True
接受萬用字元:False

-WhatIf

顯示執行 Cmdlet 後會發生的情況。 未執行 Cmdlet。

類型:SwitchParameter
別名:wi
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

輸入

PSVirtualMachineScaleSet

String

Nullable<T>[[Microsoft.Azure.Management.Compute.Models.CachingTypes, Microsoft.Azure.Management.Compute, Version=21.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]

Nullable<T>[[Microsoft.Azure.Management.Compute.Models.OperatingSystemTypes, Microsoft.Azure.Management.Compute, Version=21.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]

String[]

VirtualMachineScaleSetDataDisk[]

輸出

PSVirtualMachineScaleSet