Skip to content

Commit a75802a

Browse files
committed
Revert sharedfsvm changes
1 parent ff30b6f commit a75802a

3 files changed

Lines changed: 7 additions & 32 deletions

File tree

plugins/storage/sharedfs/storagevm/src/main/java/org/apache/cloudstack/storage/sharedfs/lifecycle/StorageVmSharedFSLifeCycle.java

Lines changed: 5 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -140,18 +140,13 @@ private String getStorageVmConfig(final String fileSystem, final String hypervis
140140
return fsVmConfig;
141141
}
142142

143-
private String getStorageVmPrefix(String fileShareName) {
143+
private String getStorageVmName(String fileShareName) {
144144
String prefix = String.format("%s-%s", SharedFSVmNamePrefix, fileShareName);
145+
String suffix = Long.toHexString(System.currentTimeMillis());
146+
145147
if (!NetUtils.verifyDomainNameLabel(prefix, true)) {
146148
prefix = prefix.replaceAll("[^a-zA-Z0-9-]", "");
147149
}
148-
return prefix;
149-
}
150-
151-
private String getStorageVmName(String fileShareName) {
152-
String prefix = getStorageVmPrefix(fileShareName);
153-
String suffix = Long.toHexString(System.currentTimeMillis());
154-
155150
int nameLength = prefix.length() + suffix.length() + SharedFSVmNamePrefix.length();
156151
if (nameLength > 63) {
157152
int prefixLength = prefix.length() - (nameLength - 63);
@@ -241,18 +236,8 @@ public Pair<Long, Long> deploySharedFS(SharedFS sharedFS, Long networkId, Long d
241236
Account owner = accountMgr.getActiveAccountById(sharedFS.getAccountId());
242237
UserVm vm = deploySharedFSVM(sharedFS.getDataCenterId(), owner, List.of(networkId), sharedFS.getName(), sharedFS.getServiceOfferingId(), diskOfferingId, sharedFS.getFsType(), size, minIops, maxIops);
243238

244-
List<VolumeVO> volumes = volumeDao.findByInstance(vm.getId());
245-
VolumeVO dataVol = null;
246-
for (VolumeVO vol : volumes) {
247-
String volumeName = vol.getName();
248-
String updatedVolumeName = SharedFSVmNamePrefix + "-" + volumeName;
249-
vol.setName(updatedVolumeName);
250-
volumeDao.update(vol.getId(), vol);
251-
if (vol.getVolumeType() == Volume.Type.DATADISK) {
252-
dataVol = vol;
253-
}
254-
}
255-
return new Pair<>(dataVol.getId(), vm.getId());
239+
List<VolumeVO> volumes = volumeDao.findByInstanceAndType(vm.getId(), Volume.Type.DATADISK);
240+
return new Pair<>(volumes.get(0).getId(), vm.getId());
256241
}
257242

258243
@Override

ui/src/components/view/InfoCard.vue

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,6 @@
3333
<span v-if="(resource.icon && resource.icon.base64image || images.template || images.iso || resourceIcon) && !['router', 'systemvm', 'volume'].includes($route.path.split('/')[1])">
3434
<resource-icon :image="getImage(resource.icon && resource.icon.base64image || images.template || images.iso || resourceIcon)" size="4x" style="margin-right: 5px"/>
3535
</span>
36-
<span v-else-if="resource.vmtype === 'sharedfsvm'">
37-
<file-text-outlined style="font-size: 36px;" />
38-
</span>
3936
<span v-else>
4037
<os-logo v-if="resource.ostypeid || resource.ostypename" :osId="resource.ostypeid" :osName="resource.ostypename" size="3x" @update-osname="setResourceOsType"/>
4138
<render-icon v-else-if="typeof $route.meta.icon ==='string'" style="font-size: 36px" :icon="$route.meta.icon" />
@@ -873,7 +870,6 @@ import UploadResourceIcon from '@/components/view/UploadResourceIcon'
873870
import eventBus from '@/config/eventBus'
874871
import ResourceIcon from '@/components/view/ResourceIcon'
875872
import ResourceLabel from '@/components/widgets/ResourceLabel'
876-
import { FileTextOutlined } from '@ant-design/icons-vue'
877873
878874
export default {
879875
name: 'InfoCard',
@@ -885,8 +881,7 @@ export default {
885881
TooltipButton,
886882
UploadResourceIcon,
887883
ResourceIcon,
888-
ResourceLabel,
889-
FileTextOutlined
884+
ResourceLabel
890885
},
891886
props: {
892887
resource: {

ui/src/components/view/ListView.vue

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,6 @@
4444
<span v-if="record.icon && record.icon.base64image">
4545
<resource-icon :image="record.icon.base64image" size="2x"/>
4646
</span>
47-
<span v-else-if="record.vmtype === 'sharedfsvm'">
48-
<file-text-outlined style="font-size: 24px;" />
49-
</span>
5047
<os-logo v-else :osId="record.ostypeid" :osName="record.osdisplayname" size="xl" />
5148
</span>
5249
<span style="min-width: 120px" >
@@ -594,7 +591,6 @@ import { createPathBasedOnVmType } from '@/utils/plugins'
594591
import { validateLinks } from '@/utils/links'
595592
import cronstrue from 'cronstrue/i18n'
596593
import moment from 'moment-timezone'
597-
import { FileTextOutlined } from '@ant-design/icons-vue'
598594
599595
export default {
600596
name: 'ListView',
@@ -605,8 +601,7 @@ export default {
605601
CopyLabel,
606602
TooltipButton,
607603
ResourceIcon,
608-
ResourceLabel,
609-
FileTextOutlined
604+
ResourceLabel
610605
},
611606
props: {
612607
columns: {

0 commit comments

Comments
 (0)