重新部署 ASDKRedeploy the ASDK

在本文中,您會了解如何在非生產環境中重新部署 Azure Stack 開發套件 (ASDK)。In this article, you'll learn how to redeploy the Azure Stack Development Kit (ASDK) in a non-production environment. 因為不支援升級 ASDK,您需要將其完全重新部署到較新的版本。Because upgrading the ASDK isn't supported, you need to completely redeploy it to move to a newer version. 您也可以在每次想要從頭開始時重新部署 ASDK。You can also redeploy the ASDK whenever you want to start from scratch.

重要

不支援將 ASDK 升級到新版本。Upgrading the ASDK to a new version isn't supported. 每當您想要評估更新的 Azure Stack 版本時,都必須在 ASDK 主機電腦上重新部署 ASDK。You've to redeploy the ASDK on the ASDK host computer each time you want to evaluate a newer version of Azure Stack.

移除 Azure 註冊Remove Azure registration

若您先前已向 Azure 註冊您的 ASDK 安裝,請先移除註冊資源,再重新部署 ASDK。If you've previously registered your ASDK installation with Azure, you should remove the registration resource before redeploying the ASDK. 重新部署 ASDK 時,請重新註冊 ASDK 以啟用市集中的項目可用性。Re-register the ASDK to enable the availability of items in the marketplace when you redeploy the ASDK. 若您先前未使用您的 Azure 訂用帳戶註冊過 ASDK,可略過本節。If you haven't previously registered the ASDK with your Azure subscription, you can skip this section.

若要移除註冊資源,請使用 Remove-AzsRegistration Cmdlet 來取消註冊 Azure Stack。To remove the registration resource, use the Remove-AzsRegistration cmdlet to unregister Azure Stack. 然後,使用 >new-azresourcegroup Cmdlet 從您的 azure 訂用帳戶中刪除 azure Stack 資源群組。Then, use the Remove-AzResourceGroup cmdlet to delete the Azure Stack resource group from your Azure subscription.

  1. 在可以存取特殊權限端點的電腦上,以系統管理員身分開啟 PowerShell 主控台。Open a PowerShell console as an admin on a computer that has access to the privileged endpoint. 對於 ASDK 而言,這就是 ASDK 主機電腦。For the ASDK, that's the ASDK host computer.

  2. 請執行下列 PowerShell 命令來取消註冊 ASDK 安裝,並從您的 Azure 訂用帳戶中刪除 azurestack 資源群組:Run the following PowerShell commands to unregister your ASDK installation and delete the azurestack resource group from your Azure subscription:

    #Import the registration module that was downloaded with the GitHub tools
    Import-Module C:\AzureStack-Tools-az\Registration\RegisterWithAzure.psm1
    
    # Provide Azure subscription admin credentials
    Add-AzAccount
    
    # Provide ASDK admin credentials
    $CloudAdminCred = Get-Credential -UserName AZURESTACK\CloudAdmin -Message "Enter the cloud domain credentials to access the privileged endpoint"
    
    # Unregister Azure Stack
    Remove-AzsRegistration `
       -PrivilegedEndpointCredential $CloudAdminCred `
       -PrivilegedEndpoint AzS-ERCS01
       -RegistrationName $RegistrationName
    
    # Remove the Azure Stack resource group
    Remove-AzResourceGroup -Name azurestack -Force
    
  3. 指令碼執行時,系統會提示您登入您的 Azure 訂用帳戶和本機 ASDK 安裝。You're prompted to sign in to both your Azure subscription and the local ASDK installation when the script runs.

  4. 指令碼完成時,您應該會看到類似下列範例的訊息:When the script completes, you should see messages similar to the following examples:

    De-Activating Azure Stack (this may take up to 10 minutes to complete). Your environment is now unable to syndicate items and is no longer reporting usage data.De-Activating Azure Stack (this may take up to 10 minutes to complete). Your environment is now unable to syndicate items and is no longer reporting usage data. Remove registration resource from Azure... "Deleting the resource..." on target "/subscriptions/<subscription information>" ********** End Log: Remove-AzsRegistration *********

現在系統應該已成功從您的 Azure 訂用帳戶中取消註冊了 Azure Stack。Azure Stack should now successfully be unregistered from your Azure subscription. 也應該刪除 azurestack 資源群組。The azurestack resource group should also be deleted. 當您第一次向 Azure 註冊 ASDK 時,就會建立此資源群組。This resource group is the one created when you first registered the ASDK with Azure.

部署 ASDKDeploy the ASDK

若要重新部署 Azure Stack,您必須從頭開始進行,如下所述。To redeploy Azure Stack, you must start over from scratch as described below. 您是否使用了 Azure Stack 安裝程式 (asdk-installer.ps1) 指令碼來安裝 ASDK,會讓接下來的步驟有所不同。The steps are different depending on whether or not you used the Azure Stack installer (asdk-installer.ps1) script to install the ASDK.

使用安裝程式指令碼重新部署 ASDKRedeploy the ASDK using the installer script

  1. 在 ASDK 電腦上,開啟提升權限的 PowerShell 主控台,並瀏覽到位於非系統磁碟機上 AzureStack_Installer 目錄中的 asdk installer.ps1 指令碼。On the ASDK computer, open an elevated PowerShell console and navigate to the asdk-installer.ps1 script in the AzureStack_Installer directory located on a non-system drive. 執行指令碼,然後按一下 [重新開機]。Run the script and click Reboot.

    執行 asdk installer.ps1 指令碼

  2. 選取基礎作業系統 (非 Azure Stack) 並按一下 [下一步]。Select the base operating system (not Azure Stack) and click Next.

    重新開機進入主機作業系統

  3. ASDK 主機重新開機進入基礎作業系統後,以本機系統管理員身分登入。找出並刪除先前部署中使用的 C:\CloudBuilder.vhdx 檔案。After the ASDK host reboots into the base operating system, log in as a local admin. Locate and delete the C:\CloudBuilder.vhdx file that was used as part of the previous deployment.

  4. 重複第一次部署 ASDK 時的相同步驟。Repeat the same steps that you took to first deploy the ASDK.

不使用安裝程式重新部署 ASDKRedeploy the ASDK without using the installer

若您未使用 asdk-installer.ps1 指令碼來安裝 ASDK,就必須先手動重新設定 ASDK 主機電腦,再重新部署 ASDK。If you didn't use the asdk-installer.ps1 script to install the ASDK, you must manually reconfigure the ASDK host computer before redeploying the ASDK.

  1. 在 ASDK 電腦上執行 msconfig.exe,啟動 [系統設定] 公用程式。Start the System Configuration utility by running msconfig.exe on the ASDK computer. 在 [開機] 索引標籤上,選取主機電腦的作業系統 (而不是 Azure Stack)、按一下 [設為預設值],然後按一下 [確定]。On the Boot tab, select the host computer operating system (not Azure Stack), click Set as default, and then click OK. 出現提示時,請按一下 [重新啟動]。Click Restart when prompted.

    設定開機組態

  2. ASDK 主機重新開機進入基礎作業系統後,以 ASDK 主機電腦的本機系統管理員身分登入。After the ASDK host reboots into the base operating system, log in as a local admin for the ASDK host computer. 找出並刪除先前部署過程中所使用的 C:\CloudBuilder.vhdx 檔案。Locate and delete the C:\CloudBuilder.vhdx file that was used as part of the previous deployment.

  3. 重複第一次使用 PowerShell 部署 ASDK 時的相同步驟。Repeat the same steps that you took to first deploy the ASDK using PowerShell.

後續步驟Next steps

部署 ASDK 後的工作Post ASDK deployment tasks