Skip to content

GCP.VMMigration reference

Source: packages/gcp/src/VMMigration/Group.ts

A VM Migration group that bundles migrating VMs so they can be managed together.

Groups have no labels field — Alchemy stamps ownership into the description so list / nuke can find them. groupId, location, and migrationTargetType are immutable. Display name and description update in place.

Generated name

const group = yield* GCP.VMMigration.Group("Workloads", {
displayName: "workloads",
description: "production vms",
});

Disk-target group

const group = yield* GCP.VMMigration.Group("Disks", {
groupId: "disk-workloads",
migrationTargetType: "MIGRATION_TARGET_TYPE_DISKS",
});

Group.lookup references a group Alchemy doesn’t manage (created in the console or by another stack). It is read during plan/deploy, never created, updated or deleted, and binds like a declared group.

const group = GCP.VMMigration.Group.lookup({ groupId: "my-group" });

Source: packages/gcp/src/VMMigration/ImageImport.ts

A VM Migration image import from a Cloud Storage file into a Compute Engine disk or machine image.

Image imports are immutable — every field is a replacement trigger. The resource has no labels field; Alchemy stamps ownership into the target details’ labels and description so list / nuke can find them.

Disk image

const target = yield* GCP.VMMigration.Target("Landing");
const image = yield* GCP.VMMigration.ImageImport("Disk", {
cloudStorageUri: "gs://bucket/disk.vmdk",
diskImageTargetDefaults: {
imageName: "imported-disk",
targetProject: target.name,
},
});

Machine image

const image = yield* GCP.VMMigration.ImageImport("Machine", {
cloudStorageUri: "gs://bucket/machine.ova",
machineImageTargetDefaults: {
machineImageName: "imported-machine",
targetProject: target.name,
},
});

ImageImport: Looking up an existing image import

Section titled “ImageImport: Looking up an existing image import”

ImageImport.lookup references an image import Alchemy doesn’t manage (created in the console or by another stack). It is read during plan/deploy, never created, updated or deleted, and binds like a declared image import.

const imageImport = GCP.VMMigration.ImageImport.lookup({
imageImportId: "my-image-import",
});

Source: packages/gcp/src/VMMigration/Source.ts

A VM Migration source environment (AWS, Azure, or VMware vCenter) that inventories VMs and disks for migration.

sourceId, location, encryption, and the source kind (aws / azure / vmware) plus immutable region/subscription fields are replacement triggers. Description, labels, and credential fields update in place.

AWS source

const source = yield* GCP.VMMigration.Source("Aws", {
aws: {
awsRegion: "us-east-1",
accessKeyCreds: {
accessKeyId: process.env.AWS_ACCESS_KEY_ID,
secretAccessKey: process.env.AWS_SECRET_ACCESS_KEY,
},
},
labels: { env: "test" },
});

VMware source

const source = yield* GCP.VMMigration.Source("Vcenter", {
vmware: {
vcenterIp: "10.0.0.4",
username: "admin",
password: process.env.VCENTER_PASSWORD,
thumbprint: process.env.VCENTER_THUMBPRINT,
},
});

Source.lookup references a source Alchemy doesn’t manage (created in the console or by another stack). It is read during plan/deploy, never created, updated or deleted, and binds like a declared source.

const source = GCP.VMMigration.Source.lookup({ sourceId: "my-source" });

Source: packages/gcp/src/VMMigration/SourcesDatacenterConnector.ts

A VM Migration datacenter connector registered against a VMware source. The on-prem OVA appliance uses the registration id to bind to this resource.

Connectors have no labels or description — Alchemy stamps ownership into version so list / nuke can find them. The API has no patch method; changing identity or registration replaces the connector.

SourcesDatacenterConnector: Creating a Datacenter Connector

Section titled “SourcesDatacenterConnector: Creating a Datacenter Connector”
const source = yield* GCP.VMMigration.Source("Vcenter", {
vmware: { vcenterIp: "10.0.0.4", username: "admin" },
});
const connector = yield* GCP.VMMigration.SourcesDatacenterConnector(
"Appliance",
{
source: source.name,
version: "1.0.0",
},
);

SourcesDatacenterConnector: Looking up an existing sources datacenter connector

Section titled “SourcesDatacenterConnector: Looking up an existing sources datacenter connector”

SourcesDatacenterConnector.lookup references a sources datacenter connector Alchemy doesn’t manage (created in the console or by another stack). It is read during plan/deploy, never created, updated or deleted, and binds like a declared sources datacenter connector.

const sourcesDatacenterConnector = GCP.VMMigration.SourcesDatacenterConnector.lookup({
datacenterConnectorId: "my-datacenter-connector",
source: "my-source",
});

