惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

M
MIT News - Artificial intelligence
罗磊的独立博客
Hugging Face - Blog
Hugging Face - Blog
J
Java Code Geeks
G
Google Developers Blog
美团技术团队
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
腾讯CDC
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
T
The Blog of Author Tim Ferriss
月光博客
月光博客
B
Blog
WordPress大学
WordPress大学
云风的 BLOG
云风的 BLOG
博客园_首页
人人都是产品经理
人人都是产品经理
aimingoo的专栏
aimingoo的专栏
Y
Y Combinator Blog
Jina AI
Jina AI
S
SegmentFault 最新的问题
H
Help Net Security
博客园 - 聂微东
Microsoft Azure Blog
Microsoft Azure Blog
Google DeepMind News
Google DeepMind News

Proxmox Support Forum

[SOLVED] - Github Auth for Mirrors-Kernel Repo? [Automation] Mass migration tool for MS Win11/Server Proxmox GUI hang - not response is it possible to reject or quarantine spam based on conditions I set ? The PVENode task list in PVE9 is partially obscured due to the terminal font being too large. About 100% error reporting due to pveproxy.service hooks Kubernetes overlay networking breaks when upgrading from PVE 9.1 to PVE 9.2.3 Zentraler Speicher No space left on device Combine datastore and direct file archival to tape Kernel panic VFS: Unable to mount root fs on unknown-block (0,0) sobald ein 7.x Kernel verwendet wird. How to migrate disk of a VM from one ZFS to another Windows Server 2025 fails to boot after PVE 9.2 / Linux 7.0 Kernel upgrade Cannot Install Proxmox on T610 Poweredge with H700 PERC card sdn Config. gateway not reachable How to safely change domain/FQDN? Welche Filterquote erreicht ihr? NFS Share status unknown on 2 of 5 nodes Can't connect to PVE9 consoles [solved] Can't connect to PVE9 consoles [solved] [SOLVED] - Use secondary network for PVE commands Created cluster, one node storage gone BUG: proxmox mail gateway FROM = null bypass spam filtering Moving existing PBS from VMWare workstation to PVE cluster Does eBGP SDN fabric support external peering? Bug: PDM 1.1 not recognizing valid license status Proxmox GUI hang - not response PVE crashes unexpectedly Proxmox Backup Server 4.2 released! Advice
Creating snippets using PVE API
invalid@exam · 2026-06-23 · via Proxmox Support Forum

Hello,

Thank you for Proxmox! I'm running 5.4-3 in a test lab right now.

I am trying to use the `customci` configuration parameter for VM's, so I can provide arbitrary `user-data` in the cloud-init configuration. For that, I see that the new snippet feature is the way to go if I understood correctly.

However, I noticed that it's not possible to create snippets using the PVE API (at least through the /api2/json/nodes/{node}/storage/{storage}/upload endpoint). The error I'm currently getting is:

400 Parameter verification failed.
content: upload content type 'snippets' not allowed

I've checked the source code and I see that only the `iso` and `vztmpl` content types are considered for this endpoint: https://git.proxmox.com/?p=pve-stor...9e6fe495501eaed874eee94367d49cb3;hb=HEAD#l410

I think it would make sense to allow snippet managing using the PVE API, is this possible in some way I missed? If it's not, is this planned for the near future? Would it be a desired feature that could be contributed?

Thank you!

As a first approach I wrote a patch that allows the snippet creation on this very endpoint:

Code:

diff --git a/PVE/API2/Storage/Status.pm b/PVE/API2/Storage/Status.pm
index 9a5a952..fd7ac5f 100644
--- a/PVE/API2/Storage/Status.pm
+++ b/PVE/API2/Storage/Status.pm
@@ -417,8 +417,10 @@ __PACKAGE__->register_method ({
                raise_param_exc({ filename => "missing '.tar.gz' or '.tar.xz' extension" });
            }
            $path = PVE::Storage::get_vztmpl_dir($cfg, $param->{storage});
-       } else {
-           raise_param_exc({ content => "upload content type '$content' not allowed" });
+       } elsif ($content eq 'snippets') {
+           $path = PVE::Storage::get_snippet_dir($cfg, $param->{storage});
+  } else {
+      raise_param_exc({ content => "upload content type '$content' not allowed" });
        }
 
        die "storage '$param->{storage}' does not support '$content' content\n"
diff --git a/PVE/Storage.pm b/PVE/Storage.pm
index eb5e86f..bc0981b 100755
--- a/PVE/Storage.pm
+++ b/PVE/Storage.pm
@@ -340,6 +340,15 @@ sub get_iso_dir {
     return $plugin->get_subdir($scfg, 'iso');
 }
 
+sub get_snippet_dir {
+    my ($cfg, $storeid) = @_;
+
+    my $scfg = storage_config($cfg, $storeid);
+    my $plugin = PVE::Storage::Plugin->lookup($scfg->{type});
+
+    return $plugin->get_subdir($scfg, 'snippets');
+}
+
 sub get_vztmpl_dir {
     my ($cfg, $storeid) = @_;

However this endpoint does not seem the right place for handling snippets (at least creation and deletion), since in REST terms the deletion of the snippet would look awkward? In any case, I'll wait for your feedback :)

thats right, currently you cannot create/delete snippets via the api, you have to create them on the target storage (e.g. via a commandline tool, file explorer, etc.)

edit:
if you want to be able to upload some, please open an enhancement request here:

https://bugzilla.proxmox.com

Added another +1 to the feature request ;)

I'm working on some kind of proxmox driver for misc. workloads to bootstrap cloud init vm's without a hassle (e.g. CI Pipelines, ...) in https://gitlab.com/morph027/pve-cloud-init-creator and currently i'm using a workaround using S3 server to upload snippets.

Another +1 to the feature request. :D

Any intention of adding this feature? Using terraform/packer with proxmox becomes really difficult because of this limitation.

poking it again in 2023 ..

we need a way to push snippets for cloud init using the API, or a better way to customize cloud init configuration since the current are not sufficient

I have to say this is one of the more important reasons why we have to use vsphere instead of proxmox in production. I would have liked to understand the thinking behind it/the general direction. There are a lot of good things about proxmox (like the clearly superior GUI to that of vSphere) and this just intriguing.

Shameless 2026 bump... I am looking for such a thing too :)