Skip to content

Commit

Permalink
migrate-to-v2: migrate volumes from maa to bom (#2872)
Browse files Browse the repository at this point in the history
  • Loading branch information
alichay authored Oct 3, 2023
1 parent 79db232 commit e553bbf
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions internal/command/migrate_to_v2/volumes.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,18 @@ func (m *v2PlatformMigrator) migrateAppVolumes(ctx context.Context) error {
}
}

// maa is deprecated. see migrate_to_v2/machines.go:createMachines
region := vol.Region
if region == "maa" {
region = "bom"
}

newVol, err := m.flapsClient.CreateVolume(ctx, api.CreateVolumeRequest{
SourceVolumeID: &vol.ID,
MachinesOnly: api.Pointer(true),
Name: vol.Name,
ComputeRequirements: m.machineGuests[processGroup],
Region: region,
})
if err != nil && strings.HasSuffix(err.Error(), " is not a valid candidate") {
return fmt.Errorf("unfortunately the worker hosting your volume %s (%s) does not have capacity for another volume to support the migration; some other options: 1) try again later and there might be more space on the worker, 2) run a manual migration https://community.fly.io/t/manual-migration-to-apps-v2/11870, or 3) wait until we support volume migrations across workers (we're working on it!)", vol.ID, vol.Name)
Expand Down

0 comments on commit e553bbf

Please sign in to comment.