下載 Migration Center 用戶端探索 CLI

如要探索資產,您必須將 Migration Center 用戶資產評估器 CLI 下載至可存取所有目標資產的機器。機器可以是實體伺服器或虛擬機器 (VM) 執行個體。mcdc CLI 可執行檔有 Linux 和 Windows 兩種版本, 請根據要安裝的機器作業系統選擇。

mcdc CLI 會在本機安裝的機器上,對目標機器執行遠端收集指令碼,藉此探索訪客。此外,它還能使用 IP 範圍掃描功能,從多部電腦尋找及收集資料。您可以在 VMware 上執行的 VM,以及連線至主機 (裝載 mcdc CLI) 的機器上,執行訪客探索作業。

或者,如要在 AWS 和 Azure 上代管的 VM,或沒有 SSH 存取權的<High Priority Term>地端部署</High Priority Term>機器上執行探索作業,您需要下載訪客收集指令碼,並在本機執行。在 Linux 電腦上使用 mcdc-linux-collect.sh,在 Windows 電腦上使用 mcdc-windows-collect.ps1

本文說明如何下載 mcdc CLI 和收集指令碼,以探索及收集基礎架構資料。

事前準備

下載 mcdc CLI

根據電腦的作業系統,下載 mcdc CLI 的 Linux 或 Windows 可執行檔。

Linux

  • 在 Linux 電腦上,下載最新版本的 mcdc CLI 並設為可執行:
curl -O "https://mc-release.storage.googleapis.com/mcdc/$(curl -s https://mc-release.storage.googleapis.com/mcdc/latest)/mcdc"
chmod +x mcdc

Windows

  • 如要在 Windows 電腦上使用 Powershell 和 Invoke-WebRequest 下載最新版 mcdc CLI:
$ProgressPreference = 'SilentlyContinue'; $version = Invoke-RestMethod -Uri 'https://mc-release.storage.googleapis.com/mcdc/latest'; Invoke-WebRequest -Uri  "https://storage.googleapis.com/mc-release/mcdc/$($version.Trim())/windows/mcdc.exe" -OutFile mcdc.exe
  • 如要在 Windows 電腦上使用命令提示字元和 curl 下載最新版 mcdc CLI,請按照下列步驟操作:
for /f usebackq %V in (`curl -s https://mc-release.storage.googleapis.com/mcdc/latest`) do curl -O https://mc-release.storage.googleapis.com/mcdc/%V/windows/mcdc.exe
  • 如要透過直接連結下載最新版 mcdc CLI,請按照下列步驟操作:
https://mc-release.storage.googleapis.com/mcdc/current/windows/mcdc.exe

查看 mcdc CLI 的說明資訊

  • 如要查看 mcdc CLI 的說明資訊,請使用 --help 旗標:

    Linux

    ./mcdc --help

    Windows

    mcdc.exe --help

  • 如要查看特定指令的說明,請將 --help 旗標與指令搭配使用。 舉例來說,如要查看 import 指令的說明,請執行下列指令:

    Linux

    ./mcdc discover import --help

    Windows

    mcdc.exe discover import --help

下載訪客收集指令碼

如要在目標電腦上下載訪客收集指令碼,請按照下列章節的步驟操作。

在 Linux 電腦上,下載客體收集指令碼

如要在 Linux 電腦下載 mcdc-linux-collect.sh,請按照下列步驟操作:

  1. 登入電腦。

  2. 將訪客收集指令碼下載至機器,並設為可執行:

    curl -O "https://mc-release.storage.googleapis.com/mcdc/$(curl -s https://mc-release.storage.googleapis.com/mcdc/latest)/mcdc-linux-collect.sh"
    chmod +x mcdc-linux-collect.sh
    

在 Windows 機器上下載客體收集指令碼

如要在 Windows 電腦上下載 mcdc-windows-collect.ps1,請按照下列步驟操作:

  1. 登入電腦並開啟 PowerShell。

  2. 將訪客收集指令碼下載到機器:

    $version = Invoke-WebRequest -UseBasicParsing https://mc-release.storage.googleapis.com/mcdc/latest
    $WebClient = New-Object System.Net.WebClient
    $WebClient.DownloadFile("https://mc-release.storage.googleapis.com/mcdc/"+$version+"/mcdc-windows-collect.ps1", (Get-Location).Path + "\mcdc-windows-collect.ps1")
    

後續步驟