[SOLVED] Unable to Create rootdir Content in Volume ID for Container

edsamodra

New Member
Aug 11, 2024
2
0
1
Hello,

I am encountering an issue with content storage creation using the Proxmox API. Specifically, I am trying to create a subvolume format with rootdir content in my storage using the following API endpoint:
Code:
POST /api2/json/nodes/{node}/storage/{storage}/content

Here is the JSON parameter I used:
Code:
{
 "filename": "subvol-1007-disk-0",
 "node": "project-a",
 "size": "8G",
 "storage": "datastore",
 "vmid": 1007,
 "format": "subvol"
}
However, the content created is of type "images" instead of "rootdir". As we know, image content is intended for virtual machines, not containers. Could someone please assist me in understanding why this is happening and how to correctly create rootdir content?

Thank you in advance for your help.
 

Attachments

  • ct.png
    ct.png
    68.2 KB · Views: 2
A rootdir, as the name implies is the root volume for a container. It is usually created automatically when you create a container. The image you selected will be placed on this volume.

However, the naming is no different from a disk that was created for a VM.

The API you picked simply creates a new volume. It can be used for CT or VM. But to use it as a RootDir/RootFS you would need to specify it as a parameter in POST of https://pve.proxmox.com/pve-docs/api-viewer/#/nodes/{node}/lxc

Good luck.


Blockbridge : Ultra low latency all-NVME shared storage for Proxmox - https://www.blockbridge.com/proxmox
 
  • Like
Reactions: edsamodra
A rootdir, as the name implies is the root volume for a container. It is usually created automatically when you create a container. The image you selected will be placed on this volume.

However, the naming is no different from a disk that was created for a VM.

The API you picked simply creates a new volume. It can be used for CT or VM. But to use it as a RootDir/RootFS you would need to specify it as a parameter in POST of https://pve.proxmox.com/pve-docs/api-viewer/#/nodes/{node}/lxc

Good luck.


Blockbridge : Ultra low latency all-NVME shared storage for Proxmox - https://www.blockbridge.com/proxmox
Thank you! You're right.
My problem solve by this: Use the special syntax STORAGE_ID:SIZE_IN_GiB to allocate a new volume.
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!