分享方式:


使用組態檔來部署 Azure Stack Edge 裝置

適用於: 是,適用於 Pro GPU SKUAzure Stack Edge Pro - GPU是,適用於 Pro 2 SKUAzure Stack Edge Pro 2是,適用於 Pro R SKUAzure Stack Edge Pro R是,適用於 Mini R SKUAzure Stack Edge Mini R

本文說明如何使用 PowerShell 來自動化初始裝置組態並啟用 Azure Stack Edge 裝置。 使用本文中的步驟作為本機 Web 使用者介面設定序列的替代方案。

您可以根據需要執行任意多輪裝置組態。 您還可以使用 Azure 入口網站或裝置本機使用者介面來修改裝置組態。

使用方式考量

  • 您可以使用 PowerShell Cmdlet 將個別組態變更套用至裝置;或者使用 JSON 檔案來套用大量組態變更。
  • 您可以在裝置生命週期的任何時間使用 JSON 檔案套用變更。
  • 若要使用本機 Web 使用者介面來管理裝置,請參閱連線至搭配 GPU 的 Azure Stack Edge Pro
  • 您無法使用此方法變更裝置驗證。 若要變更裝置驗證設定,請參閱變更裝置密碼
  • 不支援使用 PowerShell Cmdlet 形成叢集。 如需 Azure Stack Edge 叢集的更多資訊,請參閱安裝雙節點叢集

關於裝置設定和組態

裝置安裝和組態宣告,會使用根層級的「裝置」識別碼來定義該裝置的組態。 支援 Azure Stack Edge 裝置的宣告包括:

  • 裝置端點
  • 密碼
  • 憑證
  • 待用加密
  • Web Proxy
  • 網路
  • Time
  • 更新
  • 虛擬 IP 組態
  • 主動式記錄同意
  • 裝置啟用

裝置組態作業不需要包含每個宣告;您只能包含為裝置建立所需組態的宣告。

下列支援的 PowerShell Cmdlet 可組態 Azure Stack Edge 裝置:

指令程式 描述
Set-Login 初次登入後,設定或變更登入認證以存取裝置。
Get-DeviceConfiguration 擷取目前的裝置組態。
Set-DeviceConfiguration 變更裝置組態。
New-Package 準備裝置設定組態套件,以套用至一或多個裝置。
Get-DeviceConfigurationStatus 擷取套用至裝置的進行中組態變更之狀態,以判斷作業是成功、失敗還是仍在進行中。
Get-DeviceDiagnostic 擷取裝置的診斷狀態。
Start-DeviceDiagnostic 在套用裝置設定組態套件後,啟動新診斷執行以驗證狀態。
To-json 公用程式命令,可將 Cmdlet 回應格式化為 JSON 檔案。
Get-DeviceLogConsent 擷取裝置的主動式記錄同意設定。
Set-DeviceLogConsent 設定裝置的主動式記錄同意設定。
Get-DeviceVip 擷取 Azure Stack Edge 雙節點叢集的虛擬 IP 組態。
Set-DeviceVip 為 Azure Stack Edge 雙節點叢集設定虛擬 IP 組態。

必要條件

在您開始前,請確定您已經:

  1. 讓用戶端執行 Windows 10 或更新版本,或執行 Windows Server 2016 或更新版本。
  2. 執行 PowerShell 5.1 版或更新版本。
  3. 連線到 Azure Stack Edge 裝置的本機 Web UI。 如需詳細資訊,請參閱連線至搭配 GPU 的 Azure Stack Edge Pro
  4. 已下載 PowerShell 模組

匯入模組並登入裝置

使用以下步驟匯入 PowerShell 模組並登入裝置。

  1. 以系統管理員身分執行 PowerShell。

  2. 匯入 PowerShell 模組。

    Import-Module "<Local path to PowerShell module>"\PowerShellBasedConfiguration.psm1
    
  3. 使用 Set-Login Cmdlet 登入裝置。 首次登入需要使用 NewPassword 重設密碼。

    Set-Login "https://<IP address>" "<Password1>" "<NewPassword>"
    

擷取裝置組態

使用以下 Cmdlet 擷取裝置組態:

Get-DeviceConfiguration | To-json

將初始組態套用至裝置

進行下列步驟在 PowerShell 中建立裝置組態套件,然後將組態套用至一或多個裝置。

