()
| 506 | } |
| 507 | |
| 508 | func (m *InstanceMigration) askDisk() error { |
| 509 | volMigrator, ok := newVolumeMigration(m.ctx, m.server, m.asker, m.flagRsyncArgs).(*VolumeMigration) |
| 510 | if !ok { |
| 511 | return errors.New("Migrator should be of type VolumeMigration") |
| 512 | } |
| 513 | |
| 514 | volMigrator.project = m.project |
| 515 | |
| 516 | err := volMigrator.gatherInfo() |
| 517 | if err != nil { |
| 518 | return err |
| 519 | } |
| 520 | |
| 521 | if m.migrationType == MigrationTypeContainer && volMigrator.migrationType == MigrationTypeVolumeBlock { |
| 522 | return errors.New("Block disk is not supported by the container") |
| 523 | } |
| 524 | |
| 525 | m.instanceArgs.Devices[volMigrator.customVolumeArgs.Name] = map[string]string{ |
| 526 | "type": "disk", |
| 527 | "pool": volMigrator.pool, |
| 528 | "source": volMigrator.customVolumeArgs.Name, |
| 529 | } |
| 530 | |
| 531 | if volMigrator.migrationType == MigrationTypeVolumeFilesystem { |
| 532 | mountPath, err := m.asker.AskString("Provide mount path for this disk: ", "", nil) |
| 533 | if err != nil { |
| 534 | return err |
| 535 | } |
| 536 | |
| 537 | m.instanceArgs.Devices[volMigrator.customVolumeArgs.Name]["path"] = mountPath |
| 538 | } |
| 539 | |
| 540 | m.volumes = append(m.volumes, volMigrator) |
| 541 | |
| 542 | return nil |
| 543 | } |
| 544 | |
| 545 | func (m *InstanceMigration) askUEFISupport() error { |
| 546 | if m.instanceArgs.Type == api.InstanceTypeVM { |
no test coverage detected