Object Storage

How can I shutdown StorageGRID about remote server for UPS script

shinichiro_s
782 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
651 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

4 REPLIES 4

elementx
709 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
655 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
652 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
587 Views

Hi elementx-san,

Thank you for your reply.

OK I uderstood. 

 

Thank you for your coporated.

Public