在 PowerShell 中執行下列 Cmdlet:

  1. 設定 time 物件屬性。

    $time = New-Object PSObject -Property @{ TimeZone = "Hawaiian Standard Time" }
    
  2. 設定 update 物件屬性。

    $update = New-Object PSObject -Property @{ ServerType = "MicrosoftUpdate" }
    
  3. 使用新的 timeupdate 設定建立套件。

    $pkg = New-Package -Time $time -Update $update
    
  4. 執行封裝。

    $newCfg = Set-DeviceConfiguration -DesiredDeviceConfig $pkg
    
  5. 確認作業已完成。

    Get-DeviceConfigurationStatus | To-json
    

    以下是範例輸出:

    PS C:\> Get-DeviceConfigurationStatus | To-json
       {
        "deviceConfiguration":  {
                                 "status":  "Complete",
                                 "results":  [
                                                 {
                                                     "declarationName":  "Time",
                                                     "resultCode":  "Success",
                                                     "errorCode":  "None",
                                                     "message":  null
                                                 },
                                                 {
                                                     "declarationName":  "Update",
                                                     "resultCode":  "Success",
                                                     "errorCode":  "None",
                                                     "message":  null
                                                 }
                                             ]
                             }
        }
     PS C:\>
    
    
  6. 作業完成之後,擷取新的裝置組態。

    Get-DeviceConfiguration | To-json
    
  7. 將裝置組態儲存為 JSON 檔案。

    Get-DeviceConfiguration | To-json | Out-File "<Local path>\TestConfig2.json"
    
  8. 將裝置組態設定儲存至 JSON 檔案後,您可以使用以下區段中的步驟以使用 JSON 檔案將這些裝置組態設定套用至一個或多個裝置。

使用 JSON 檔案更新裝置,無需啟用裝置

建立 config.json 檔案後,如前一範例所示,藉由所需組態,使用 JSON 檔案變更一個或多個裝置上的組態設定。

注意

使用符合組織需求的 config.json 檔案。 此處提供範例 JSON 檔案

設定單一節點裝置

此 PowerShell Cmdlet 序列會登入裝置、從 JSON 檔案套用裝置組態設定、驗證作業的完成情况,然後擷取新的裝置組態。

在 PowerShell 中執行下列 Cmdlet:

  1. 在執行裝置組態作業之前,請確保 JSON 檔案使用要變更之裝置的 nodeName

    注意

    每個裝置都有唯一的 nodeName。 若要變更裝置組態設定,JSON 檔案中的 nodeName 必須與要變更之裝置的 nodeName 相符。

    在 PowerShell 中使用以下命令從裝置擷取 nodeName

    Get-DeviceConfiguration | To-json
    

    以下是顯示裝置 nodeName 的範例輸出:

    
       PS C:\> Get-DeviceConfiguration | To-json
       {
         "device":  {
                          "deviceInfo":  {
                                             "model":  "Azure Stack Edge",
                                             "softwareVersion":  "2.2.2075.5523",
                                             "serialNumber":  "1HXQG13",
                                             "isActivated":  false,
                                             "nodes":  [
                                                     {
                                                         "id":  "d0d8cb16-60d4-4970-bb65-b9d254d1a289",
                                                         "name":  "1HXQG13"
                                                     }
                                                 ]
                                   },
         }
       }
    
  2. 建立可使用本機 JSON 檔案的套件,以用於裝置組態設定。

    $p = Get-Content -Path "<Local path>\<ConfigFileName.json>" | ConvertFrom-json
    
  3. 執行封裝。

    $newCfg = Set-DeviceConfiguration -DesiredDeviceConfig $p
    
  4. 監視作業的狀態。 變更可能需要 10 分鐘以上才能完成。

    Get-DeviceConfigurationStatus | To-json
    
  5. 作業完成之後,擷取新的裝置組態。

    Get-DeviceConfiguration | To-json
    

設定雙節點裝置

此 PowerShell Cmdlet 序列套用 JSON 檔案中的裝置組態設定,驗證作業的完成情况,然後擷取新的裝置組態。

注意

僅在 Azure Stack Edge Pro GPU 和 Azure Stack Edge Pro 2 裝置上支援雙節點組態。

