This commit is contained in:
2026-04-03 16:41:45 +03:00
parent 8abb20dcde
commit 0812c5a8af
21 changed files with 251 additions and 99 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
}