From 02e89c0e8d3a29a881ef3eb53779c18c27a808b5 Mon Sep 17 00:00:00 2001 From: Wei Zhou Date: Tue, 23 Jun 2026 16:31:14 +0200 Subject: [PATCH 1/7] debian/rules: remove requiretty from /etc/sudoers.d/cloudstack --- debian/rules | 1 + 1 file changed, 1 insertion(+) diff --git a/debian/rules b/debian/rules index 842fc2408af7..327447823308 100755 --- a/debian/rules +++ b/debian/rules @@ -95,6 +95,7 @@ override_dh_auto_install: # nast hack for a couple of configuration files mv $(DESTDIR)/$(SYSCONFDIR)/$(PACKAGE)/server/cloudstack-limits.conf $(DESTDIR)/$(SYSCONFDIR)/security/limits.d/ mv $(DESTDIR)/$(SYSCONFDIR)/$(PACKAGE)/server/cloudstack-sudoers $(DESTDIR)/$(SYSCONFDIR)/sudoers.d/$(PACKAGE) + sed -i '/requiretty/d' $(DESTDIR)/$(SYSCONFDIR)/sudoers.d/$(PACKAGE) chmod 0440 $(DESTDIR)/$(SYSCONFDIR)/sudoers.d/$(PACKAGE) install -D client/target/utilities/bin/cloud-update-xenserver-licenses $(DESTDIR)/usr/bin/cloudstack-update-xenserver-licenses From 7b2b3917862227a424f6b94f68961b53501d787c Mon Sep 17 00:00:00 2001 From: Wei Zhou Date: Thu, 25 Jun 2026 09:04:02 +0200 Subject: [PATCH 2/7] fix scripts/storage/secondary/setup-sysvm-tmplt /tmp is a tmpfs type of filesystem ``` root@mgmt1:~# /usr/share/cloudstack-common/scripts/storage/secondary/setup-sysvm-tmplt -u 002c593f-eac9-4fee-85dd-44887a3f2042 -f /usr/share/cloudstack-m +anagement/templates/systemvm/systemvmtemplate-4.22.0-x86_64-kvm.qcow2.bz2 -h kvm -d /tmp/tmp5782242889444060623/template/tmpl/1/3 .... Insufficient free disk space for target folder /tmp/tmp5782242889444060623/template/tmpl/1/3: avail=1739872k req=2120000k root@mgmt1:~# mount | grep /tmp tmpfs on /tmp type tmpfs (rw,nosuid,nodev,nr_inodes=1048576,inode64,usrquota) ``` --- scripts/storage/secondary/setup-sysvm-tmplt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/storage/secondary/setup-sysvm-tmplt b/scripts/storage/secondary/setup-sysvm-tmplt index 63006cc4e4c2..96939707b91a 100755 --- a/scripts/storage/secondary/setup-sysvm-tmplt +++ b/scripts/storage/secondary/setup-sysvm-tmplt @@ -105,7 +105,7 @@ if [[ "$destfiles" != "" ]]; then failed 2 "Data already exists at destination $destdir" fi -tmpfolder=/tmp/cloud/templates/ +tmpfolder=/var/tmp/cloud/templates/ mkdir -p $tmpfolder tmplfile=$tmpfolder/$localfile From 695127a83a52c738f58112e3c1794aa4e27c046c Mon Sep 17 00:00:00 2001 From: Wei Zhou Date: Wed, 24 Jun 2026 08:41:51 +0200 Subject: [PATCH 3/7] marvin: revert mysql-connector-python to 8.0.30 --- tools/marvin/setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/marvin/setup.py b/tools/marvin/setup.py index 81ded55e18c6..941617c1562c 100644 --- a/tools/marvin/setup.py +++ b/tools/marvin/setup.py @@ -46,7 +46,7 @@ "marvin.sandbox.basic"], license="LICENSE.txt", install_requires=[ - "mysql-connector-python <= 8.4.0", + "mysql-connector-python <= 8.0.30", "requests >= 2.2.1", "paramiko >= 1.13.0", "nose >= 1.3.3", From 7e15f1dfe820e9cb67b97cbb324794c50a40e7c5 Mon Sep 17 00:00:00 2001 From: Wei Zhou Date: Thu, 25 Jun 2026 18:07:42 +0200 Subject: [PATCH 4/7] Apply "mysql-connector-python >= 8.4.0", --- tools/marvin/setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/marvin/setup.py b/tools/marvin/setup.py index 941617c1562c..6e450c30f41b 100644 --- a/tools/marvin/setup.py +++ b/tools/marvin/setup.py @@ -46,7 +46,7 @@ "marvin.sandbox.basic"], license="LICENSE.txt", install_requires=[ - "mysql-connector-python <= 8.0.30", + "mysql-connector-python >= 8.4.0", "requests >= 2.2.1", "paramiko >= 1.13.0", "nose >= 1.3.3", From c0147c5e90b49dfeefae9cd10fbe02c3023854af Mon Sep 17 00:00:00 2001 From: Wei Zhou Date: Wed, 1 Jul 2026 16:53:58 +0200 Subject: [PATCH 5/7] register systemvm template via /var/tmp in java too --- .../java/com/cloud/upgrade/SystemVmTemplateRegistration.java | 5 +++-- .../src/main/java/com/cloud/storage/StorageManagerImpl.java | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/engine/schema/src/main/java/com/cloud/upgrade/SystemVmTemplateRegistration.java b/engine/schema/src/main/java/com/cloud/upgrade/SystemVmTemplateRegistration.java index 89b71f03289b..52fbc0eee4a5 100644 --- a/engine/schema/src/main/java/com/cloud/upgrade/SystemVmTemplateRegistration.java +++ b/engine/schema/src/main/java/com/cloud/upgrade/SystemVmTemplateRegistration.java @@ -101,6 +101,7 @@ public class SystemVmTemplateRegistration { private static final String TEMPLATES_PATH = fetchTemplatesPath(); private static final String METADATA_FILE_NAME = "metadata.ini"; private static final String METADATA_FILE = TEMPLATES_PATH + METADATA_FILE_NAME; + public static final String TEMP_DIRECTORY = "/var/tmp"; public static final String TEMPORARY_SECONDARY_STORE = "tmp"; private static final String PARTIAL_TEMPLATE_FOLDER = String.format("/template/tmpl/%d/", Account.ACCOUNT_ID_SYSTEM); private static final String storageScriptsDir = "scripts/storage/secondary"; @@ -360,7 +361,7 @@ public void setUpdated(Date updated) { public boolean validateIfSeeded(TemplateDataStoreVO templDataStoreVO, String url, String path, String nfsVersion) { String filePath = null; try { - filePath = Files.createTempDirectory(TEMPORARY_SECONDARY_STORE).toString(); + filePath = Files.createTempDirectory(Paths.get(TEMP_DIRECTORY), TEMPORARY_SECONDARY_STORE).toString(); if (filePath == null) { throw new CloudRuntimeException("Failed to create temporary directory to mount secondary store"); } @@ -962,7 +963,7 @@ public void doInTransactionWithoutResult(final TransactionStatus status) { for (Long zoneId : zoneIds) { String filePath = null; try { - filePath = Files.createTempDirectory(TEMPORARY_SECONDARY_STORE).toString(); + filePath = Files.createTempDirectory(Paths.get(TEMP_DIRECTORY), TEMPORARY_SECONDARY_STORE).toString(); if (filePath == null) { throw new CloudRuntimeException("Failed to create temporary file path to mount the store"); } diff --git a/server/src/main/java/com/cloud/storage/StorageManagerImpl.java b/server/src/main/java/com/cloud/storage/StorageManagerImpl.java index 2d170049663b..9b087f9ebdb2 100644 --- a/server/src/main/java/com/cloud/storage/StorageManagerImpl.java +++ b/server/src/main/java/com/cloud/storage/StorageManagerImpl.java @@ -27,6 +27,7 @@ import java.net.URLDecoder; import java.net.UnknownHostException; import java.nio.file.Files; +import java.nio.file.Paths; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.util.ArrayList; @@ -4062,7 +4063,7 @@ public void doInTransactionWithoutResult(final TransactionStatus status) { SystemVmTemplateRegistration systemVmTemplateRegistration = new SystemVmTemplateRegistration(); String filePath = null; try { - filePath = Files.createTempDirectory(SystemVmTemplateRegistration.TEMPORARY_SECONDARY_STORE).toString(); + filePath = Files.createTempDirectory(Paths.get(SystemVmTemplateRegistration.TEMP_DIRECTORY), SystemVmTemplateRegistration.TEMPORARY_SECONDARY_STORE).toString(); if (filePath == null) { throw new CloudRuntimeException("Failed to create temporary file path to mount the store"); } From 6b075deb25f5fe62fea676500aa8e984124afd32 Mon Sep 17 00:00:00 2001 From: Wei Zhou Date: Wed, 1 Jul 2026 20:27:28 +0200 Subject: [PATCH 6/7] Revert "register systemvm template via /var/tmp in java too" This reverts commit c0147c5e90b49dfeefae9cd10fbe02c3023854af. --- .../java/com/cloud/upgrade/SystemVmTemplateRegistration.java | 5 ++--- .../src/main/java/com/cloud/storage/StorageManagerImpl.java | 3 +-- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/engine/schema/src/main/java/com/cloud/upgrade/SystemVmTemplateRegistration.java b/engine/schema/src/main/java/com/cloud/upgrade/SystemVmTemplateRegistration.java index 52fbc0eee4a5..89b71f03289b 100644 --- a/engine/schema/src/main/java/com/cloud/upgrade/SystemVmTemplateRegistration.java +++ b/engine/schema/src/main/java/com/cloud/upgrade/SystemVmTemplateRegistration.java @@ -101,7 +101,6 @@ public class SystemVmTemplateRegistration { private static final String TEMPLATES_PATH = fetchTemplatesPath(); private static final String METADATA_FILE_NAME = "metadata.ini"; private static final String METADATA_FILE = TEMPLATES_PATH + METADATA_FILE_NAME; - public static final String TEMP_DIRECTORY = "/var/tmp"; public static final String TEMPORARY_SECONDARY_STORE = "tmp"; private static final String PARTIAL_TEMPLATE_FOLDER = String.format("/template/tmpl/%d/", Account.ACCOUNT_ID_SYSTEM); private static final String storageScriptsDir = "scripts/storage/secondary"; @@ -361,7 +360,7 @@ public void setUpdated(Date updated) { public boolean validateIfSeeded(TemplateDataStoreVO templDataStoreVO, String url, String path, String nfsVersion) { String filePath = null; try { - filePath = Files.createTempDirectory(Paths.get(TEMP_DIRECTORY), TEMPORARY_SECONDARY_STORE).toString(); + filePath = Files.createTempDirectory(TEMPORARY_SECONDARY_STORE).toString(); if (filePath == null) { throw new CloudRuntimeException("Failed to create temporary directory to mount secondary store"); } @@ -963,7 +962,7 @@ public void doInTransactionWithoutResult(final TransactionStatus status) { for (Long zoneId : zoneIds) { String filePath = null; try { - filePath = Files.createTempDirectory(Paths.get(TEMP_DIRECTORY), TEMPORARY_SECONDARY_STORE).toString(); + filePath = Files.createTempDirectory(TEMPORARY_SECONDARY_STORE).toString(); if (filePath == null) { throw new CloudRuntimeException("Failed to create temporary file path to mount the store"); } diff --git a/server/src/main/java/com/cloud/storage/StorageManagerImpl.java b/server/src/main/java/com/cloud/storage/StorageManagerImpl.java index 9b087f9ebdb2..2d170049663b 100644 --- a/server/src/main/java/com/cloud/storage/StorageManagerImpl.java +++ b/server/src/main/java/com/cloud/storage/StorageManagerImpl.java @@ -27,7 +27,6 @@ import java.net.URLDecoder; import java.net.UnknownHostException; import java.nio.file.Files; -import java.nio.file.Paths; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.util.ArrayList; @@ -4063,7 +4062,7 @@ public void doInTransactionWithoutResult(final TransactionStatus status) { SystemVmTemplateRegistration systemVmTemplateRegistration = new SystemVmTemplateRegistration(); String filePath = null; try { - filePath = Files.createTempDirectory(Paths.get(SystemVmTemplateRegistration.TEMP_DIRECTORY), SystemVmTemplateRegistration.TEMPORARY_SECONDARY_STORE).toString(); + filePath = Files.createTempDirectory(SystemVmTemplateRegistration.TEMPORARY_SECONDARY_STORE).toString(); if (filePath == null) { throw new CloudRuntimeException("Failed to create temporary file path to mount the store"); } From c53acc0aed55bc90f67df61e9d54526d98f127a7 Mon Sep 17 00:00:00 2001 From: Wei Zhou Date: Wed, 1 Jul 2026 20:29:25 +0200 Subject: [PATCH 7/7] mgmt: add -Djava.io.tmpdir=/var/tmp to JAVA_OPTS --- packaging/systemd/cloudstack-management.default | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packaging/systemd/cloudstack-management.default b/packaging/systemd/cloudstack-management.default index a41338beda68..dbb7fa7d4bc5 100644 --- a/packaging/systemd/cloudstack-management.default +++ b/packaging/systemd/cloudstack-management.default @@ -15,7 +15,7 @@ # specific language governing permissions and limitations # under the License. -JAVA_OPTS="-Djava.security.properties=/etc/cloudstack/management/java.security.ciphers -Djava.awt.headless=true -Xmx2G -XX:+UseParallelGC -XX:MaxGCPauseMillis=500 -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/var/log/cloudstack/management/ -XX:ErrorFile=/var/log/cloudstack/management/cloudstack-management.err --add-opens=java.base/java.lang=ALL-UNNAMED --add-exports=java.base/sun.security.x509=ALL-UNNAMED" +JAVA_OPTS="-Djava.security.properties=/etc/cloudstack/management/java.security.ciphers -Djava.awt.headless=true -Xmx2G -XX:+UseParallelGC -XX:MaxGCPauseMillis=500 -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/var/log/cloudstack/management/ -XX:ErrorFile=/var/log/cloudstack/management/cloudstack-management.err --add-opens=java.base/java.lang=ALL-UNNAMED --add-exports=java.base/sun.security.x509=ALL-UNNAMED -Djava.io.tmpdir=/var/tmp" CLASSPATH="/usr/share/cloudstack-management/lib/*:/etc/cloudstack/management:/usr/share/cloudstack-common:/usr/share/cloudstack-management/setup:/usr/share/cloudstack-management:/usr/share/cloudstack-mysql-ha/lib/*"