This commit is contained in:
2026-04-03 16:26:42 +03:00
parent 9258a1574b
commit 30e464e4d2
22 changed files with 251 additions and 100 deletions

View File

@@ -26,17 +26,17 @@ func NewMigrator(cfg *Config, c decortsdk.ClientInterface) Migrator {
}
}
func (m *migrator) Migrate(ctxOrigin context.Context, dxVMID, stackID uint64) (bool, error) {
func (m *migrator) Migrate(ctxOrigin context.Context, dxVMID, nodeID uint64) (bool, error) {
req := compute.MigrateRequest{
ComputeID: dxVMID,
TargetStackID: stackID,
Force: false,
ComputeID: dxVMID,
TargetNodeID: nodeID,
Force: false,
}
ctx, cancel := context.WithTimeout(ctxOrigin, m.cfg.QueryTimeout)
ok, err := m.client.CloudBroker().Compute().Migrate(ctx, req)
cancel()
if err != nil {
return false, errors.Join(err, fmt.Errorf("Migrate VM %d to Node %d", dxVMID, stackID))
return false, errors.Join(err, fmt.Errorf("Migrate VM %d to Node %d", dxVMID, nodeID))
}
return ok, nil
}