在 PowerShell 中執行下列 Cmdlet:

  1. 在執行裝置組態作業之前,請確保 JSON 檔案使用要變更之裝置的 nodeName

    注意

    每個裝置都有唯一的 nodeName。 若要變更裝置組態設定,JSON 檔案中的 nodeName 必須與要變更之裝置的 nodeName 相符。

    在 PowerShell 中使用以下命令從裝置擷取 nodeName

    Get-DeviceConfiguration | To-json
    

    以下是顯示裝置 nodeName 的範例輸出:

    
       PS C:\> Get-DeviceConfiguration | To-json
       {
         "device":  {
                          "deviceInfo":  {
                                             "model":  "Azure Stack Edge",
                                             "softwareVersion":  "2.2.2075.5523",
                                             "serialNumber":  "1HXQG13",
                                             "isActivated":  false,
                                             "nodes":  [
                                                     {
                                                         "id":  "d0d8cb16-60d4-4970-bb65-b9d254d1a289",
                                                         "name":  "1HXQG13"
                                                     }
                                                 ]
                                   },
         }
       }
    
  2. 建立可使用本機 JSON 檔案的套件,以用於裝置組態設定。

    $p = Get-Content -Path "<Local path>\<ConfigFileName-two-node-device.json>" | ConvertFrom-json
    
  3. 執行封裝。

    $newCfg = Set-DeviceConfiguration -DesiredDeviceConfig $p
    
  4. 監視作業的狀態。 變更可能需要 10 分鐘以上才能完成。

    Get-DeviceConfigurationStatus | To-json
    
  5. 作業完成之後,擷取新的裝置組態。

    Get-DeviceConfiguration | To-json
    

    以下是範例輸出:

       PS C:\> Get-DeviceConfiguration | To-json
       {
       "device":  {
                    "deviceInfo":  {
                                             "model":  "Azure Stack Edge",
                                             "softwareVersion":  "3.2.2380.1548",
                                             "serialNumber":  "1HXG613",
                                             "isActivated":  true,
                                             "nodes":  [
                                                     {
                                                         "id":  "9b1817b9-67f5-4631-8466-447b89b829f3",
                                                         "name":  "HW6C1T2"
                                                     },
                                                     {
                                                         "id":  "b4eeebad-9395-4aa8-b6b4-2f2d66eccf58",
                                                         "name":  "1HXG613"
                                                     }
                                                 ]
                                   },
                    "deviceEndpoint":  {
                                           "name":  "DBE-1HXG613",
                                           "dnsDomain":  "microsoftdatabox.com"
                                       },
                    "encryptionAtRestKeys":  null,
                    "network":  {
                                    "dhcpPolicy":  "AttemptRenew",
                                    "interfaces":  [
                                                       {
                                                           "name":  "Port1",
                                                           "nodeName":  "1HXG613",
                                                           "nodeId":  "b4eeebad-9395-4aa8-b6b4-2f2d66eccf58",
                                                           "isDhcpEnabled":  false,
                                                           "iPv4":  {
                                                                        "address":  "192.0.2.0/24",
                                                                        "subnetMask":  "255.255.255.0",
                                                                        "gateway":  null
                                                                    },
                                                           "iPv6":  null,
                                                           "dnsServerAddresses":  null,
                                                           "dnsSuffix":  null,
                                                           "routes":  null,
                                                           "ipConfigType":  "IP"
                                                       },
                                                       {
                                                           "name":  "Port1",
                                                           "nodeName":  "HW6C1T2",
                                                           "nodeId":  "9b1817b9-67f5-4631-8466-447b89b829f3",
                                                           "isDhcpEnabled":  false,
                                                           "iPv4":  {
                                                                        "address":  "192.0.2.0/24",
                                                                        "subnetMask":  "255.255.255.0",
                                                                        "gateway":  null
                                                                    },
                                                           "iPv6":  null,
                                                           "dnsServerAddresses":  null,
                                                           "dnsSuffix":  null,
                                                           "routes":  null,
                                                           "ipConfigType":  "IP"
                                                       },
                                                       {
                                                           "name":  "Port2",
                                                           "nodeName":  "1HXG613",
                                                           "nodeId":  "b4eeebad-9395-4aa8-b6b4-2f2d66eccf58",
                                                           "isDhcpEnabled":  true,
                                                           "iPv4":  {
                                                                        "address":  "192.0.2.0/24",
                                                                        "subnetMask":  "255.255.248.0",
                                                                        "gateway":  "10.126.72.1"
                                                                    },
                                                           "iPv6":  null,
                                                           "dnsServerAddresses":  [
                                                                                      "10.50.50.50",
                                                                                      "10.50.10.50"
                                                                                  ],
                                                           "dnsSuffix":  "corp.microsoft.com",
                                                           "routes":  null,
                                                           "ipConfigType":  "IP"
                                                       },
                                                       {
                                                           "name":  "Port2",
                                                           "nodeName":  "HW6C1T2",
                                                           "nodeId":  "9b1817b9-67f5-4631-8466-447b89b829f3",
                                                           "isDhcpEnabled":  true,
                                                           "iPv4":  {
                                                                        "address":  "192.0.2.0/24",
                                                                        "subnetMask":  "255.255.248.0",
                                                                        "gateway":  "10.126.72.1"
                                                                    },
                                                           "iPv6":  null,
                                                           "dnsServerAddresses":  [
                                                                                      "10.50.50.50",
                                                                                      "10.50.10.50"
                                                                                  ],
                                                           "dnsSuffix":  "corp.microsoft.com",
                                                           "routes":  null,
                                                           "ipConfigType":  "IP"
                                                       },
                                                       {
                                                           "name":  "Port3",
                                                           "nodeName":  "1HXG613",
                                                           "nodeId":  "b4eeebad-9395-4aa8-b6b4-2f2d66eccf58",
                                                           "isDhcpEnabled":  true,
                                                           "iPv4":  {
                                                                        "address":  "192.0.2.0/24",
                                                                        "subnetMask":  "255.255.0.0",
                                                                        "gateway":  null
                                                                    },
                                                           "iPv6":  null,
                                                           "dnsServerAddresses":  [
                                                                                      "192.168.0.1"
                                                                                  ],
                                                           "dnsSuffix":  "wdshcsso.com",
                                                           "routes":  null,
                                                           "ipConfigType":  "IP"
                                                       },
                                                       {
                                                           "name":  "Port3",
                                                           "nodeName":  "HW6C1T2",
                                                           "nodeId":  "9b1817b9-67f5-4631-8466-447b89b829f3",
                                                           "isDhcpEnabled":  true,
                                                           "iPv4":  {
                                                                        "address":  "192.0.2.0/24",
                                                                        "subnetMask":  "255.255.0.0",
                                                                        "gateway":  null
                                                                    },
                                                           "iPv6":  null,
                                                           "dnsServerAddresses":  [
                                                                                      "192.168.0.1"
                                                                                  ],
                                                           "dnsSuffix":  "wdshcsso.com",
                                                           "routes":  null,
                                                           "ipConfigType":  "IP"
                                                       },
                                                       {
                                                           "name":  "Port4",
                                                           "nodeName":  "1HXG613",
                                                           "nodeId":  "b4eeebad-9395-4aa8-b6b4-2f2d66eccf58",
                                                           "isDhcpEnabled":  true,
                                                           "iPv4":  {
                                                                        "address":  "192.0.2.0/24",
                                                                        "subnetMask":  "255.255.0.0",
                                                                        "gateway":  null
                                                                    },
                                                           "iPv6":  null,
                                                           "dnsServerAddresses":  [
                                                                                      "192.168.0.1"
                                                                                  ],
                                                           "dnsSuffix":  "wdshcsso.com",
                                                           "routes":  null,
                                                           "ipConfigType":  "IP"
                                                       },
                                                       {
                                                           "name":  "Port4",
                                                           "nodeName":  "HW6C1T2",
                                                           "nodeId":  "9b1817b9-67f5-4631-8466-447b89b829f3",
                                                           "isDhcpEnabled":  true,
                                                           "iPv4":  {
                                                                        "address":  "192.168.6.99",
                                                                        "subnetMask":  "255.255.0.0",
                                                                        "gateway":  null
                                                                    },
                                                           "iPv6":  null,
                                                           "dnsServerAddresses":  [
                                                                                      "192.168.0.1"
                                                                                  ],
                                                           "dnsSuffix":  "wdshcsso.com",
                                                           "routes":  null,
                                                           "ipConfigType":  "IP"
                                                       },
                                                       {
                                                           "name":  "Port5",
                                                           "nodeName":  "1HXG613",
                                                           "nodeId":  "b4eeebad-9395-4aa8-b6b4-2f2d66eccf58",
                                                           "isDhcpEnabled":  true,
                                                           "iPv4":  {
                                                                        "address":  "192.0.2.0/24",
                                                                        "subnetMask":  "255.255.0.0",
                                                                        "gateway":  null
                                                                    },
                                                           "iPv6":  null,
                                                           "dnsServerAddresses":  [
                                                                                      "192.168.0.1"
                                                                                  ],
                                                           "dnsSuffix":  "wdshcsso.com",
                                                           "routes":  null,
                                                           "ipConfigType":  "IP"
                                                       },
                                                       {
                                                           "name":  "Port5",
                                                           "nodeName":  "HW6C1T2",
                                                           "nodeId":  "9b1817b9-67f5-4631-8466-447b89b829f3",
                                                           "isDhcpEnabled":  true,
                                                           "iPv4":  {
                                                                        "address":  "192.0.2.0/24",
                                                                        "subnetMask":  "255.255.0.0",
                                                                        "gateway":  null
                                                                    },
                                                           "iPv6":  null,
                                                           "dnsServerAddresses":  [
                                                                                      "192.168.0.1"
                                                                                  ],
                                                           "dnsSuffix":  "wdshcsso.com",
                                                           "routes":  null,
                                                           "ipConfigType":  "IP"
                                                       },
                                                       {
                                                           "name":  "Port6",
                                                           "nodeName":  "1HXG613",
                                                           "nodeId":  "b4eeebad-9395-4aa8-b6b4-2f2d66eccf58",
                                                           "isDhcpEnabled":  true,
                                                           "iPv4":  {
                                                                        "address":  "192.0.2.0/24",
                                                                        "subnetMask":  "255.255.0.0",
                                                                        "gateway":  null
                                                                    },
                                                           "iPv6":  null,
                                                           "dnsServerAddresses":  [
                                                                                      "192.168.0.1"
                                                                                  ],
                                                           "dnsSuffix":  "wdshcsso.com",
                                                           "routes":  null,
                                                           "ipConfigType":  "IP"
                                                       },
                                                       {
                                                           "name":  "Port6",
                                                           "nodeName":  "HW6C1T2",
                                                           "nodeId":  "9b1817b9-67f5-4631-8466-447b89b829f3",
                                                           "isDhcpEnabled":  true,
                                                           "iPv4":  {
                                                                        "address":  "192.0.2.0/24",
                                                                        "subnetMask":  "255.255.0.0",
                                                                        "gateway":  null
                                                                    },
                                                           "iPv6":  null,
                                                           "dnsServerAddresses":  [
                                                                                      "192.168.0.1"
                                                                                  ],
                                                           "dnsSuffix":  "wdshcsso.com",
                                                           "routes":  null,
                                                           "ipConfigType":  "IP"
                                                       }
                                                   ],
                                    "vSwitches":  [
                                                      {
                                                          "name":  "vSwitch1",
                                                          "interfaceName":  [ "Port2" ],
                                                          "enabledForCompute":  true,
                                                          "enabledForStorage":  false,
                                                          "enabledForMgmt":  true,
                                                          "supportsAcceleratedNetworking":  false,
                                                          "enableEmbeddedTeaming":  true,
                                                          "ipAddressPools":  [
                                                                                 {
                                                                                     "name":  "KubernetesNodeIPs",
                                                                                     "ipAddressRange":  "10.126.75.200-10.126.75.202"
                                                                                 },
                                                                                 {
                                                                                     "name":  "KubernetesServiceIPs",
                                                                                     "ipAddressRange":  "10.126.75.206-10.126.75.208"
                                                                                 }
                                                                             ],
                                                          "mtu":  1500
                                                      },
                                                      {
                                                          "name":  "vSwitch2",
                                                          "interfaceName":  [ "Port3" ],
                                                          "enabledForCompute":  false,
                                                          "enabledForStorage":  true,
                                                          "enabledForMgmt":  false,
                                                          "supportsAcceleratedNetworking":  false,
                                                          "enableEmbeddedTeaming":  true,
                                                          "ipAddressPools":  [
    
                                                                             ],
                                                          "mtu":  1500
                                                      },
                                                      {
                                                          "name":  "TestvSwitch",
                                                          "interfaceName":  [ "Port5" ],
                                                          "enabledForCompute":  false,
                                                          "enabledForStorage":  false,
                                                          "enabledForMgmt":  false,
                                                          "supportsAcceleratedNetworking":  true,
                                                          "enableEmbeddedTeaming":  false,
                                                          "ipAddressPools":  [
    
                                                                             ],
                                                          "mtu":  9000
                                                      }
                                                  ],
                                    "virtualNetworks":  [
                                                            {
                                                                "name":  "TestvSwitch-internal",
                                                                "vSwitchName":  "TestvSwitch",
                                                                "vlanId":  0,
                                                                "subnetMask":  "255.255.255.0",
                                                                "gateway":  "192.0.2.0/24",
                                                                "network":  "192.0.2.0/24",
                                                                "enabledForKubernetes":  false,
                                                                "ipAddressPools":  [
                                                                                       {
                                                                                           "name":  "VirtualMachineIPs",
                                                                                           "ipAddressRange":  "192.0.2.0/24"
                                                                                       }
                                                                                   ]
                                                            }
                                                        ]
                                },
                    "time":  {
                                 "timeZone":  "Pacific Standard Time",
                                 "primaryTimeServer":  "time.windows.com",
                                 "secondaryTimeServer":  null
                             },
                    "update":  {
                                   "serverType":  "None",
                                   "wsusServerURI":  null
                               },
                    "webProxy":  {
                                     "isEnabled":  false,
                                     "connectionURI":  null,
                                     "authentication":  "None",
                                     "username":  null,
                                     "password":  null
                                 }
                }
       }
       PS C:\> 
    

