cloudpods
cloudpods copied to clipboard
[文档/Docs]VMware同步问题:VMware同步后缺少宿主机
What part of the document needs to be added: 文档位置: https://www.cloudpods.org/zh/docs/function_principle/multicloud/cloudaccounts/vmware/
需要补充为什么vmware宿主机没有同步下来的问题
1.打开region的日志 kubectl logs -n onecloud $(kubectl get pods -n onecloud |grep region |grep -v dns |awk '{print $1}') --tail 20 -f |grep error 2.VMware的云账号,点击全量同步 3.查看步骤1中是否有error信息
kubectl logs -n onecloud $(kubectl get pods -n onecloud |grep region |grep -v dns |awk '{print $1}') --tail 20 -f |grep error
[error 2023-08-09 08:49:18 models.SyncCloudaccountResources(cloudsync.go:2476)] Sync project for account zhcx-cloud-local error: GetIProjects: GetResourcePools: dc.scanResourcePool: listResourcePools: scanMObjects: v.Retrieve ResourcePool: ServerFaultCode: InvalidProperty
1.打开region的日志 kubectl logs -n onecloud $(kubectl get pods -n onecloud |grep region |grep -v dns |awk '{print $1}') --tail 20 -f |grep error 2.VMware的云账号,点击全量同步 3.查看步骤1中是否有error信息
kubectl logs -n onecloud $(kubectl get pods -n onecloud |grep region |grep -v dns |awk '{print $1}') --tail 20 -f |grep error [error 2023-08-09 08:49:18 models.SyncCloudaccountResources(cloudsync.go:2476)] Sync project for account zhcx-cloud-local error: GetIProjects: GetResourcePools: dc.scanResourcePool: listResourcePools: scanMObjects: v.Retrieve ResourcePool: ServerFaultCode: InvalidProperty [error 2023-08-09 08:50:46 models.(*SHost).getHostwireOfIdAndMac(hosts.go:1558)] getHostwireOfIdAndMac fail sql: no rows in result set [error 2023-08-09 08:50:46 models.(*SHost).getHostwireOfIdAndMac(hosts.go:1558)] getHostwireOfIdAndMac fail sql: no rows in result set [error 2023-08-09 08:50:46 models.(*SHost).getHostwireOfIdAndMac(hosts.go:1558)] getHostwireOfIdAndMac fail sql: no rows in result set [error 2023-08-09 08:50:46 models.(*SHost).getHostwireOfIdAndMac(hosts.go:1558)] getHostwireOfIdAndMac fail sql: no rows in result set [error 2023-08-09 08:50:46 models.(*SHost).getHostwireOfIdAndMac(hosts.go:1558)] getHostwireOfIdAndMac fail sql: no rows in result set [info 2023-08-09 08:50:46 models.syncHostNics(cloudsync.go:2369)] SyncHostWires for host 10-10-55-200 result: removed 0 failed 0 updated 0 failed 0 added 0 failed 1;{"error":{"class":"BadRequestError","code":400,"data":{"fields":["10.10.55.181"],"id":"IP %!!(MISSING)s(MISSING) not attach to any wire"},"details":"IP 10.10.55.181 not attach to any wire"}} [error 2023-08-09 08:50:46 models.(*SGuest).SyncVMNics(guests.go:3570)] SyncVMNics getCloudNicNetwork add fail: IP 10.10.55.58 not reachable on this host [error 2023-08-09 08:50:46 models.syncVMPeripherals(cloudsync.go:1003)] syncVMNics error IP 10.10.55.58 not reachable on this host [error 2023-08-09 08:50:46 models.syncVMPeripherals(cloudsync.go:1018)] syncVMSecgroups error remoteVM.GetSecurityGroupIds: NotSupportedError [error 2023-08-09 08:50:47 models.(*SGuest).SyncVMNics(guests.go:3570)] SyncVMNics getCloudNicNetwork add fail: IP 10.10.55.41 not reachable on this host [error 2023-08-09 08:50:47 models.syncVMPeripherals(cloudsync.go:1003)] syncVMNics error IP 10.10.55.41 not reachable on this host [error 2023-08-09 08:50:47 models.syncVMPeripherals(cloudsync.go:1018)] syncVMSecgroups error remoteVM.GetSecurityGroupIds: NotSupportedError [error 2023-08-09 08:50:48 models.(*SGuest).SyncVMNics(guests.go:3570)] SyncVMNics getCloudNicNetwork add fail: IP 10.10.55.42 not reachable on this host [error 2023-08-09 08:50:48 models.syncVMPeripherals(cloudsync.go:1003)] syncVMNics error IP 10.10.55.42 not reachable on this host [error 2023-08-09 08:50:48 models.syncVMPeripherals(cloudsync.go:1018)] syncVMSecgroups error remoteVM.GetSecurityGroupIds: NotSupportedError [error 2023-08-09 08:50:48 models.syncVMPeripherals(cloudsync.go:1018)] syncVMSecgroups error remoteVM.GetSecurityGroupIds: NotSupportedError [error 2023-08-09 08:50:49 models.(*SGuest).SyncVMNics(guests.go:3570)] SyncVMNics getCloudNicNetwork add fail: IP 10.10.55.22 not reachable on this host [error 2023-08-09 08:50:49 models.syncVMPeripherals(cloudsync.go:1003)] syncVMNics error IP 10.10.55.22 not reachable on this host [error 2023-08-09 08:50:49 models.syncVMPeripherals(cloudsync.go:1018)] syncVMSecgroups error remoteVM.GetSecurityGroupIds: NotSupportedError [error 2023-08-09 08:50:50 models.(*SGuest).SyncVMNics(guests.go:3570)] SyncVMNics getCloudNicNetwork add fail: IP 10.10.55.121 not reachable on this host [error 2023-08-09 08:50:50 models.syncVMPeripherals(cloudsync.go:1003)] syncVMNics error IP 10.10.55.121 not reachable on this host [error 2023-08-09 08:50:50 models.syncVMPeripherals(cloudsync.go:1018)] syncVMSecgroups error remoteVM.GetSecurityGroupIds: NotSupportedError [error 2023-08-09 08:50:50 models.(*SGuest).SyncVMNics(guests.go:3570)] SyncVMNics getCloudNicNetwork add fail: Cannot find inetwork for vnics 00:0c:29:d7:11:76: no ip [error 2023-08-09 08:50:50 models.syncVMPeripherals(cloudsync.go:1003)] syncVMNics error Cannot find inetwork for vnics 00:0c:29:d7:11:76: no ip [error 2023-08-09 08:50:50 models.syncVMPeripherals(cloudsync.go:1018)] syncVMSecgroups error remoteVM.GetSecurityGroupIds: NotSupportedError [error 2023-08-09 08:50:51 models.(*SGuest).SyncVMNics(guests.go:3570)] SyncVMNics getCloudNicNetwork add fail: IP 10.10.55.114 not reachable on this host [error 2023-08-09 08:50:51 models.syncVMPeripherals(cloudsync.go:1003)] syncVMNics error IP 10.10.55.114 not reachable on this host [error 2023-08-09 08:50:51 models.syncVMPeripherals(cloudsync.go:1018)] syncVMSecgroups error remoteVM.GetSecurityGroupIds: NotSupportedError [error 2023-08-09 08:50:52 models.(*SGuest).SyncVMNics(guests.go:3570)] SyncVMNics getCloudNicNetwork add fail: IP 10.10.55.122 not reachable on this host [error 2023-08-09 08:50:52 models.syncVMPeripherals(cloudsync.go:1003)] syncVMNics error IP 10.10.55.122 not reachable on this host [error 2023-08-09 08:50:52 models.syncVMPeripherals(cloudsync.go:1018)] syncVMSecgroups error remoteVM.GetSecurityGroupIds: NotSupportedError [error 2023-08-09 08:50:52 models.(*SGuest).SyncVMNics(guests.go:3570)] SyncVMNics getCloudNicNetwork add fail: IP 10.10.55.120 not reachable on this host [error 2023-08-09 08:50:52 models.syncVMPeripherals(cloudsync.go:1003)] syncVMNics error IP 10.10.55.120 not reachable on this host [error 2023-08-09 08:50:52 models.syncVMPeripherals(cloudsync.go:1018)] syncVMSecgroups error remoteVM.GetSecurityGroupIds: NotSupportedError [error 2023-08-09 08:50:53 models.(*SGuest).SyncVMNics(guests.go:3570)] SyncVMNics getCloudNicNetwork add fail: IP 10.10.55.110 not reachable on this host [error 2023-08-09 08:50:53 models.syncVMPeripherals(cloudsync.go:1003)] syncVMNics error IP 10.10.55.110 not reachable on this host [error 2023-08-09 08:50:53 models.syncVMPeripherals(cloudsync.go:1018)] syncVMSecgroups error remoteVM.GetSecurityGroupIds: NotSupportedError [error 2023-08-09 08:50:54 models.(*SGuest).SyncVMNics(guests.go:3570)] SyncVMNics getCloudNicNetwork add fail: IP 10.10.55.21 not reachable on this host [error 2023-08-09 08:50:54 models.syncVMPeripherals(cloudsync.go:1003)] syncVMNics error IP 10.10.55.21 not reachable on this host [error 2023-08-09 08:50:54 models.syncVMPeripherals(cloudsync.go:1018)] syncVMSecgroups error remoteVM.GetSecurityGroupIds: NotSupportedError [error 2023-08-09 08:50:54 models.(*SGuest).SyncVMNics(guests.go:3570)] SyncVMNics getCloudNicNetwork add fail: IP 10.10.55.123 not reachable on this host [error 2023-08-09 08:50:54 models.syncVMPeripherals(cloudsync.go:1003)] syncVMNics error IP 10.10.55.123 not reachable on this host [error 2023-08-09 08:50:54 models.syncVMPeripherals(cloudsync.go:1018)] syncVMSecgroups error remoteVM.GetSecurityGroupIds: NotSupportedError [error 2023-08-09 08:50:55 models.(*SGuest).SyncVMNics(guests.go:3570)] SyncVMNics getCloudNicNetwork add fail: Cannot find inetwork for vnics 00:0c:29:18:80:3a: no ip [error 2023-08-09 08:50:55 models.syncVMPeripherals(cloudsync.go:1003)] syncVMNics error Cannot find inetwork for vnics 00:0c:29:18:80:3a: no ip [error 2023-08-09 08:50:55 models.syncVMPeripherals(cloudsync.go:1018)] syncVMSecgroups error remoteVM.GetSecurityGroupIds: NotSupportedError [error 2023-08-09 08:50:56 models.(*SGuest).SyncVMNics(guests.go:3570)] SyncVMNics getCloudNicNetwork add fail: IP 10.10.55.111 not reachable on this host [error 2023-08-09 08:50:56 models.syncVMPeripherals(cloudsync.go:1003)] syncVMNics error IP 10.10.55.111 not reachable on this host [error 2023-08-09 08:50:56 models.syncVMPeripherals(cloudsync.go:1018)] syncVMSecgroups error remoteVM.GetSecurityGroupIds: NotSupportedError [error 2023-08-09 08:50:56 models.(*SGuest).SyncVMNics(guests.go:3570)] SyncVMNics getCloudNicNetwork add fail: IP 10.10.55.13 not reachable on this host [error 2023-08-09 08:50:56 models.syncVMPeripherals(cloudsync.go:1003)] syncVMNics error IP 10.10.55.13 not reachable on this host [error 2023-08-09 08:50:56 models.syncVMPeripherals(cloudsync.go:1018)] syncVMSecgroups error remoteVM.GetSecurityGroupIds: NotSupportedError [error 2023-08-09 08:50:57 models.(*SGuest).SyncVMNics(guests.go:3570)] SyncVMNics getCloudNicNetwork add fail: IP 10.10.55.124 not reachable on this host [error 2023-08-09 08:50:57 models.syncVMPeripherals(cloudsync.go:1003)] syncVMNics error IP 10.10.55.124 not reachable on this host [error 2023-08-09 08:50:57 models.syncVMPeripherals(cloudsync.go:1018)] syncVMSecgroups error remoteVM.GetSecurityGroupIds: NotSupportedError [error 2023-08-09 08:50:58 models.(*SGuest).SyncVMNics(guests.go:3570)] SyncVMNics getCloudNicNetwork add fail: IP 10.10.55.15 not reachable on this host [error 2023-08-09 08:50:58 models.syncVMPeripherals(cloudsync.go:1003)] syncVMNics error IP 10.10.55.15 not reachable on this host [error 2023-08-09 08:50:58 models.syncVMPeripherals(cloudsync.go:1018)] syncVMSecgroups error remoteVM.GetSecurityGroupIds: NotSupportedError [error 2023-08-09 08:50:58 models.(*SGuest).SyncVMNics(guests.go:3570)] SyncVMNics getCloudNicNetwork add fail: IP 10.10.55.112 not reachable on this host [error 2023-08-09 08:50:58 models.syncVMPeripherals(cloudsync.go:1003)] syncVMNics error IP 10.10.55.112 not reachable on this host [error 2023-08-09 08:50:58 models.syncVMPeripherals(cloudsync.go:1018)] syncVMSecgroups error remoteVM.GetSecurityGroupIds: NotSupportedError [error 2023-08-09 08:50:59 models.(*SGuest).SyncVMNics(guests.go:3570)] SyncVMNics getCloudNicNetwork add fail: Cannot find inetwork for vnics 00:0c:29:5f:34:76: no ip [error 2023-08-09 08:50:59 models.syncVMPeripherals(cloudsync.go:1003)] syncVMNics error Cannot find inetwork for vnics 00:0c:29:5f:34:76: no ip [error 2023-08-09 08:50:59 models.syncVMPeripherals(cloudsync.go:1018)] syncVMSecgroups error remoteVM.GetSecurityGroupIds: NotSupportedError [error 2023-08-09 08:51:00 models.(*SGuest).SyncVMNics(guests.go:3570)] SyncVMNics getCloudNicNetwork add fail: IP 10.10.55.113 not reachable on this host [error 2023-08-09 08:51:00 models.syncVMPeripherals(cloudsync.go:1003)] syncVMNics error IP 10.10.55.113 not reachable on this host [error 2023-08-09 08:51:00 models.syncVMPeripherals(cloudsync.go:1018)] syncVMSecgroups error remoteVM.GetSecurityGroupIds: NotSupportedError
其它是一些虚拟机不通的日志,都是window虚拟机开了防火墙,ping不通
@sun3book vmware宿主机同步日志代码如下,可以根据关键是查下日志 https://github.com/yunionio/cloudpods/blob/f2a50c97e656e1f387d38acb7e7430d351d2986b/pkg/compute/models/cloudsync.go#L2299-L2301
SyncHosts for provider
过滤搜索,找到 日志了:
[info 2023-08-09 09:55:19 models.syncOnPremiseCloudProviderInfo(cloudsync.go:2301)] SyncHosts for provider zhcx-cloud-local result: removed 0 failed 0 updated 15 failed 0 added 0 failed 3;GetOnPremiseWireOfIp for host 10-158-158-231 with ip 10.158.158.231: sql: no rows in result set;GetOnPremiseWireOfIp for host 10-158-158-240 with ip 10.158.158.240: sql: no rows in result set;GetOnPremiseWireOfIp for host 10-158-158-248 with ip 10.158.158.248: sql: no rows in result set
SyncHosts for provider
过滤搜索,找到 日志了:
[info 2023-08-09 09:55:19 models.syncOnPremiseCloudProviderInfo(cloudsync.go:2301)] SyncHosts for provider zhcx-cloud-local result: removed 0 failed 0 updated 15 failed 0 added 0 failed 3;GetOnPremiseWireOfIp for host 10-158-158-231 with ip 10.158.158.231: sql: no rows in result set;GetOnPremiseWireOfIp for host 10-158-158-240 with ip 10.158.158.240: sql: no rows in result set;GetOnPremiseWireOfIp for host 10-158-158-248 with ip 10.158.158.248: sql: no rows in result set 就是缺少这3台机器
@sun3book 看下平台中 有包含10.158.158.231/240/248的 ip子网没?
@sun3book 看下平台中 有包含10.158.158.231/240/248的 ip子网没?
没看见有呢,其它的机器会自动创建,这3台没创建;
@sun3book 看下平台中 有包含10.158.158.231/240/248的 ip子网没?
没看见有呢,其它的机器会自动创建,这3台没创建;
![]()
![]()
@sun3book 我们看下,你可以先手工新建相关的IP子网,然后全量同步下云账号