在虛擬機器上啟用 NVMe 和 SCSI 介面
警告
本文參考 CentOS,這是接近結束生命週期 (EOL) 狀態的 Linux 發行版本。 請據以考慮您的使用和規劃。 如需詳細資訊,請參閱 CentOS 生命週期結束指引。
NVMe 代表非揮發性記憶體協定,是一種通訊協定,可加速伺服器與儲存體系統之間的更快速且更有效率的資料傳輸。 透過 NVMe,資料能夠以最高輸送量和最短回應時間傳輸。 Azure 現在支援 Ebsv5 和 Ebdsv5 系列上的 NVMe 介面,為所有 GP v5 VM 系列中的遠端磁碟儲存體提供最高的 IOPS 和輸送量效能。
SCSI (小型電腦系統介面) 是傳統標準,用於在電腦與週邊裝置之間實際連線和傳輸資料。 雖然 Ebsv5 VM 大小仍支援 SCSI,但建議您切換至 NVMe 以取得更佳的效能優勢。
必要條件
VM 設定中已新增一項新功能,稱為 DiskControllerType,可讓客戶選取其慣用的控制器類型作為 NVMe 或 SCSI。 如果客戶未指定 DiskControllerType 值,平台就會根據 VM 大小設定自動選擇預設控制器。 如果 VM 大小設定為 SCSI 做為預設值並支援 NVMe,除非更新為 NVMe DiskControllerType,否則將會使用 SCSI。
若要啟用 NVMe 介面,必須符合下列必要條件:
- 選擇支援 NVMe 的 VM 系列。 需要注意的是,在 Intel v5 世代 VM 中,只有 Ebsv5 和 Ebdsv5 VM 大小配備了 NVMe。 請務必選取其中一個系列,Ebsv5 或 Ebdsv5 VM。
- 選取標記 NVMe 支援的作業系統映像
- 在 Azure 入口網站或 ARM/CLI/PowerShell 範本中選取 NVMe 磁碟控制器類型,以選擇加入 NVMe。 如需逐步指示,請參閱這裡
- 僅支援 Gen2 映像
- 選擇其中一個已啟用 NVMe 的 Azure 區域
透過符合上述這五個條件,您就能夠在支援的 VM 系列上隨時啟用 NVMe。 請遵循上述條件,使用 NVMe 成功建立或調整 VM 大小,就不會有任何複雜問題。 請參閱常見問題以了解 NVMe 啟用。
支援的作業系統映像
Linux
Distribution | 映像 |
---|---|
Almalinux 8.x (目前為 8.7) | almalinux: almalinux:8-gen2: latest |
Almalinux 9.x (目前為 9.1) | almalinux: almalinux:9-gen2: latest |
Debian 11 | Debian: debian-11:11-gen2: latest |
CentOS 7.9 | openlogic: centos:7_9-gen2: latest |
RHEL 7.9 | RedHat: RHEL:79-gen2: latest |
RHEL 8.6 | RedHat: RHEL:86-gen2: latest |
RHEL 8.7 | RedHat: RHEL:87-gen2: latest |
RHEL 9.0 | RedHat: RHEL:90-gen2: latest |
RHEL 9.1 | RedHat: RHEL:91-gen2: latest |
Ubuntu 18.04 | Canonical:UbuntuServer:18_04-lts-gen2:latest |
Ubuntu 20.04 | Canonical:0001-com-ubuntu-server-focal:20_04-lts-gen2:latest |
Ubuntu 22.04 | Canonical:0001-com-ubuntu-server-jammy:22_04-lts-gen2:latest |
Oracle 7.9 | Oracle: Oracle-Linux:79-gen2:latest |
Oracle 8.5 | Oracle: Oracle-Linuz:ol85-lvm-gen2:latest |
Oracle 8.6 | Oracle: Oracle-Linux:ol86-lvm-gen2:latest |
Oracle 8.7 | Oracle: Oracle-Linux:ol87-lvm-gen2:latest |
Oracle 9.0 | Oracle: Oracle-Linux:ol9-lvm-gen2:latest |
Oracle 9.1 | Oracle: Oracle-Linux:ol91-lvm-gen2:latest |
SLES-for-SAP 15.3 | SUSE:sles-sap-15-sp3:gen2:latest |
SLES-for-SAP 15.4 | SUSE:sles-sap-15-sp4:gen2:latest |
SLES 15.4 | SUSE:sles-15-sp4:gen2:latest |
SLES 15.5 | SUSE:sles-15-sp5:gen2:latest |
Windows
- Azure 入口網站 - 方案識別碼:2019-datacenter-core-smalldisk
- Azure 入口網站 - 方案識別碼:2019-datacenter-core-smalldisk-g2
- Azure 入口網站 - 方案識別碼:2019 datacenter-core
- Azure 入口網站 - 方案識別碼:2019-datacenter-core-g2
- Azure 入口網站 - 方案識別碼:2019-datacenter-core-with-containers-smalldisk
- Azure 入口網站 - 方案識別碼:2019-datacenter-core-with-containers-smalldisk-g2
- Azure 入口網站 - 方案識別碼:2019-datacenter-with-containers-smalldisk
- Azure 入口網站 - 方案識別碼:2019-datacenter-smalldisk
- Azure 入口網站 - 方案識別碼:2019-datacenter-smalldisk-g2
- Azure 入口網站 - 方案識別碼:2019-datacenter-zhcn
- Azure 入口網站 - 方案識別碼:2019-datacenter-zhcn-g2
- Azure 入口網站 - 方案識別碼:2019-datacenter-core-with-containers
- Azure 入口網站 - 方案識別碼:2019-datacenter-core-with-containers-g2
- Azure 入口網站 - 方案識別碼:2019-datacenter-with-containers
- Azure 入口網站 - 方案識別碼:2019-datacenter-with-containers-g2
- Azure 入口網站 - 方案識別碼:2019-datacenter
- Azure 入口網站 - 方案識別碼:2019-datacenter-gensecond
- Azure 入口網站 - 方案識別碼:2022-datacenter-core
- Azure 入口網站 - 方案識別碼:2022-datacenter-core-g2
- Azure 入口網站 - 方案識別碼:2022-datacenter-smalldisk
- Azure 入口網站 - 方案識別碼:2022-datacenter-smalldisk-g2
- Azure 入口網站 - 方案識別碼:2022-datacenter
- Azure 入口網站 - 方案識別碼:2022-datacenter-g2
- Azure 入口網站 - 方案識別碼:2022-datacenter-core-smalldisk
- Azure 入口網站 - 方案識別碼:2022-datacenter-core-smalldisk-g2
- Azure 入口網站 - 方案識別碼:2022-datacenter-azure-edition-smalldisk
- Azure 入口網站 - 方案識別碼:2022-datacenter-azure-edition
- Azure 入口網站 - 方案識別碼:2022-datacenter-azure-edition-core
- Azure 入口網站 - 方案 2022-datacenter-azure-edition-core-smalldisk
使用 NVMe 介面啟動 VM
NVMe 可以在 VM 建立期間使用各種方法啟用,例如:Azure 入口網站、CLI、PowerShell 和 ARM 範本。 若要建立 NVMe VM,您必須先在 VM 上啟用 NVMe 選項,然後選取 VM 的 NVMe 控制器磁碟類型。 請注意,如果 VM 大小支援 NVMe,則可以在建立期間啟用 NVMe diskcontrollertype,或在 VM 停止和解除配置時將其更新為 NVMe。
Azure 入口網站檢視
新增磁碟控制器篩選。 若要尋找符合 NVMe 資格的大小,請選取 [查看所有大小],選取 [磁碟控制器] 篩選,然後選取 [NVMe]:
瀏覽 [進階] 索引標籤,以啟用 NVMe 功能。
移至 [檢閱並建立],確認功能已啟用。
ARM 範例範本
{
"apiVersion": "2022-08-01",
"type": "Microsoft.Compute/virtualMachines",
"name": "[variables('vmName')]",
"location": "[parameters('location')]",
"identity": {
"type": "userAssigned",
"userAssignedIdentities": {
"/subscriptions/ <EnterSubscriptionIdHere> /resourcegroups/ManagedIdentities/providers/Microsoft.ManagedIdentity/userAssignedIdentities/KeyVaultReader": {}
}
},
"dependsOn": [
"[resourceId('Microsoft.Network/networkInterfaces/', variables('nicName'))]"
],
"properties": {
"hardwareProfile": {
"vmSize": "[parameters('vmSize')]"
},
"osProfile": "[variables('vOsProfile')]",
"storageProfile": {
"imageReference": "[parameters('osDiskImageReference')]",
"osDisk": {
"name": "[variables('diskName')]",
"caching": "ReadWrite",
"createOption": "FromImage"
},
"copy": [
{
"name": "dataDisks",
"count": "[parameters('numDataDisks')]",
"input": {
"caching": "[parameters('dataDiskCachePolicy')]",
"writeAcceleratorEnabled": "[parameters('writeAcceleratorEnabled')]",
"diskSizeGB": "[parameters('dataDiskSize')]",
"lun": "[add(copyIndex('dataDisks'), parameters('lunStartsAt'))]",
"name": "[concat(variables('vmName'), '-datadisk-', copyIndex('dataDisks'))]",
"createOption": "Attach",
"managedDisk": {
"storageAccountType": "[parameters('storageType')]",
"id": "[resourceId('Microsoft.Compute/disks/', concat(variables('vmName'), '-datadisk-', copyIndex('dataDisks')))]"
}
}
}
],
"diskControllerTypes": "NVME"
},
"securityProfile": {
"encryptionAtHost": "[parameters('encryptionAtHost')]"
},
"networkProfile": {
"networkInterfaces": [
{
"id": "[resourceId('Microsoft.Network/networkInterfaces', variables('nicName'))]"
}
]
},
"availabilitySet": {
"id": "[resourceId('Microsoft.Compute/availabilitySets', parameters('availabilitySetName'))]"
}
},
"tags": {
"vmName": "[variables('vmName')]",
"location": "[parameters('location')]",
"dataDiskSize": "[parameters('dataDiskSize')]",
"numDataDisks": "[parameters('numDataDisks')]",
"dataDiskCachePolicy": "[parameters('dataDiskCachePolicy')]",
"availabilitySetName": "[parameters('availabilitySetName')]",
"customScriptURL": "[parameters('customScriptURL')]",
"SkipLinuxAzSecPack": "True",
"SkipASMAzSecPack": "True",
"EnableCrashConsistentRestorePoint": "[parameters('enableCrashConsistentRestorePoint')]"
}
}
提示
如果您使用 PowerShell 或 CLI 工具來啟動 NVMe 支援的 VM,請使用相同的參數 DiskControllerType。