啟用裝置

進行下列步驟來啟用 Azure Stack Edge 裝置。 請注意,啟用程序無法復原,且啟用金鑰無法重複使用或套用到不同裝置。

  1. 擷取裝置的 ActivationKey。 如需詳細步驟,請參閱建立管理資源,以及取得啟用金鑰

  2. 設定 ActivationKey 屬性。

    $ActivationKey = "<Activation key>"
    
  3. 建立啟用物件並設定 ActivationKey 屬性。

    $activation = New-Object PsObject -Property @{ActivationKey=$ActivationKey; ServiceEncryptionKey=""}
    
  4. 建立具有啟用物件和 ActivationKey 的套件。

    $p = New-Package -Activation $activation
    
  5. 執行封裝。

    $newCfg = Set-DeviceConfiguration -DesiredDeviceConfig $p
    
  6. 監視作業的狀態。 變更可能需要 10 分鐘以上才能完成。

    Get-DeviceConfigurationStatus | To-json
    

    以下是範例輸出:

    
    PS C:\> Get-DeviceConfigurationStatus | to-json
    {
     "deviceConfiguration":  {
                                 "status":  "Complete",
                                 "results":  [
                                                 {
                                                     "declarationName":  "Network",
                                                     "resultCode":  "Success",
                                                     "errorCode":  "None",
                                                     "message":  null
                                                 },
                                                 {
                                                     "declarationName":  "Activation",
                                                     "resultCode":  "Success",
                                                     "errorCode":  "None",
                                                     "message":  null
                                                 },
                                                 {
                                                     "declarationName":  "DeviceEndpoint",
                                                     "resultCode":  "Success",
                                                     "errorCode":  "None",
                                                     "message":  null
                                                 },
                                                 {
                                                     "declarationName":  "WebProxy",
                                                     "resultCode":  "Success",
                                                     "errorCode":  "None",
                                                     "message":  null
                                                 },
                                                 {
                                                     "declarationName":  "Time",
                                                     "resultCode":  "NotExecuted",
                                                     "errorCode":  "None",
                                                     "message":  ""
                                                 },
                                                 {
                                                     "declarationName":  "Update",
                                                     "resultCode":  "NotExecuted",
                                                     "errorCode":  "None",
                                                     "message":  ""
                                                 }
                                             ]
                             }
    }
    
  7. 作業完成之後,擷取新的裝置組態。

    Get-DeviceConfiguration | To-json
    

    以下是顯示裝置已啟用的範例輸出:

    PS C:\> Get-DeviceConfiguration | To-json
    {
     "device":  {
                    "deviceInfo":  {
                                       "model":  "Azure Stack Edge",
                                       "softwareVersion":  "2.2.2075.5523",
                                       "serialNumber":  "1HXQJ23",
                                       "isActivated":  true,
                                       "nodes":  [
                                                     {
                                                         "id":  "d0d8ca16-60d4-4970-bb65-b9d254d1a289",
                                                         "name":  "1HXQG13"
                                                     }
                                                 ]
                                   },
                }
    }
    

