[Windows] Fix agent initialization error by adjusting VMSwitch commands#3169
Conversation
Codecov Report
@@ Coverage Diff @@
## main #3169 +/- ##
==========================================
- Coverage 58.36% 51.56% -6.80%
==========================================
Files 295 297 +2
Lines 24907 25434 +527
==========================================
- Hits 14536 13116 -1420
- Misses 8792 10836 +2044
+ Partials 1579 1482 -97
Flags with carried forward coverage won't be shown. Click here to find out more.
|
wenyingd
left a comment
There was a problem hiding this comment.
Code looks good to me, and please add more comments in the commitments to explain the issue.
Updated. |
Set/Get-VMSwitch could return hostname resolution error in some environments. The root cause is the remote DNS name didn’t match hostname, then Set/Get-VMSwitch could return error once it needed to get hostname from DNS name. This issue can be fixed by adding hostname to configuration. e.g. Get-VMSwitch -ComputerName $(hostname) -Name %s Signed-off-by: Shuyang Xin <gavinx@vmware.com>
|
/test-e2e |
| var maxRetry = 3 | ||
| var i = 0 | ||
| cmd := fmt.Sprintf("Get-VMSwitch -Name %s | Set-VMSwitch -AllowManagementOS $false ", networkName) | ||
| cmd := fmt.Sprintf("Get-VMSwitch -ComputerName $(hostname) -Name %s | Set-VMSwitch -ComputerName $(hostname) -AllowManagementOS $false ", networkName) |
There was a problem hiding this comment.
Sorry, could you explain more about the issue? Doesn't ComputerName already default to local computer?
-ComputerName
Specifies one or more Hyper-V hosts on which the virtual switch is to be configured. NetBIOS names, IP addresses, and fully qualified domain names are allowable. The default is the local computer. Use localhost or a dot (.) to specify the local computer explicitly.
There was a problem hiding this comment.
This command could fail in TKG cluster environment, and we found the different DNS name can cause this problem. Since we don't know much about Hyper-V‘s implementation,we guess it has a cache-like design to get hostname from DNS name periodically if the default name is invalid. On the contrary, using command with hostname never failed in our experiment. @tnqn
|
/test-windows-all |
|
/test-windows-all |
|
/test-windows-networkpolicy |
2 similar comments
|
/test-windows-networkpolicy |
|
/test-windows-networkpolicy |
|
/skip-e2e as Linux is not affected |
|
@XinShuYang if the issue could happen in release-1.2~1.4, could you backport it, following https://github.com/antrea-io/antrea/blob/main/docs/contributors/cherry-picks.md? |
|
Sure. |
…ds (antrea-io#3169) Set/Get-VMSwitch could return hostname resolution error in some environments. The root cause is the remote DNS name didn’t match hostname, then Set/Get-VMSwitch could return error once it needed to get hostname from DNS name. This issue can be fixed by adding hostname to configuration. e.g. Get-VMSwitch -ComputerName $(hostname) -Name %s Signed-off-by: Shuyang Xin <gavinx@vmware.com>
CI testbed building could still failed randomly with unmodified commands. This issue can be fixed by adding hostname to configuration. e.g. Get-VMSwitch -ComputerName $(hostname) -Name %s Refer to antrea-io#3169 Signed-off-by: Shuyang Xin <gavinx@vmware.com>
CI testbed building still failed randomly with unmodified commands. This issue can be fixed by adding hostname to configuration. e.g. Get-VMSwitch -ComputerName $(hostname) -Name %s Refer to antrea-io#3169 Signed-off-by: Shuyang Xin <gavinx@vmware.com>
CI testbed building still failed randomly with unmodified commands. This issue can be fixed by adding hostname to configuration. e.g. Get-VMSwitch -ComputerName $(hostname) -Name %s Refer to #3169 Signed-off-by: Shuyang Xin <gavinx@vmware.com>
CI testbed building still failed randomly with unmodified commands. This issue can be fixed by adding hostname to configuration. e.g. Get-VMSwitch -ComputerName $(hostname) -Name %s Refer to antrea-io#3169 Signed-off-by: Shuyang Xin <gavinx@vmware.com>
Set/Get-VMSwitch could return hostname resolution error in some environments.
The root cause is the remote DNS name didn’t match hostname, then Set/Get-VMSwitch
could return error once it needed to get hostname from DNS name.
This issue can be fixed by adding hostname to configuration.
e.g. Get-VMSwitch -ComputerName $(hostname) -Name %s
Signed-off-by: Shuyang Xin gavinx@vmware.com