问题:初始化组件≤cloudbase-init1.1.2的机型A的机器做了自定义镜像买机型B的机器,新机器网络初始化异常
ERROR cloudbaseinit.init [-] plugin 'NetworkConfigPlugin' failed with error '<x_wmi: Unexpected COM Error (-2147352567, 'Exception occurred.', (0, 'SWbemObjectEx', 'Invalid parameter ', None, 0, -2147217400), None)>'
bug:https://github.com/cloudbase/cloudbase-init/issues/50
Unexpected COM Error -2147352567
公共镜像不涉及,只有自定义才有可能遇到
初始化组件≤cloudbase-init1.1.2的机型A的机器做了自定义镜像买机型B的机器,新机器网络初始化异常的bug如何规避
①临时规避,制作镜像前执行powershell删cvm网卡(需要机器能访问公网)
#ps1
reg delete "HKLM\SOFTWARE\Cloudbase Solutions\Cloudbase-Init" /f 2>$null
reg add "HKLM\SYSTEM\ControlSet001\Services\cloudbase-init" /v "Start" /d 2 /t REG_DWORD /f
reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\NetworkList\Profiles" /f 2>$null
reg delete "HKLM\SYSTEM\CurrentControlSet\Control\TimeZoneInformation" /v "RealTimeIsUniversal" /f 2>$null
reg add "HKLM\SYSTEM\CurrentControlSet\Control\Network\NewNetworkWindowOff" /f 2>&1 > $null
$client = new-object System.Net.WebClient
$client.DownloadFile('http://windows-1251783334.cos.ap-shanghai.myqcloud.com/wget64.exe',' c:\windows\wget.exe')
wget.exe http://windows-1251783334.cos.ap-shanghai.myqcloud.com/115.159.148.149/devcon.exe -O c:\windows\devcon.exe
ipconfig /release;devcon.exe /r remove "PCI\VEN_1AF4&DEV_1000&SUBSYS_00011AF4&REV_00"
②升级cloudbase-init到1.1.4(需要机器能访问公网)
#ps1
$client = new-object System.Net.WebClient
$client.DownloadFile('http://windows-1251783334.cos.ap-shanghai.myqcloud.com/wget64.exe',' c:\windows\wget.exe')
wget.exe http://windows-1251783334.cos.ap-shanghai.myqcloud.com/CLOUDBASE-INIT_INSTALL1.1.4.PS1 -O c:\cloudbase-init_install.ps1
powershell -file c:\cloudbase-init_install.ps1
sc.exe config cloudbase-init obj= LocalSystem
sc.exe config cloudbase-init depend= tcpip/dhcp/dnscache/Winmgmt
sc.exe failure cloudbase-init reset= 0 actions= restart/10000 2>&1 > $null
sc.exe qc cloudbase-init 8192
net user cloudbase-init /del 2>$null
#$client12 = new-object System.Net.WebClient
#cloudbase-init_1.1.2
#$client12.DownloadFile('http://windowsgz-1251783334.cos.ap-guangzhou.myqcloud.com/ziyan/Cloudbase-Init.zip','C:\Cloudbase-Init.zip')
#$client14 = new-object System.Net.WebClient
#cloudbase-init_1.1.4
$client14.DownloadFile('http://windows-1251783334.cos.ap-shanghai.myqcloud.com/Cloudbase-Init1.1.4.zip','C:\Cloudbase-Init.zip')
$7zPath = "$env:ProgramFiles\7-Zip\7z.exe"
if (-not (Test-Path -Path $7zPath)) {
$client7 = new-object System.Net.WebClient
$client7.DownloadFile('http://windows-1251783334.cos.ap-shanghai.myqcloud.com/7z2408-x64.msi','c:\7z2408-x64.msi')
msiexec.exe /i c:\7z2408-x64.msi /qn
Start-Sleep 30
del c:\7z2408-x64.msi 2>$null
}
& "$env:ProgramFiles\7-Zip\7z.exe" x -aoa C:\Cloudbase-Init.zip -o"C:\Program Files\Cloudbase Solutions\Cloudbase-Init\"
升级1.1.6参考这篇文档:https://cloud.tencent.com/developer/article/2473038
原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。
原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。