dell / iDRAC-Redfish-Scripting

Python and PowerShell scripting for Dell EMC PowerEdge iDRAC REST API with DMTF Redfish
GNU General Public License v2.0
600 stars 278 forks source link

Is parallel configuration with several iDracs possible? #85

Closed lucien62 closed 4 years ago

lucien62 commented 4 years ago

I have a hundred of iDracs to configure (update bios, idrac) and I will need to deploy ESXi on these servers and I plan to do all of this with powershell scripts. I can see that the cmdlets here are what I need, however, to speed up the process, i'm looking for a way to do this in batches. I would like to update idrac or the bios on several servers at a time. But from what I see in the cmdlets, it's one server at a time. Is there a way to configure/update several iDracs at the same time with Powershell and the iDrac redfish cmdlets?

6str commented 4 years ago

you can fire off each command in the loop as a job, instead of waiting for one to finish before starting the next. There are quite a few ways to script that in powershell.

The problem with running stuff in parallel is it can easily get out of control, and it's a little trickier to collect and check the results.

Since the servers take forever to reboot, I can see running batches of parallel configs is necessary if you've got large numbers of servers hit.

I'd suggest batches of 10 - 20 at a time would let you get a reasonable throughput without causing a storm of activity on the host running the script and/or the platform infrastructure.

I also suggest, when writing your loop, you have a switch to turn asynchronous processing on and off to make it easy while you're still in very early stages and then, when you think you've nailed it, flip to hitting two or three test machines at a time.

On Fri, 22 Nov 2019 at 22:25, lucien62 notifications@github.com wrote:

I have hundreds of iDracs to configure (update bios, idrac) and I will need to deploy ESXi on these hundreds of server and I plan to do all of this with powershell scripts. I can see that the cmdlets here are what I need, however, to speed up the process, i'm looking for a way to do this in batches. I would like to update idrac or the bios on several servers at a time. But from what I see in the cmdlets, it's one server at a time. Is there a way to configure/update several iDracs at the same time with Powershell and the iDrac redfish cmdlets?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/dell/iDRAC-Redfish-Scripting/issues/85?email_source=notifications&email_token=ANO5ZC665MVBDPZYRKACGSLQVBL6RA5CNFSM4JQWWIFKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4H3QE7AA, or unsubscribe https://github.com/notifications/unsubscribe-auth/ANO5ZC3M4WRJZXY2KSIBD3TQVBL6RANCNFSM4JQWWIFA .

lucien62 commented 4 years ago

you can fire off each command in the loop as a job, instead of waiting for one to finish before starting the next. There are quite a few ways to script that in powershell. The problem with running stuff in parallel is it can easily get out of control, and it's a little trickier to collect and check the results. Since the servers take forever to reboot, I can see running batches of parallel configs is necessary if you've got large numbers of servers hit. I'd suggest batches of 10 - 20 at a time would let you get a reasonable throughput without causing a storm of activity on the host running the script and/or the platform infrastructure. I also suggest, when writing your loop, you have a switch to turn asynchronous processing on and off to make it easy while you're still in very early stages and then, when you think you've nailed it, flip to hitting two or three test machines at a time. On Fri, 22 Nov 2019 at 22:25, lucien62 @.***> wrote: I have hundreds of iDracs to configure (update bios, idrac) and I will need to deploy ESXi on these hundreds of server and I plan to do all of this with powershell scripts. I can see that the cmdlets here are what I need, however, to speed up the process, i'm looking for a way to do this in batches. I would like to update idrac or the bios on several servers at a time. But from what I see in the cmdlets, it's one server at a time. Is there a way to configure/update several iDracs at the same time with Powershell and the iDrac redfish cmdlets? — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub <#85?email_source=notifications&email_token=ANO5ZC665MVBDPZYRKACGSLQVBL6RA5CNFSM4JQWWIFKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4H3QE7AA>, or unsubscribe https://github.com/notifications/unsubscribe-auth/ANO5ZC3M4WRJZXY2KSIBD3TQVBL6RANCNFSM4JQWWIFA .

Thx 6str, I take good note. I'm going to learn as well how to use start-job cmdlet in a loop, that might also help me work with batches. https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/start-job?view=powershell-6

6str commented 4 years ago

by the way ...

the way I went about this was to decide on the classes of machines in terms of configuration they share. So far, I'm working on two different classes of machine in terms of hardware spec, and two more in terms of location/datacenter (and therefore config for items like dns and ntp servers etc.

I use two profile files to configure virtual disk set up classes. I have two more for location specific setup. These four SCP files cover 90 percent of my iDRAC configuration, and I apply the SCP files using powershell and powershell redfish modules.

For the other 10%, I'm using powershell and redfish modules for about 5 settings.

I'm quite happy doing them in sequence at the moment, as the networking and patching is never ready for me to have big enough batches for me to worry about do them in parallel. Maybe one day

