Skip to content
This repository has been archived by the owner on Jul 16, 2024. It is now read-only.

Commit

Permalink
removed powering off server
Browse files Browse the repository at this point in the history
  • Loading branch information
Mia-Cross committed Aug 26, 2022
1 parent 23603c4 commit 2879793
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions etcd-manager/pkg/volumes/scaleway/volumes.go
Original file line number Diff line number Diff line change
Expand Up @@ -191,14 +191,14 @@ func (a *ScwVolumes) AttachVolume(volume *volumes.Volume) error {
return nil
}

err = a.instanceAPI.ServerActionAndWait(&instance.ServerActionAndWaitRequest{
ServerID: a.server.ID,
Zone: a.zone,
Action: instance.ServerActionPoweroff,
})
if err != nil {
return fmt.Errorf("failed to power-off server %s before attaching volume", a.server.ID)
}
//err = a.instanceAPI.ServerActionAndWait(&instance.ServerActionAndWaitRequest{
// ServerID: a.server.ID,
// Zone: a.zone,
// Action: instance.ServerActionPoweroff,
//})
//if err != nil {
// return fmt.Errorf("failed to power-off server %s before attaching volume", a.server.ID)
//}

klog.V(2).Infof("Attaching volume %s(%d) to the running server", scwVolume.Name, scwVolume.ID)
_, err = a.instanceAPI.AttachVolume(&instance.AttachVolumeRequest{
Expand All @@ -212,14 +212,14 @@ func (a *ScwVolumes) AttachVolume(volume *volumes.Volume) error {
//if vol.Server.State != instance.ServerStateRunning && vol.Server.State != instance.ServerStateStarting {
// return fmt.Errorf("found invalid status for volume %s(%d): %s", scwVolume.Name, scwVolume.ID, action.Status)
//}
_, err = a.instanceAPI.ServerAction(&instance.ServerActionRequest{
ServerID: a.server.ID,
Zone: a.zone,
Action: instance.ServerActionPoweron,
})
if err != nil {
return fmt.Errorf("failed to power server %s back on after attaching volume", a.server.ID)
}
//_, err = a.instanceAPI.ServerAction(&instance.ServerActionRequest{
// ServerID: a.server.ID,
// Zone: a.zone,
// Action: instance.ServerActionPoweron,
//})
//if err != nil {
// return fmt.Errorf("failed to power server %s back on after attaching volume", a.server.ID)
//}

time.Sleep(10 * time.Second)
}
Expand Down

0 comments on commit 2879793

Please sign in to comment.