yunionio / cloudpods

A cloud-native open-source unified multi-cloud and hybrid-cloud platform. 开源、云原生的多云管理及混合云融合平台
https://www.cloudpods.org
Apache License 2.0
2.59k stars 534 forks source link

[BUG] all in one . 新建 vmware 虚拟机成功. 然后web控制台 执行关机,提示关机失败 #17444

Closed sun3book closed 11 months ago

sun3book commented 1 year ago

问题描述/What happened: all in one . 新建 vmware 虚拟机成功. 然后web控制台 执行关机,提示关机失败 查看日志报错信息如下: c5c996498dfa4897982ac10c4202118

再回到虚拟机实例,右击实例 执行 ‘实例状态’-- ’同步状态 ‘

执行完之后,web控制台操作关机,此时可以正常关机了

环境/Environment:

NAME="CentOS Linux" VERSION="7 (Core)" ID="centos" ID_LIKE="rhel fedora" VERSION_ID="7" PRETTY_NAME="CentOS Linux 7 (Core)" ANSI_COLOR="0;31" CPE_NAME="cpe:/o:centos:centos:7" HOME_URL="https://www.centos.org/" BUG_REPORT_URL="https://bugs.centos.org/"

CENTOS_MANTISBT_PROJECT="CentOS-7" CENTOS_MANTISBT_PROJECT_VERSION="7" REDHAT_SUPPORT_PRODUCT="centos" REDHAT_SUPPORT_PRODUCT_VERSION="7"

Linux zhcx-cloudpods01 5.4.130-1.yn20221208.el7.x86_64 #1 SMP Thu Dec 8 12:09:17 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

Get "https://default-yunionagent:30898/version": dial tcp: lookup default-yunionagent on 10.96.0.10:53: server misbehaving Get "https://default-apigateway:30443/version": dial tcp 10.101.110.65:30443: connect: connection refused +-----------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ Field Value +-----------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ ansible release/3.10(53a83b59ff23063007) apimap release/3.10(53a83b59ff23063007) cloudevent release/3.10(53a83b59ff23063007) cloudid release/3.10(53a83b59ff23063007)
cloudmon release/3.10(53a83b59ff23063007)
cloudproxy release/3.10(53a83b59ff23063007)
compute_v2 release/3.10(53a83b59ff23063007)
devtool release/3.10(53a83b59ff23063007)
etcd {"etcdserver":"3.4.6","etcdcluster":"3.4.0"}
identity release/3.10(53a83b59ff23063007)
image release/3.10(53a83b59ff23063007)
influxdb 404 page not found
k8s heads/v3.10.3-20230630.1(fb33530b23063006)
log release/3.10(53a83b59ff23063007)
monitor release/3.10(53a83b59ff23063007)
notify release/3.10(53a83b59ff23063007)
scheduledtask release/3.10(53a83b59ff23063007)
scheduler release/3.10(53a83b59ff23063007)
torrent-tracker Not Found
vpcagent release/3.10(53a83b59ff23063007)
webconsole release/3.10(53a83b59ff23063007)
yunionagent {"error":{"class":"DNSError","code":499,"details":"Get \"https://default-yunionagent:30898/version\": dial tcp: lookup default-yunionagent on 10.96.0.10:53: server misbehaving","request":{"headers":{"User-Agent":"yunioncloud-go/201708","X-Auth-Token":"*"},"method":"GET","url":"https://default-yunionagent:30898/version"}}}
yunionconf release/3.10(53a83b59ff23063007)
+-----------------+----------------------------------------------+ Field Value +-----------------+----------------------------------------------+ ansible release/3.10(53a83b59ff23063007) apimap release/3.10(53a83b59ff23063007) cloudevent release/3.10(53a83b59ff23063007) cloudid release/3.10(53a83b59ff23063007)
502 Bad Gateway

502 Bad Gateway


nginx/1.20.1
cloudmon release/3.10(53a83b59ff23063007)
cloudproxy release/3.10(53a83b59ff23063007)
compute_v2 release/3.10(53a83b59ff23063007)
devtool release/3.10(53a83b59ff23063007)
etcd {"etcdserver":"3.4.6","etcdcluster":"3.4.0"}
identity release/3.10(53a83b59ff23063007)
image release/3.10(53a83b59ff23063007)
influxdb 404 page not found
k8s heads/v3.10.3-20230630.1(fb33530b23063006)
log release/3.10(53a83b59ff23063007)
monitor release/3.10(53a83b59ff23063007)
notify release/3.10(53a83b59ff23063007)
scheduledtask release/3.10(53a83b59ff23063007)
scheduler release/3.10(53a83b59ff23063007)
torrent-tracker Not Found
vpcagent release/3.10(53a83b59ff23063007)
webconsole release/3.10(53a83b59ff23063007)
yunionconf release/3.10(53a83b59ff23063007)

+-----------------+----------------------------------------------+

ioito commented 1 year ago

@sun3book 虚拟机创建完成后会有一次回调,将vmware上的id和cloudpods的id映射起来 因此需要等待虚拟机状态成为运行中或者关机之后再进行操作

你是在虚拟机刚创建后就立即进行操作的么

sun3book commented 1 year ago

@sun3book 虚拟机创建完成后会有一次回调,将vmware上的id和cloudpods的id映射起来 因此需要等待虚拟机状态成为运行中或者关机之后再进行操作

你是在虚拟机刚创建后就立即进行操作的么

虚拟机创建完成了,并且web控制台状态 显示 "运行中",进vnc远程,虚拟机是正常运行的,可以进去系统里边。此时操作关机报错,提示关机失败。 要点一次 同步状态,再操作关机可以正常关掉。 这个回调会不会是失败的

sun3book commented 1 year ago

@sun3book 虚拟机创建完成后会有一次回调,将vmware上的id和cloudpods的id映射起来 因此需要等待虚拟机状态成为运行中或者关机之后再进行操作

你是在虚拟机刚创建后就立即进行操作的么

image

ioito commented 1 year ago

这种情况一般是因为虚拟机从宿主机A迁移到宿主机B导致的, vmware的虚拟机会在各个宿主机上漂移,可以观察下虚拟机所在的宿主机,然后开机之后,到vmware平台上看下虚拟机是否迁到其他宿主机上了

dengju2020 commented 1 year ago

@sun3book 我们优化下,在进行操作时,先同步状态再进行具体操作。

sun3book commented 1 year ago

这种情况一般是因为虚拟机从宿主机A迁移到宿主机B导致的, vmware的虚拟机会在各个宿主机上漂移,可以观察下虚拟机所在的宿主机,然后开机之后,到vmware平台上看下虚拟机是否迁到其他宿主机上了

image image

观察了没有漂移现象

ioito commented 1 year ago

https://github.com/yunionio/cloudpods/pull/17479/files 这个合并完成之后可以再次尝试,也可以根据代码自己打个镜像尝试