I've created a custom iso to do the minimum kickstart esxi build, before picking up the rest of the automation with powershell and powercli. Quite a lot of work gone in to the last part, as there are so many settings to be done, and some of them not so straight forward.

I found redfish quite hard to get in to. Not much of a community and exmaples compared to powercli and powershell. I was quite shocked about how non-existent the Dell redfish community is. Just a handful of people, but it was worth persevering in the end.

Good luck

On Sat, 23 Nov 2019 at 10:58, lucien62 notifications@github.com wrote:

you can fire off each command in the loop as a job, instead of waiting for one to finish before starting the next. There are quite a few ways to script that in powershell. The problem with running stuff in parallel is it can easily get out of control, and it's a little trickier to collect and check the results. Since the servers take forever to reboot, I can see running batches of parallel configs is necessary if you've got large numbers of servers hit. I'd suggest batches of 10 - 20 at a time would let you get a reasonable throughput without causing a storm of activity on the host running the script and/or the platform infrastructure. I also suggest, when writing your loop, you have a switch to turn asynchronous processing on and off to make it easy while you're still in very early stages and then, when you think you've nailed it, flip to hitting two or three test machines at a time. … <#m-6657033324669261692> On Fri, 22 Nov 2019 at 22:25, lucien62 @.***> wrote: I have hundreds of iDracs to configure (update bios, idrac) and I will need to deploy ESXi on these hundreds of server and I plan to do all of this with powershell scripts. I can see that the cmdlets here are what I need, however, to speed up the process, i'm looking for a way to do this in batches. I would like to update idrac or the bios on several servers at a time. But from what I see in the cmdlets, it's one server at a time. Is there a way to configure/update several iDracs at the same time with Powershell and the iDrac redfish cmdlets? — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub <#85 https://github.com/dell/iDRAC-Redfish-Scripting/issues/85?email_source=notifications&email_token=ANO5ZC665MVBDPZYRKACGSLQVBL6RA5CNFSM4JQWWIFKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4H3QE7AA>, or unsubscribe https://github.com/notifications/unsubscribe-auth/ANO5ZC3M4WRJZXY2KSIBD3TQVBL6RANCNFSM4JQWWIFA .

Thx 6str, I take good note. I'm going to learn as well how to use start-job cmdlet in a loop, that might also help me work with batches.

https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/start-job?view=powershell-6

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/dell/iDRAC-Redfish-Scripting/issues/85?email_source=notifications&email_token=ANO5ZCZSQ2K76HKL2UCPJTDQVEEENA5CNFSM4JQWWIFKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEE7SWRQ#issuecomment-557787974, or unsubscribe https://github.com/notifications/unsubscribe-auth/ANO5ZC5LICH7WIRTP6H2BFDQVEEENANCNFSM4JQWWIFA .

texroemer commented 4 years ago

@6str

Thanks for replying and helping out!

I noticed in your last comment you are using SCP to apply configuration changes and then performing an OS install. FYI, coming in next iDRAC release 4.00 which should be posted next month, Dell added support to SCP feature to also perform OS installs. Now when you push an SCP file to perform configuration changes and once those changes are complete, the server will automatically perform OS installation. In the SCP file, you will now be able to pass in the OS name along with an optional kickstart file name for unattended installs.

Thanks Tex

6str commented 4 years ago

Sounds great. Looking forward to seeing that.

Thanks

On Mon, 25 Nov 2019, 15:17 texroemer, notifications@github.com wrote:

@6str https://github.com/6str

Thanks for replying and helping out!

I noticed in your last comment you are using SCP to apply configuration changes and then performing an OS install. FYI, coming in next iDRAC release 4.00 which should be posted next month, Dell added support to SCP feature to also perform OS installs. Now when you push an SCP file to perform configuration changes and once those changes are complete, the server will automatically perform OS installation. In the SCP file, you will now be able to pass in the OS name along with an optional kickstart file name for unattended installs.

Thanks Tex

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/dell/iDRAC-Redfish-Scripting/issues/85?email_source=notifications&email_token=ANO5ZC5XU65I7VYYVG4RWN3QVPT7ZA5CNFSM4JQWWIFKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEFCXQAI#issuecomment-558200833, or unsubscribe https://github.com/notifications/unsubscribe-auth/ANO5ZC6HUM5A25NLNKCETILQVPT7ZANCNFSM4JQWWIFA .

nildoadao commented 4 years ago

@6str @lucien62

About perform SCP import for multiple servers, I`ve develop a small Redfish client with GUI to perform these tasks, is pretty basic but can handle SCP export/import, you can watch the JOB progress as it goes.

I've already tested simultaneous import for +100 servers without problems.

if you have interest take a look at : https://github.com/nildoadao/ServerTools

texroemer commented 4 years ago

@nildoadao Great tool you created, thanks!