apache / apache/cloudstack

Failed to Move VM to Another Account

未关闭
#13,406 9 条评论 0 个 reaction 已指派 0 人 已被 @DaanHoogland 认领 在 GitHub 查看
status:needs-functional-definition
主要语言
Java
星标
3.1k
派生
1.4k
平均合并
6 天 19 小时
30 天内合并 PR
32

描述

### problem

Up on stopping an Instance and trying to move it to another account...

Image

...it does not make clear what caused the failure.

Image

Even as a Root Admin, there is no explanation of what prevented the move from happening.

By looking at the logs, the message is clear but it is followed by an unhandled exception.

Sanitized fragments of the logs:

Image

```
2026-06-11 20:07:53,953 ERROR [o.a.c.a.c.a.v.AssignVMCmd] (qtp1404565079-58786:[ctx-e08ee8a2, ctx-7b35ebda]) (logid:46523a5c) Failed to move VM [4944]. com.cloud.exception.InvalidParameterValueException: Snapshots exist for volume [ROOT-4944]. Detach volume or remove snapshots for the volume before assigning VM to another user.
at com.cloud.vm.UserVmManagerImpl.validateIfVolumesHaveNoSnapshots(UserVmManagerImpl.java:7961)
at com.cloud.vm.UserVmManagerImpl.moveVmToUser(UserVmManagerImpl.java:7871)
```

Image

```
2026-06-11 19:58:58,841 ERROR [o.a.c.a.c.a.v.AssignVMCmd] (qtp1404565079-58786:[ctx-b7b9a764, ctx-86b9f79a]) (logid:1096b7f6) Failed to move VM [4944]. com.cloud.exception.InvalidParameterValueException: Remove any Port Forwarding rules for VM [VM instance {"id":4944,"instanceName":"i-73-4944-VM","state":"Stopped","type":"User","uuid":"*"}] before assigning it to another user.
at com.cloud.vm.UserVmManagerImpl.validateIfVmHasNoRules(UserVmManagerImpl.java:7934)
at com.cloud.vm.UserVmManagerImpl.moveVmToUser(UserVmManagerImpl.java:7868)
```

### versions

ACS 4.22.0.1

### The steps to reproduce the bug

1.
2.
3.
...

### What to do about it?

_No response_

贡献指南

打开贡献指南

调研方向

从 AssignVMCmd 和 UserVmManagerImpl 开始,重点查看 validateIfVolumesHaveNoSnapshots、validateIfVmHasNoRules 和 moveVmToUser;然后审查关联的 pull request #13675。完成标准应包括:对于移动失败,提供清晰的面向用户的说明,而不是抛出未处理的异常。

由索引模型根据 Issue 内容生成。

评估

技术栈
java
领域
backend, cloud
Issue 类型
缺陷
难度
3/5
预计耗时
1-2 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
25/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。