如何使用PowerShell在Windows Server中设置网络意图VLAN?

huangapple go评论76阅读模式
英文:

How to set network intent VLAN in Windows Server using PowerShell?

问题

在使用Windows Admin Center(按照此指南的Network ATC选项)创建Azure Stack HCI集群时,我在节点上失去了连接(即它们只能通过控制台访问)。

经过一些故障排除,我意识到在*群集阶段的3.2部署主机网络设置*步骤期间,Windows Admin Center重新配置了网络接口,但没有保留任何现有的VLAN设置。

在我的情况下,在开始使用Windows Admin Center创建集群之前,网卡已经被设置为使用特定的VLAN ID。在此过程中,我没有注意到向导从未要求输入VLAN ID(甚至在设置管理和计算意图时也没有),所以我继续进行而没有过多考虑。当Windows Admin Center创建网络意图时,它重新配置了网卡而没有设置特定的VLAN ID(完全忽略了之前设置的那个),导致节点无法访问。

Azure Stack HCI操作系统基于Windows Server 2022 Core,所以它没有图形用户界面。我一直在尝试找出至少在管理意图中设置VLAN ID的PowerShell命令,但我只找到了这个指南,它只指定了如何使用给定的VLAN ID创建新意图(而不是将其设置到现有的意图中):https://learn.microsoft.com/en-us/azure-stack/hci/manage/manage-network-atc。此外,与该文章中使用的Set-NetIntentGet-NetIntent命令相关的文档页面也没有。

所以,有没有办法将VLAN ID设置到现有的网络意图中,还是我必须删除意图,并按照上述指南再次创建它(包括VLAN)?另外,假设存在这样的命令,Windows Admin Center是否在创建集群期间有选项来设置VLAN ID,还是使用PowerShell是唯一的方法?

英文:

I was creating an Azure Stack HCI cluster using the Windows Admin Center (following this guide with the Network ATC option) when I lost connectivity to the nodes (i.e. they were only reachable through the console).

After some troubleshooting, I realized that during the 3.2 Deploy host networking settings step of the Clustering phase, the Windows Admin Center reconfigured the network interfaces with the specified intents, but without keeping any existing VLAN settings.

In my case, the NICs had been set to use a certain VLAN ID before starting the cluster creation in Windows Admin Center. I did not notice that during this process the wizard never asked for a VLAN ID (not even when setting the management and compute intents), so I proceeded without giving it too much thought. When the Windows Admin Center created the network intents, it reconfigured the NICs without setting a particular VLAN ID (completely ignoring the one that had been previously set), leaving the nodes unreachable.

The Azure Stack HCI OS is based on Windows Server 2022 Core, so it does not have a GUI. I have been trying to figure out what is the PowerShell command to set the VLAN ID at least to the management intent, but all I could find was this guide which only specifies how to create a new intent with a given VLAN ID (instead of setting it to an existing intent): https://learn.microsoft.com/en-us/azure-stack/hci/manage/manage-network-atc. Also, there are no documentation pages related to the Set-NetIntent or Get-NetIntent commands used in that article.

So is there a way to set a VLAN ID to an existing network intent, or do I have to delete the intent and create it again with the VLAN (as per the guide above)? Also, assuming that such a command exists, does the Windows Admin Center have an option to set the VLAN ID during the cluster creation or is using PowerShell the only way to do it?

答案1

得分: 0

我成功地自己找出了这个命令,经过研究我链接的Network ATC文章中的参数:

Set-NetIntent -Name Management -ManagementVLAN <VLAN_ID>

此外,我还回顾了使用Windows Admin Center创建群集的过程,确实,在使用Network ATC选项时,它从不要求管理和计算意图的VLAN ID。截止到今天,似乎唯一的方法是使用PowerShell。

英文:

I managed to figure out the command by myself after studying the parameters in the Network ATC article I linked:

Set-NetIntent -Name Management -ManagementVLAN &lt;VLAN_ID&gt;

Also, I reviewed the cluster creation process using Windows Admin Center and indeed, when using the Network ATC option it never asks for a VLAN ID for the management and compute intents. Apparently the only way to do it - as of today - is using PowerShell.

huangapple
  • 本文由 发表于 2023年3月7日 19:43:53
  • 转载请务必保留本文链接:https://go.coder-hub.com/75661552.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定