[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["很难理解","hardToUnderstand","thumb-down"],["信息或示例代码不正确","incorrectInformationOrSampleCode","thumb-down"],["没有我需要的信息/示例","missingTheInformationSamplesINeed","thumb-down"],["翻译问题","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-09-02。"],[],[],null,["# Enable Migrate to Virtual Machines services\n\nBefore you can begin a migration, you must enable the Migrate to Virtual Machines\nservice on Google Cloud and also enable all other Google Cloud\nservices required by Migrate to Virtual Machines.\n\nIdentifying your host project\n-----------------------------\n\n[Google Cloud projects](/resource-manager/docs/creating-managing-projects)\nform the basis for creating, enabling, and using Google Cloud services\nincluding managing APIs, enabling billing, adding and removing collaborators,\nand managing permissions for Google Cloud resources.\n\nMigrate to Virtual Machines uses the following types of projects:\n\n- **Host project (Required)**\n\n Use the *host* project to control the migration process and optionally to\n host the Compute Engine instances running your migrated workloads. You\n **must** create and configure a host project as described in the following\n sections.\n- **Target project (Optional)**\n\n A *target* project defines the destination project for a Compute Engine\n instance running your migrated VM. Your **host** project can be used as a\n target project. If you want to migrate VMs to additional projects, you must\n add them as target projects to Migrate to Virtual Machines. See [Adding a target project](/migrate/virtual-machines/docs/5.0/get-started/target-project) for more.\n\nTo enable Migrate to Virtual Machines services, you must identify the\nGoogle Cloud project that you want to use as the **host** project:\n\n1. In the Google Cloud console, on the project selector page, select or create a\n Google Cloud project to use as the **host** project:\n\n [Go to the project selector page](https://console.cloud.google.com/projectselector2/home/dashboard)\n2. Note the name and ID of the selected project.\n\nInstalling the gcloud CLI\n-------------------------\n\nInstall the gcloud CLI on your workstation, which also installs the\nGoogle Cloud CLI. `gcloud` is the primary CLI tool that you use to create and\nmanage Google Cloud resources. You can use `gcloud` to perform many common\nplatform tasks either from the command line or in scripts and other automations.\n\nTo install the gcloud CLI:\n\n1. Install and initialize the [gcloud CLI](/sdk/docs/install).\n\n2. Update gcloud CLI:\n\n ```\n gcloud components update\n ```\n3. Make sure that gcloud CLI is authorized to access your data and\n services:\n\n ```\n gcloud auth login\n ```\n4. A new browser tab opens and you are prompted to choose an account.\n\nEnabling required services on the host project\n----------------------------------------------\n\nWithin your host project, enable the Google Cloud services required by\nMigrate to Virtual Machines service. For more information about these services,\nsee [gcloud services](/sdk/gcloud/reference/services).\n\nThe **host** project for Migrate to Virtual Machines requires that you enable the\nfollowing Google Cloud services:\n\nTo enable the required services:\n\n1. Ensure that you have set the default project to the **host** project.\n Replace \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e with the project ID of your **host** project:\n\n ```\n gcloud config set project PROJECT_ID\n ```\n2. View the list of services already enabled on the project:\n\n ```\n gcloud services list\n ```\n3. If you don't see all of the required services listed, enable them:\n\n ```\n gcloud services enable vmmigration.googleapis.com servicemanagement.googleapis.com servicecontrol.googleapis.com iam.googleapis.com cloudresourcemanager.googleapis.com compute.googleapis.com \n ```\n4. You should now be able to open the Migrate to Virtual Machines page in the\n Google Cloud console:\n\n [Go to the Migrate to Virtual Machines page](https://console.cloud.google.com/compute/mfce)\n\nUsing predefined roles\n----------------------\n\nIdentity and Access Management includes two predefined roles that you can use to control access\nfor users in your organization:\n\nFor example, if you want to allow a user in your organization to be able to view\ninformation about a migration, but not be able to perform a migration, assign\nthem the role `roles/vmmigration.viewer`.\n\nWhat's next\n-----------\n\n- [Installing the Migrate Connector](/migrate/virtual-machines/docs/5.0/migrate/migrate-connector)"]]