快速擷取或變更裝置組態設定

使用以下步驟擷取 WebProxy 屬性的狀態,將 WebProxy 屬性設定為 “isEnabled = true”並設定 WebProxy URI,然後擷取變更後的 WebProxy 屬性之狀態。 執行套件之後,請確認新的裝置組態。

  1. 載入裝置組態 Cmdlet。

    $p = Get-DeviceConfiguration
    
  2. 擷取 WebProxy 屬性的狀態。

    $p.device.webproxy
    

    以下是範例輸出:

    PS C:\> $p.device.webproxy
    
    isEnabled      : False 
    connectionURI  : null
    authentication : None
    username       :
    password       :
    
  3. WebProxy 屬性設定為 “isEnabled = true”,並設定 WebProxy URI。

    $p.device.webproxy.isEnabled = $true
    $p.device.webproxy.connectionURI = "<specify a URI depending on the geographic location of the device>"
    
  4. 擷取已更新的 WebProxy 屬性狀態。

    $p.device.webproxy
    

    以下是範例輸出:

    PS C:\> $p.device.webproxy
    
    isEnabled      : True 
    connectionURI  : http://10.57.48.82:8080
    authentication : None
    username       :
    password       :
    
  5. 使用更新的 WebProxy 屬性執行套件。

    $newCfg = Set-DeviceConfiguration -DesiredDeviceConfig $p
    
  6. 監視作業的狀態。 變更可能需要 10 分鐘以上才能完成。

    Get-DeviceConfigurationStatus | To-json
    
  7. 作業完成之後,擷取新的裝置組態。

    Get-DeviceConfiguration | To-json
    

    以下是範例輸出:

      "webProxy":  {
                       "isEnabled":  true,
                       "connectionURI":  "http://10.57.48.82:8080",
                       "authentication":  "None",
                       "username":  null,
                       "password":  null
                   }
    

