Skip to content

Commit 9992c3c

Browse files
authored
Merge pull request #634 from jschoiRR/mold-main#2025
[Mold API] vm스냅샷 복원 시 detail 정보의 'kvmStorageSnapshot' 값 제거, nic 상태 up, down시 로직수정
2 parents 13b775d + b58a489 commit 9992c3c

File tree

4 files changed

+13
-13
lines changed

4 files changed

+13
-13
lines changed

server/src/main/java/com/cloud/vm/UserVmManagerImpl.java

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9680,13 +9680,12 @@ public UserVm updateVmNicLinkState(UpdateVmNicLinkStateCmd cmd){
96809680
throw new InvalidParameterValueException(nic + " is not a nic on " + vmInstance);
96819681
}
96829682

9683-
//make sure the VM is Running or Stopped
9684-
if ((vmInstance.getState() != State.Running)) {
9685-
throw new CloudRuntimeException("refusing to set default " + vmInstance + " is not Running");
9686-
}
96879683
final NicProfile nicProfile = new NicProfile(nic, network, nic.getBroadcastUri(), nic.getIsolationUri(), _networkModel.getNetworkRate(network.getId(), vmInstance.getId()),
96889684
_networkModel.isSecurityGroupSupportedInNetwork(network), _networkModel.getNetworkTag(vmInstance.getHypervisorType(), network));
96899685

9686+
nic.setLinkState(cmd.getLinkState());
9687+
_nicDao.update(nicId, nic);
9688+
96909689
if (vmInstance.getState() == State.Running) {
96919690
VirtualMachineProfile vmProfile = new VirtualMachineProfileImpl(vmInstance);
96929691
final HypervisorGuru hvGuru = _hvGuruMgr.getGuru(vmProfile.getVirtualMachine().getHypervisorType());
@@ -9695,9 +9694,6 @@ public UserVm updateVmNicLinkState(UpdateVmNicLinkStateCmd cmd){
96959694
Long hostId = vmInstance.getHostId() != null ? vmInstance.getHostId() : vmInstance.getLastHostId();
96969695
NicLinkStateCommand nlscmd = new NicLinkStateCommand(nicTO, vmInstance.getInstanceName(), cmd.getLinkState());
96979696

9698-
nic.setLinkState(cmd.getLinkState());
9699-
_nicDao.update(nicId, nic);
9700-
97019697
try {
97029698
Answer answer = _agentMgr.send(hostId, nlscmd);
97039699
if (answer == null || !answer.getResult()) {

server/src/main/java/com/cloud/vm/snapshot/VMSnapshotManagerImpl.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -953,7 +953,9 @@ protected void revertUserVmDetailsFromVmSnapshot(UserVmVO userVm, VMSnapshotVO v
953953
List<VMSnapshotDetailsVO> vmSnapshotDetails = _vmSnapshotDetailsDao.listDetails(vmSnapshotVo.getId());
954954
List<UserVmDetailVO> userVmDetails = new ArrayList<UserVmDetailVO>();
955955
for (VMSnapshotDetailsVO detail : vmSnapshotDetails) {
956-
userVmDetails.add(new UserVmDetailVO(userVm.getId(), detail.getName(), detail.getValue(), detail.isDisplay()));
956+
if (!"kvmStorageSnapshot".equals(detail.getName())) {
957+
userVmDetails.add(new UserVmDetailVO(userVm.getId(), detail.getName(), detail.getValue(), detail.isDisplay()));
958+
}
957959
}
958960
_userVmDetailsDao.saveDetails(userVmDetails);
959961
}

ui/src/components/widgets/WallLinkUrl.vue

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,14 +63,15 @@ export default {
6363
uri += wallPortalProtocol + '://' + wallPortalDomain + ':' + wallPortalPort
6464
if (this.scope === 'vm') {
6565
const vmUriPath = items.filter(x => x.name === 'monitoring.wall.portal.vm.uri')[0]?.value
66-
this.uriInfo = uri + vmUriPath + '?kiosk&orgId=2&var-vm_uuid=' + this.resource.id
66+
this.uriInfo = uri + vmUriPath + '?kiosk&orgId=2&theme=light&var-vm_uuid=' + this.resource.id
6767
this.uriCreateOk = true
6868
} else if (this.scope === 'host') {
6969
const hostUriPath = items.filter(x => x.name === 'monitoring.wall.portal.host.uri')[0]?.value
70-
this.uriInfo = uri + hostUriPath + '?from=now-1h&to=now&var-host=' + this.resource.ipaddress
70+
this.uriInfo = uri + hostUriPath + '?from=now-1h&to=now&theme=light&var-host=' + this.resource.ipaddress
7171
this.uriCreateOk = true
7272
} else if (this.scope === 'cluster') {
73-
this.uriInfo = uri + items.filter(x => x.name === 'monitoring.wall.portal.cluster.uri')[0]?.value
73+
const clusterUriPath = items.filter(x => x.name === 'monitoring.wall.portal.cluster.uri')[0]?.value
74+
this.uriInfo = uri + clusterUriPath + '?theme=light'
7475
this.uriCreateOk = true
7576
}
7677
})

ui/src/views/plugins/IFrameWall.vue

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,11 @@ export default {
5252
}
5353
var uri = wallPortalProtocol + '://' + wallPortalDomain + ':' + wallPortalPort
5454
if (typeof hypervisortype !== 'undefined' && hypervisortype !== null && hypervisortype !== '') {
55-
this.uriInfo = uri + items.filter(x => x.name === 'monitoring.wall.portal.cluster.uri')[0]?.value
55+
const clusterUriPath = items.filter(x => x.name === 'monitoring.wall.portal.cluster.uri')[0]?.value
56+
this.uriInfo = uri + clusterUriPath + '?theme=light'
5657
} else {
5758
const hostUriPath = items.filter(x => x.name === 'monitoring.wall.portal.host.uri')[0]?.value
58-
this.uriInfo = uri + hostUriPath + '?from=now-1h&to=now&var-host=' + this.resource.ipaddress
59+
this.uriInfo = uri + hostUriPath + '?from=now-1h&to=now&theme=light&var-host=' + this.resource.ipaddress
5960
}
6061
this.uriCreateOk = true
6162
})

0 commit comments

Comments
 (0)