Skip to content

Commit 3f29a95

Browse files
committed
fix lasthost not getting assigned
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
1 parent e9c3a0d commit 3f29a95

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

plugins/integrations/veeam-control-service/src/main/java/org/apache/cloudstack/veeam/api/converter/UserVmJoinVOToVmConverter.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,8 @@ public static Vm toVm(final UserVmJoinVO src,
9999
src.getHostUuid()));
100100
}
101101
if (hostResolver != null) {
102-
HostJoinVO hostVo = hostResolver.apply(src.getHostId() == null ? src.getLastHostId() : src.getHostId());
102+
Long hostId = (src.getHostId() == null || src.getHostId() == 0) ? src.getLastHostId() : src.getHostId();
103+
HostJoinVO hostVo = hostResolver.apply(hostId);
103104
if (hostVo != null) {
104105
dst.setHost(buildRef(
105106
basePath + ApiRouteHandler.BASE_ROUTE,

0 commit comments

Comments
 (0)