啟用主動式記錄收集

主動式記錄收集會收集 Azure Stack Edge 裝置上的系統健康情況指標,以協助您有效率地針對任何裝置問題進行疑難排解。 主動式記錄收集預設為啟用。 如需詳細資訊,請參閱主動式記錄收集

使用以下步驟擷取目前設定,然後啟用或停用裝置的主動式記錄。

  1. 擷取裝置組態。

    Get-DeviceConfiguration | To-json
    
  2. 啟用裝置記錄同意。

    Set-DeviceLogConsent -logConsent $true
    

    以下是範例輸出:

    PS C:\> Get-DeviceLogConsent
    False
    PS C:\> Set-DeviceLogConsent -logConsent $true
    True
    PS C:\> Get-DeviceLogConsent
    True
    PS C:\>
    
  3. 擷取裝置記錄同意組態。

    Get-DeviceLogConsent
    

執行裝置診斷

若要診斷和疑難排解裝置錯誤,請執行診斷測試。 如需詳細資訊,請參閱執行診斷

套用組態套件後,請使用以下步驟驗證裝置狀態。

  1. 執行裝置診斷。

    Start-DeviceDiagnostic
    
  2. 擷取裝置診斷作業的狀態。

    Get-DeviceDiagnostic | To-json
    

    以下是範例輸出:

           PS C:\> Get-DeviceDiagnostic | To-json
       {
          "lastRefreshTime":  "2022-09-27T20:12:10.643768Z",
          "status":  "Complete",
          "diagnostics":  [
                         {
                             "test":  "System software",
                             "category":  "Software",
                             "status":  "Succeeded",
                             "recommendedActions":  ""
                         },
                         {
                             "test":  "Disks",
                             "category":  "Hardware, Disk",
                             "status":  "Succeeded",
                             "recommendedActions":  ""
                         },
                         {
                             "test":  "Power Supply Units",
                             "category":  "Hardware",
                             "status":  "Succeeded",
                             "recommendedActions":  ""
                         },
                         {
                             "test":  "Network interfaces",
                             "category":  "Hardware",
                             "status":  "Succeeded",
                             "recommendedActions":  ""
                         },
                         {
                             "test":  "CPUs",
                             "category":  "Hardware",
                             "status":  "Succeeded",
                             "recommendedActions":  ""
                         },
                         {
                             "test":  "Network settings ",
                             "category":  "Logical, Network",
                             "status":  "Succeeded",
                             "recommendedActions":  ""
                         },
                         {
                             "test":  "Internet connectivity",
                             "category":  "Logical, Network",
                             "status":  "Succeeded",
                             "recommendedActions":  ""
                         },
                         {
                             "test":  "Web proxy",
                             "category":  "Logical, Network",
                             "status":  "NotApplicable",
                             "recommendedActions":  ""
                         },
                         {
                             "test":  "Time sync ",
                             "category":  "Logical, Time",
                             "status":  "Succeeded",
                             "recommendedActions":  ""
                         },
                         {
                             "test":  "Azure portal connectivity",
                             "category":  "Logical, Network, AzureConnectivity",
                             "status":  "Succeeded",
                             "recommendedActions":  ""
                         },
                         {
                             "test":  "Azure storage account credentials",
                             "category":  "Logical, AzureConnectivity",
                             "status":  "NotApplicable",
                             "recommendedActions":  ""
                         },
                         {
                             "test":  "Software update readiness",
                             "category":  "Logical, Update",
                             "status":  "Succeeded",
                             "recommendedActions":  ""
                         },
                         {
                             "test":  "User passwords",
                             "category":  "Logical, PasswordExpiry",
                             "status":  "Succeeded",
                             "recommendedActions":  ""
                         },
                         {
                             "test":  "Azure consistent services health check",
                             "category":  "ACS",
                             "status":  "Succeeded",
                             "recommendedActions":  ""
                         },
                         {
                             "test":  "Certificates",
                             "category":  "Certificates",
                             "status":  "Succeeded",
                             "recommendedActions":  ""
                         },
                         {
                             "test":  "Azure container read/write",
                             "category":  "Logical, Network, AzureConnectivity",
                             "status":  "NotApplicable",
                             "recommendedActions":  ""
                         },
                         {
                             "test":  "Azure Edge compute runtime",
                             "category":  "Logical, AzureEdgeCompute",
                             "status":  "Succeeded",
                             "recommendedActions":  ""
                         },
                         {
                             "test":  "Compute acceleration",
                             "category":  "Hardware, Logical",
                             "status":  "Succeeded",
                             "recommendedActions":  ""
                         }
                     ]
        }
    
    

