호스트 프로젝트에서 Migrate to Virtual Machines API를 사용 설정하면 Migrate to Virtual Machines에서 기본 서비스 계정을 만듭니다.
대상 프로젝트에서 Compute Engine 인스턴스를 실행하기 위해 사용되는 서비스 계정을 할당할 수 있으려면 Migrate to Virtual Machines 기본 서비스 계정에 필요한 권한을 추가해야 합니다.
Compute Engine 인스턴스를 실행하기 위해 사용되는 서비스 계정 정보
VM을 테스트 클론하거나 컷오버하기 전에 마이그레이션된 VM을 호스팅하는 데 사용되는 Compute Engine 인스턴스의 대상 세부정보를 구성해야 합니다. 테스트 환경과 프로덕션 환경 모두에서 Compute Engine 인스턴스의 대상 세부정보를 구성하여 다음을 지정합니다.
Google 프로젝트
CPU 개수
메모리 양
디스크 크기
예를 들어 다음과 같은 환경이 있다고 가정해 보겠습니다.
프로젝트 A - Migrate to Virtual Machines 호스트 프로젝트
프로젝트 B - Compute Engine 대상 프로젝트
기본적으로 대상 프로젝트 B에서 실행되는 Compute Engine 인스턴스는 할당된 서비스 계정이 없습니다.
대상 Compute Engine 인스턴스에Google Cloud 서비스 및 API에 대한 액세스가 필요하면 대상 프로젝트에서 이러한 서비스 및 API에 액세스하는 데 필요한 권한을 사용하여 서비스 계정을 만듭니다.
그런 후 대상 세부정보를 구성할 때 Compute Engine 인스턴스에 서비스 계정을 할당합니다.
Migrate to Virtual Machines 호스트 프로젝트에서 Compute Engine 인스턴스의 모든 구성을 수행합니다. 대상 프로젝트에서 Compute Engine 인스턴스로 서비스 계정을 할당할 수 있으려면 먼저 Migrate to Virtual Machines 기본 서비스 계정에 대상 서비스 계정에 대해 필요한 권한이 있는지 확인해야 합니다.
기본 서비스 계정 구성
대상 프로젝트에 실행 중인 Compute Engine 인스턴스에 서비스 계정을 할당하려면 호스트 프로젝트에 있는 기본 Migrate to Virtual Machines 서비스 계정을 대상 서비스 계정의 Service Account User 역할에 추가해야 합니다.
기본 서비스 계정을 서비스 계정 사용자 역할에 추가하려면 다음 안내를 따르세요.
Migrate to Virtual Machines 기본 서비스 계정의 이메일 주소를 확인합니다.
Google Cloud 콘솔에서 Migrate to Virtual Machines 페이지를 엽니다.
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["이해하기 어려움","hardToUnderstand","thumb-down"],["잘못된 정보 또는 샘플 코드","incorrectInformationOrSampleCode","thumb-down"],["필요한 정보/샘플이 없음","missingTheInformationSamplesINeed","thumb-down"],["번역 문제","translationIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2025-04-21(UTC)"],[],[],null,["# Configure permissions on target project service account\n\nMigrate to Virtual Machines creates a default service account when you enable the\nMigrate to Virtual Machines API on the host project.\n\nTo be able to assign the service account used to run a Compute Engine instance\non a target project, you must add the necessary permissions to the\nMigrate to Virtual Machines default service account.\n\nAbout the service account used to run a Compute Engine instance\n---------------------------------------------------------------\n\nBefore you can test-clone or cut-over a VM, you must configure the target\ndetails of the [Compute Engine](/compute/docs/how-to) instance used to host\nthe migrated VM. For both a test and a production environment, configure the\ntarget details for the Compute Engine instance to specify:\n\n- Google project\n- Number of CPUs\n- Amount of memory\n- Disk size\n\nFor example, you have the following environment:\n\n- Project A - Migrate to Virtual Machines **host** project\n- Project B - Compute Engine **target** project\n\nBy default, the Compute Engine instance running on target Project B\ndoes not have a service account assigned to it.\n\nIf the target Compute Engine instance requires access to\nGoogle Cloud services and APIs, [create a service account](/compute/docs/access/create-enable-service-accounts-for-instances#createanewserviceaccount) in the\ntarget project with the necessary permissions to access those services and APIs.\nThen, assign that service account to the Compute Engine instance when you\n[configure its target details](/migrate/virtual-machines/docs/5.0/migrate/migrating-vms#configure-target).\n\nYou perform all configuration of Compute Engine instances from the\nMigrate to Virtual Machines host project. Before you can assign a service account in\nthe target project to aCompute Engine instance, you must ensure that the\nMigrate to Virtual Machines default service account has the necessary permissions on\nthe target service account.\n\nConfiguring the default service account\n---------------------------------------\n\nTo assign a service account to a [Compute Engine](/compute/docs/how-to)\ninstance running on a **target** project, the default Migrate to Virtual Machines\nservice account on the **host** project must be added to the `Service Account User`\nrole on the target service account.\n\n**To add the default service account to the Service Account User role:**\n\n1. Determine the email address of the Migrate to Virtual Machines default service\n account:\n\n 1. Open the Migrate to Virtual Machines page in the Google Cloud console:\n\n [Go to the Migrate to Virtual Machines page](https://console.cloud.google.com/compute/mfce)\n 2. Select the **Targets** tab.\n\n At the top of the page is an information box showing the email address of\n the Migrate to Virtual Machines default service account in the form:\n\n `service-`\u003cvar translate=\"no\"\u003eHOST_PROJECT_NUMBER\u003c/var\u003e`@gcp-sa-vmmigration.iam.gserviceaccount.com`\n 3. Save that email address for use below.\n\n2. In the Google Cloud console, go to the **Service Accounts** page.\n\n [Go to the Service Accounts page](https://console.cloud.google.com/iam-admin/serviceaccounts)\n3. Select the **target** project.\n\n4. Select the checkbox next to the chosen **target** service account.\n\n5. Click **Manage Access**.\n A list of roles that have been granted on the service account are displayed.\n\n6. Expand the **Service Account User** role to view the principals\n that have been granted that role on the service account.\n\n7. If the email address of the Migrate to Virtual Machines default service account is\n not listed, select **Add Principal**.\n\n8. Enter the email address of the Migrate to Virtual Machines default service account\n as the **New principal**.\n\n9. Select the **Service Accounts \\\u003e Service Account User** role.\n\n10. Select **Save**.\n\n You should now be able to assign the service account to a\n [Compute Engine](/compute/docs/how-to) instance running on a **target** project."]]