LXC backup storage path

Karberg

New Member
Nov 14, 2018
3
0
1
37
Hi,

I have tried to find a way through CLI or the API to find what the storage path is for a specific container.
But it seems it's not possible to get out.

My goal is to make an automation of stopping a specific container based on ID, restore latest backup & start the container again.
This is for some internal use where I need to rollback the container to a stage after usage.
 
This is for some internal use where I need to rollback the container to a stage after usage.
sounds more like the job for a snapshot, but a backup will work i guess

I have tried to find a way through CLI or the API to find what the storage path is for a specific container.
i guess you mean the volume id for backups of a specific guest?

if yes use something like this:
Code:
pvesh get /nodes/NODENAME/storage/STORAGEID/content -content backup -vmid VMID

to get all backup files for VMID on STORAGEID visible from NODENAME
 
Backup works just fine.
It contains everything needed for a clean state of the app, doesn't take long for me to stop the container, rollback & start.

I ran
Code:
pct restore <vmID> <path & filename of the backup>
Manually just to see how it behaved.

the pvesh get command you wrote is perfect, it gives me the end thing i want in what i'm trying to do, thank you for that.

The STORAGEID, Is it possible to obtain that with a CLI command, based on VMID ?
The storage could change over time, and i want to remove params in my script.

The only params i want to set in my script would probably be VMID & NODENAME, since our IT automation (rundeck) have to SSH into the node.
 
The STORAGEID, Is it possible to obtain that with a CLI command, based on VMID ?
this is the storage where the backup is, not where the guest disks are
the api path to get those are under '/cluster/backup' if you do it automatically
 

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!