在雙節點裝置上設定虛擬 IP 組態

注意

僅在 Azure Stack Edge Pro GPU 和 Azure Stack Edge Pro 2 裝置上支援雙節點組態。

虛擬 IP 是叢集網路中的可用 IP。 設定虛擬 IP 以連線至叢集裝置,而不是個別節點。 在雙節點裝置上連線至叢集網路的任何用戶端都必須能够存取虛擬 IP。

您可以設定 Azure 一致服務或網路檔案系統組態。 其他選項包括靜態或 DHCP 網路設定。 如需設定虛擬 IP 的詳細資訊,請參閱設定虛擬 IP

設定靜態 Azure 一致服務組態

  1. 擷取 DeviceVIP 組態。

    Get-DeviceVip | to-json
    
  2. 使用靜態 Azure 一致服務組態設定 DeviceVIP 屬性。

    $acsVip = New-Object PSObject  -Property @{ Type = "ACS"; VipAddress = "10.57.51.32"; ClusterNetworkAddress = "10.57.48.0"; IsDhcpEnabled = $false }
    
  3. 使用 DeviceVIP 屬性更新裝置。

    Set-DeviceVip -vip $acsVip
    
  4. 擷取更新的 DeviceVIP 組態。

    Get-DeviceVip | to-json
    

    以下是範例輸出:

    {
    "acsVIP":  {
                    "type":  "ACS",
                    "name":  "Azure Consistent Services",
                    "address":  "10.57.51.32",
                    "network":  {
                                    "name":  "Cluster Network 3",
                                    "address":  "10.57.48.0",
                                    "subnet":  "255.255.248.0",
                                    "dhcpEnabled":  false
                                },
                    "isDhcpEnabled":  false
     }
     }
     PS C:\> 
    

設定 DHCP Azure 一致服務組態

  1. 擷取 DeviceVIP 組態。

    Get-DeviceVip | to-json
    
  2. 設定 DeviceVIP 屬性以啟用 DHCP。

    $acsVip = New-Object PSObject  -Property @{ Type = "ACS"; VipAddress = $null; ClusterNetworkAddress = "10.57.48.0"; IsDhcpEnabled = $true }
    
  3. 使用 DeviceVIP 屬性更新裝置。

    Set-DeviceVip -vip $acsVip
    
  4. 擷取更新的 DeviceVIP 組態。

    Get-DeviceVip | to-json
    

    以下是範例輸出:

    {
    "acsVIP":  {
                   "type":  "ACS",
                   "name":  "Azure Consistent Services",
                   "address":  "10.57.53.225",
                   "network":  {
                                   "name":  "Cluster Network 3",
                                   "address":  "10.57.48.0",
                                   "subnet":  "255.255.248.0",
                                   "dhcpEnabled":  true
                               },
                   "isDhcpEnabled":  true
               },
    }
    PS C:\>
    

疑難排解

下一步