From 4f8e76866b6ea5c2b1e87f8b50ee5e3d487c7a52 Mon Sep 17 00:00:00 2001 From: stardom3645 Date: Thu, 12 Jun 2025 14:33:19 +0900 Subject: [PATCH 1/2] =?UTF-8?q?rack=20=EA=B8=B0=EB=8A=A5=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../META-INF/db/schema-Diplo-After.sql | 17 +++++- .../LibvirtRestoreBackupCommandWrapper.java | 12 +--- ui/public/locales/en.json | 3 +- ui/public/locales/ko_KR.json | 3 +- ui/src/config/section/infra/zones.js | 3 + ui/src/views/plugins/IFrameRack.vue | 60 +++++++++++++++++++ ui/vue.config.js | 2 +- 7 files changed, 85 insertions(+), 15 deletions(-) create mode 100644 ui/src/views/plugins/IFrameRack.vue diff --git a/engine/schema/src/main/resources/META-INF/db/schema-Diplo-After.sql b/engine/schema/src/main/resources/META-INF/db/schema-Diplo-After.sql index 3b20c46d3389..276322356a87 100644 --- a/engine/schema/src/main/resources/META-INF/db/schema-Diplo-After.sql +++ b/engine/schema/src/main/resources/META-INF/db/schema-Diplo-After.sql @@ -47,4 +47,19 @@ INSERT IGNORE INTO `cloud`.`vbmc_port` (id, port) VALUES (17, 6246); INSERT IGNORE INTO `cloud`.`vbmc_port` (id, port) VALUES (18, 6247); INSERT IGNORE INTO `cloud`.`vbmc_port` (id, port) VALUES (19, 6248); INSERT IGNORE INTO `cloud`.`vbmc_port` (id, port) VALUES (20, 6249); -INSERT IGNORE INTO `cloud`.`vbmc_port` (id, port) VALUES (21, 6250); \ No newline at end of file +INSERT IGNORE INTO `cloud`.`vbmc_port` (id, port) VALUES (21, 6250); + + +-- BEGIN TABLE rackml_config +CREATE TABLE IF NOT EXISTS `rackml_config` ( + `id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT 'primary key', + `zone_id` bigint unsigned NOT NULL COMMENT 'foreign key to data_center.id', + `name` varchar(100) NOT NULL COMMENT 'config name (e.g. default)', + `content` text NOT NULL COMMENT 'RackML content', + `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT 'last update time', +PRIMARY KEY (`id`), +UNIQUE KEY `uc_rackml_zone_name` (`zone_id`, `name`), +CONSTRAINT `fk_rackml__zone` FOREIGN KEY (`zone_id`) REFERENCES `data_center` (`id`) + ON DELETE RESTRICT + ON UPDATE CASCADE +) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb3; \ No newline at end of file diff --git a/plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/wrapper/LibvirtRestoreBackupCommandWrapper.java b/plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/wrapper/LibvirtRestoreBackupCommandWrapper.java index 0779a2aa468d..aff11cc61a58 100644 --- a/plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/wrapper/LibvirtRestoreBackupCommandWrapper.java +++ b/plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/wrapper/LibvirtRestoreBackupCommandWrapper.java @@ -78,7 +78,7 @@ public Answer execute(RestoreBackupCommand command, LibvirtComputingResource ser } private void restoreVolumesOfExistingVM(List volumePaths, String backupPath, - String backupRepoType, String backupRepoAddress, String mountOptions) { + String backupRepoType, String backupRepoAddress, String mountOptions) { String diskType = "root"; String mountDirectory = mountBackupDirectory(backupRepoAddress, backupRepoType); try { @@ -151,16 +151,6 @@ private String mountBackupDirectory(String backupRepoAddress, String backupRepoT try { mountDirectory = Files.createTempDirectory(mountDirectory).toString(); String mount = String.format(MOUNT_COMMAND, backupRepoType, backupRepoAddress, mountDirectory); - if ("cifs".equals(backupRepoType)) { - if (Objects.isNull(mountOptions) || mountOptions.trim().isEmpty()) { - mountOptions = "nobrl"; - } else { - mountOptions += ",nobrl"; - } - } - if (Objects.nonNull(mountOptions) && !mountOptions.trim().isEmpty()) { - mount += " -o " + mountOptions; - } Script.runSimpleBashScript(mount); } catch (Exception e) { throw new CloudRuntimeException(String.format("Failed to mount %s to %s", backupRepoType, backupRepoAddress), e); diff --git a/ui/public/locales/en.json b/ui/public/locales/en.json index 757e2cb4558b..5896947043ef 100644 --- a/ui/public/locales/en.json +++ b/ui/public/locales/en.json @@ -4769,5 +4769,6 @@ "label.theme.cyan": "Cyan", "label.theme.polar.green": "Polar Green", "label.theme.geek.blue": "Geek Blue", -"label.theme.golden.purple": "Golden Purple" +"label.theme.golden.purple": "Golden Purple", +"label.zone.rack": "Rack" } diff --git a/ui/public/locales/ko_KR.json b/ui/public/locales/ko_KR.json index 74a678643f58..d48c6a2240e6 100644 --- a/ui/public/locales/ko_KR.json +++ b/ui/public/locales/ko_KR.json @@ -4769,5 +4769,6 @@ "label.theme.cyan": "\uc2dc\uc548", "label.theme.polar.green": "\ud3f4\ub77c \uadf8\ub9b0", "label.theme.geek.blue": "\uae31 \ube14\ub8e8", -"label.theme.golden.purple": "\uace8\ub4e0 \ud37c\ud50c" +"label.theme.golden.purple": "\uace8\ub4e0 \ud37c\ud50c", +"label.zone.rack": "\uB799\u0020\uC2DC\uAC01\uD654" } diff --git a/ui/src/config/section/infra/zones.js b/ui/src/config/section/infra/zones.js index b4a34372e101..b3ccd17033e2 100644 --- a/ui/src/config/section/infra/zones.js +++ b/ui/src/config/section/infra/zones.js @@ -72,6 +72,9 @@ export default { }, { name: 'physical.network', component: shallowRef(defineAsyncComponent(() => import('@/views/infra/zone/PhysicalNetworksTab.vue'))) + }, { + name: 'zone.rack', + component: shallowRef(defineAsyncComponent(() => import('@/views/plugins/IFrameRack.vue'))) }, { name: 'ipv4.subnets', component: shallowRef(defineAsyncComponent(() => import('@/views/infra/zone/Ipv4GuestSubnetsTab.vue'))), diff --git a/ui/src/views/plugins/IFrameRack.vue b/ui/src/views/plugins/IFrameRack.vue new file mode 100644 index 000000000000..fa8f3af0325d --- /dev/null +++ b/ui/src/views/plugins/IFrameRack.vue @@ -0,0 +1,60 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + + + + diff --git a/ui/vue.config.js b/ui/vue.config.js index 9cae2ff66fb1..e63f7095f0c2 100644 --- a/ui/vue.config.js +++ b/ui/vue.config.js @@ -138,7 +138,7 @@ const vueConfig = { port: 5050, proxy: { '/client': { - target: process.env.CS_URL || 'http://localhost:8080', + target: process.env.CS_URL || 'http://10.10.253.29:8080', secure: false, ws: false, changeOrigin: true, From 8ce65ccf673db2eb53986321ce61015c5e305669 Mon Sep 17 00:00:00 2001 From: stardom3645 Date: Mon, 14 Jul 2025 16:30:57 +0900 Subject: [PATCH 2/2] =?UTF-8?q?Rack=20=EC=8B=9C=EA=B0=81=ED=99=94=20localh?= =?UTF-8?q?ost=20->=20listcapabilitiesresponse.capability.host=20=EA=B0=92?= =?UTF-8?q?=EC=9C=BC=EB=A1=9C=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ui/src/views/plugins/IFrameRack.vue | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/ui/src/views/plugins/IFrameRack.vue b/ui/src/views/plugins/IFrameRack.vue index fa8f3af0325d..364017e74953 100644 --- a/ui/src/views/plugins/IFrameRack.vue +++ b/ui/src/views/plugins/IFrameRack.vue @@ -42,13 +42,12 @@ export default { }, methods: { urlAction () { - const theme = this.$localStorage.get('DARK_MODE') ? '&theme=dark' : '&theme=light' const port = 7077 const zoneId = this.resource.id api('listCapabilities').then(json => { - const host = json.listcapabilitiesresponse.capability.host || 'localhost' - this.uriInfo = `http://${host}:${port}/index.html?zone_id=${zoneId}&name=default${theme}` + const host = json.listcapabilitiesresponse.capability.host || [] + this.uriInfo = `http://${host}:${port}/index.html?zone_id=${zoneId}` this.uriCreateOk = true }).catch(err => { console.error('capabilities API 실패:', err)