-
Notifications
You must be signed in to change notification settings - Fork 290
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adaption of scenario scripts for 1-node clusters #534
Comments
Okok. It's easy - you just skip smb nics creation. Everything else is same. |
I have the impression that we are talking about different things. I mean the array with the server names at the beginning of the different scenario scripts. As an example, let's take a look at the scenario.ps1 script of the AzSHCI deployment scenario: With $servers results in an array with 4 strings: $servers.GetType() $Servers Now for 1-node clusters you have to change line 7 to $Servers.GetType() Later on in the script if $Servers[0] is referenced (e.g. in line 190) only the first char of the server name is retrieved: $Servers[0] which of course leads to various runtime errors. The correction is very easy: Simply change line 10 to and everything works like it should independent of the value of $numberofnodes in line 7. I hope with that I have presented my request a little bit better. |
Ah, got it! With one server you can simply say $servers="AzSHCI1". I kept this array to make things simpler when you deal with 16 node clusters :) |
$servers="AzSHCI1" does not solve the problem. You have to write [array] $servers="AzSHCI1" - then it would work. |
Another way with hard coded server names would be to write |
Ah, you are ofc right. Okok, I'll fix it! I hope you enjoy this stuff. Check out 22H2 scenario (in dev) . It's lot of fun! |
@jaromirk friendly reminder, is this code change implemented yet? might get lost. |
As Microsoft now supports 1-node clusters for AZSHCI and WS2022, I experimented a bit with the cluster scenario scripts for 1-node environments. I got various errors about non-existent host names.
Reason: Most scenario scripts initially define a variable for the names of the cluster nodes and implicitly assume that this results in a PowerShell array (e.g. $servers = "...", "..."). This works if you assign more than one hostname. However, if only 1 hostname is specified, PowerShell only creates a string variable - i.e. no array. If later the script references a single element (e.g. $server[0]), the result is an invalid hostname.
The remedy is simple: The variable for the host names should be set explicitly as an array type (e.g. [array] $servers="...").
However, this would mean that most of the scenario scripts would have to be adjusted and re-released. I would therefore suggest that an appropriate note be included in the MSLab readme page and the adjustments made in the scenario scripts when they are released as such.
The text was updated successfully, but these errors were encountered: