錯誤:必須具備 compute.subnetworks.use 權限
共用虛擬私有雲可讓機構將多個專案的資源連線至通用的虛擬私有雲 (VPC) 網路,以使用該網路的內部 IP 相互通訊,安全又有效率。
Migrate to Virtual Machines 可讓您將 Compute Engine 執行個體部署至具有共用 VPC 存取權的專案。不過,如果您未將 compute.subnetworks.use
角色指派給「Migrate to Virtual Machines」預設服務帳戶,嘗試部署 Compute Engine 執行個體時,系統會顯示以下格式的錯誤訊息:
"Create instance of VM "my-vm" from source "my-proj"
to target project "target-proj" using Compute Engine instance name
"instance-id" failed due to:
Required 'compute.subnetworks.use' permission for
'projects/vpc-proj/regions/us-central1/subnetworks/shared-central1'
請務必將共用虛擬私有雲主專案的 compute.subnetworks.use
角色指派給「Migrate to Virtual Machines」預設服務帳戶,如為共用虛擬私有雲設定權限所述。
錯誤:使用者沒有服務帳戶存取權
在設定遷移 VM 的目標時,Migrate to Virtual Machines 可讓您將服務帳戶指派給在目標專案上執行的 Compute Engine 執行個體。
不過,如果要將服務帳戶指派給在目標專案上執行的 Compute Engine 執行個體,主機專案中的預設 Migrate to Virtual Machines 服務帳戶必須在目標服務帳戶上具有 Service Account User
角色。
如果您將服務帳戶指派給 Compute Engine 執行個體,但主機專案在目標服務帳戶上沒有 Service Account User
角色,則嘗試測試複製或切換 VM 時,會看到下列錯誤:
Test-Clone of VM "my-vm" from source "source-vm" to
target project "target-proj" using Compute Engine instance name "my-instance" failed due to:
The user does not have access to service account 'target-service-account-email'.
User: 'host-user-account-email'. Ask a project owner to grant you the
iam.serviceAccountUser role on the service account
請確認已正確設定預設的 Migrate to Virtual Machines 服務帳戶,以便存取目標服務帳戶。詳情請參閱「設定目標專案服務帳戶的權限」。
錯誤:因超過 vCenter 查詢上限,因此無法產生報表
為協助您判斷 Compute Engine 目標的最佳設定,Migrate to Virtual Machines 可讓您建立來源虛擬機器使用率報告。這份報表會顯示 vCenter 上部署的來源 VM 資源分配和使用率相關資訊。
這份報表是根據 vCenter 收集的資料產生。產生報表時,您可能會看到以下格式的錯誤訊息,指出已達到 vCenter 配額限制:
Report generation for source source connected to vCenter vcenter failed due to vCenter maximum query limit exceeded. Details: VC message
如要進一步瞭解如何提高配額上限,請參閱這篇vSphere 文章。
錯誤:在 Migrate to Virtual Machines 中建立的執行個體無法啟動
如果來源 VM 開機磁碟不是 VM 磁碟清單中的第一個磁碟,您可能會收到序列控制台錯誤,顯示以下訊息:
drive 0x000f2410: PCHS=0/0/0 translation=lba LCHS=1024/255/63 s=104857600
drive 0x000f23d0: PCHS=0/0/0 translation=lba LCHS=1024/255/63 s=167772160
drive 0x000f2390: PCHS=0/0/0 translation=lba LCHS=1024/255/63 s=83886080
Sending Seabios boot VM event.
Booting from Hard Disk 0...
為避免發生這項錯誤,請複製磁碟,並依正確順序將這些複本連結至「Migrate to Virtual Machines」中的新 VM。
如要複製磁碟並以正確順序連接,請按照下列步驟操作:
- 停止複製的 VM。
複製原始開機磁碟:
gcloud compute disks create -project=$PROJECT --zone=$ZONE --source-disk=$DISK new-disk-name
執行下列指令,將授權重新指派給複製的開機磁碟,並新增相關標記 (以
windows2008-r2
為例):gcloud compute disks create --project=$PROJECT --zone=$ZONE --source-disk=disk created on step #2 --licenses=projects/windows-cloud/global/licenses/windows-server-2008-r2-dc --guest-os-features=VIRTIO_SCSI_MULTIQUEUE,MULTI_IP_SUBNET,WINDOWS new-disk-name
編輯 VM:
- 卸離目前的開機磁碟,並將其連接至「Additional disks」。
- 從「Additional disks」移除原始開機磁碟。
- 在「開機磁碟」上,連結步驟 3 中建立的磁碟。
- 儲存變更。
確認 VM 的啟動程序後,您就可以刪除原始開機磁碟。
錯誤:Windows VM 在複本的首次啟動時執行「chkdsk」
在「Migrate to Virtual Machines」測試副本階段,系統會根據來源 VM 執行時拍攝的快照,在雲端中個體化 VM 的副本。
在某些情況下,這可能會在雲端啟動複本時,在 Windows VM 中觸發自動 chkdsk
掃描作業。如果這類錯誤阻斷驗證步驟,建議您在複製週期之間關閉 VM,讓「Migrate to Virtual Machines」在 VM 關閉時擷取快照。
這不會影響 VM 的切換程序,因為在「遷移至虛擬機器」完成最終同步處理階段前,VM 會在切換程序中關閉。