Source: packages/gcp/src/VMMigration/SourcesDiskMigrationJob.ts

A VM Migration disk migration job that copies an unattached source disk into a Compute Engine persistent disk.

The job has no labels field — Alchemy stamps ownership into targetDetails.labels so list / nuke can find them. Source, job id, and AWS volume id are immutable. Target details update in place.

SourcesDiskMigrationJob: Creating a Disk Migration Job

Section titled “SourcesDiskMigrationJob: Creating a Disk Migration Job”
const job = yield* GCP.VMMigration.SourcesDiskMigrationJob("Boot", {
source: source.name,
awsSourceDiskDetails: { volumeId: "vol-123" },
targetDetails: {
targetProject: target.name,
targetDisk: {
zone: "projects/my-project/locations/us-central1-a",
diskType: "COMPUTE_ENGINE_DISK_TYPE_STANDARD",
diskId: "imported-boot",
},
},
});

SourcesDiskMigrationJob: Looking up an existing sources disk migration job

Section titled “SourcesDiskMigrationJob: Looking up an existing sources disk migration job”

SourcesDiskMigrationJob.lookup references a sources disk migration job Alchemy doesn’t manage (created in the console or by another stack). It is read during plan/deploy, never created, updated or deleted, and binds like a declared sources disk migration job.

const sourcesDiskMigrationJob = GCP.VMMigration.SourcesDiskMigrationJob.lookup({
diskMigrationJobId: "my-disk-migration-job",
source: "my-source",
});

Source: packages/gcp/src/VMMigration/SourcesMigratingVm.ts

A VM Migration migrating VM: a source VM plus the replication and target defaults used to clone or cut over into Compute Engine.

Source, migrating VM id, and sourceVmId are immutable. Display name, description, labels, policy, and target defaults update in place.

SourcesMigratingVm: Creating a Migrating VM

Section titled “SourcesMigratingVm: Creating a Migrating VM”
const vm = yield* GCP.VMMigration.SourcesMigratingVm("Web", {
source: source.name,
sourceVmId: "vm-123",
displayName: "web-1",
computeEngineTargetDefaults: {
vmName: "web-1",
machineType: "n2-standard-4",
zone: "us-central1-a",
targetProject: target.name,
},
});

SourcesMigratingVm: Looking up an existing sources migrating vm

Section titled “SourcesMigratingVm: Looking up an existing sources migrating vm”

SourcesMigratingVm.lookup references a sources migrating vm Alchemy doesn’t manage (created in the console or by another stack). It is read during plan/deploy, never created, updated or deleted, and binds like a declared sources migrating vm.

const sourcesMigratingVm = GCP.VMMigration.SourcesMigratingVm.lookup({
migratingVmId: "my-migrating-vm",
source: "my-source",
});

Source: packages/gcp/src/VMMigration/SourcesUtilizationReport.ts

A VM Migration utilization report for selected VMs in a source environment (CPU, memory, disk, network).

Reports have no labels field — Alchemy stamps ownership into the display name so list / nuke can find them. The API has no patch method; changing time frame, VMs, or display name replaces the report.

SourcesUtilizationReport: Creating a Utilization Report

Section titled “SourcesUtilizationReport: Creating a Utilization Report”
const report = yield* GCP.VMMigration.SourcesUtilizationReport("Week", {
source: source.name,
timeFrame: "WEEK",
vms: [{ vmId: "vm-123" }, { vmId: "vm-456" }],
});

SourcesUtilizationReport: Looking up an existing sources utilization report

Section titled “SourcesUtilizationReport: Looking up an existing sources utilization report”

SourcesUtilizationReport.lookup references a sources utilization report Alchemy doesn’t manage (created in the console or by another stack). It is read during plan/deploy, never created, updated or deleted, and binds like a declared sources utilization report.

const sourcesUtilizationReport = GCP.VMMigration.SourcesUtilizationReport.lookup({
utilizationReportId: "my-utilization-report",
source: "my-source",
});

Source: packages/gcp/src/VMMigration/Target.ts

A VM Migration target project: the Compute Engine project clones and cutovers land in.

Target projects are global. They have no labels field — Alchemy stamps ownership into the description so list / nuke can find them. The resource id is immutable; project and description update in place.

Point at the current project

const target = yield* GCP.VMMigration.Target("Default", {
description: "this project",
});

Explicit Compute Engine project

const target = yield* GCP.VMMigration.Target("Prod", {
project: "prod-compute",
description: "production landing zone",
});

Target.lookup references a target Alchemy doesn’t manage (created in the console or by another stack). It is read during plan/deploy, never created, updated or deleted, and binds like a declared target.

const target = GCP.VMMigration.Target.lookup({
targetProjectId: "my-target-project",
});