Object Storage

How can I shutdown StorageGRID about remote server for UPS script

shinichiro_s
1,820 Views

Hi,All

 

I would like to stop StorageGRID from the UPS using a script.

Is this possible?

Are there sample scripts for both Linux and Windows servers?

 

Regards,

1 ACCEPTED SOLUTION
elementx has accepted the solution

elementx
1,689 Views

Most scripting languages can script interactive sessions including SSH, but how to do it exactly depends on what you use (PowerShell, Bash, etc.). It's generic, so whatever examples you can find on the internet will work with Linux SSH on SG.

 

Security of storing passwords or other credentials is a separate concern so you'd have to pay some extra attention to that.

 

If you're at NetApp you can create a Resource Request to a solution architect who can spend some time to investigate possible approaches. Or, if you're not, you can ask your NetApp account team to raise one for you.

View solution in original post

6 REPLIES 6

elementx
1,747 Views

By scripting the same commands that are used in manual service shutdown.

 

https://docs.netapp.com/us-en/storagegrid-118/maintain/powering-off-and-on-all-nodes-in-grid.html#stop-services-and-shut-down-grid-nodes

 

https://docs.netapp.com/us-en/storagegrid-118/maintain/stopping-server-manager-and-all-services.html

 

It's also possible to prevent auto startup, but one has to remember to re-enable this if auto-start is expected after that. As the docs say, it's not recommended to do this, probably because people think they "got it", disable auto-start and then complain how services are down...

https://docs.netapp.com/us-en/storagegrid-118/maintain/using-donotstart-file.html

 

After services have been stopped, power can be disconnected by UPS. Shutdown may take longer than UPS can sustain power, so that's another thing to consider (shutdown status should be confirmed before power is disconnected for clean shutdown, although I don't expect that premature shutdown would affect data integrity, especially if load balancers are shut down first). The docs have a force-shutdown procedure as well, if you want to use that.

shinichiro_s
1,693 Views

Hi elementx-san,

 

Thank you for the information.

Regarding the command, I understand that it can be stopped with [service servermanager stop].

 

However, to execute this command, you need to log in as root.

I was thinking of generating an ssh public authentication key and placing it on the StorageGRID SG100 and SG5718.

 

(I could create StorageGRID 11.7 Early Adapter lab on NetApp LOD.)

 

I added RootLoginPermit yes to /etc/ssh/sshd_config and rebooted,

but the added line disappeared and I was unable to log in as root. As an alternative,

I would like to be able to pass the password in Passwords.txt by using su - root after logging in as admin.

Is this possible?

 

Also, I don't know how to write a shell script from Linux to pass it successfully. Do you have a sample script with instructions on how to write it? (This may be more of a general question about scripts than about NetApp, but do you know if it's possible?)

 

Regards,

elementx has accepted the solution

elementx
1,690 Views

Most scripting languages can script interactive sessions including SSH, but how to do it exactly depends on what you use (PowerShell, Bash, etc.). It's generic, so whatever examples you can find on the internet will work with Linux SSH on SG.

 

Security of storing passwords or other credentials is a separate concern so you'd have to pay some extra attention to that.

 

If you're at NetApp you can create a Resource Request to a solution architect who can spend some time to investigate possible approaches. Or, if you're not, you can ask your NetApp account team to raise one for you.

shinichiro_s
1,625 Views

Hi elementx-san,

Thank you for your reply.

OK I uderstood. 

 

Thank you for your coporated.

Using the verification equipment, I was able to execute commands from Linux and successfully stop the service and execute a shutdown command remotely.

The storage node started up automatically when power was restored, so it worked as expected.

However, with regards to the two SG100s, one started up automatically when the power cable was connected, but the other did not.

Which is the correct behavior? Also, is there a setting to make it start up automatically? (Is there a setting that can be made from the BIOS or management GUI?)

I think that's a BIOS setting related to power status, where there may be something that says to resume previous/last state after power restore. So if the server was ON and power cut, once power comes back it'd power ON. If it was OFF, it'd remain OFF.

 

I'm not sure if that's what's causing different behavior because the servers shouldn't have these settings inconsistent. But maybe they came from different batches or have different BIOS versions, or someone changed them.

I'd first check one server's BIOS settings, then after it comes up, check the other and see if they have different settings.

Public