Virtio DIsque management

remy_dev

Member
Dec 5, 2017
11
0
6
44
Hello,

I carry out tests to validate my process.

I wish manage backup with specific data in different time period.
That why i add a virtual drive to my machine,
1 drive is for the os
1 drive is for the datas

2 questions.
- When I add a disk (virtio) to a virtual machine where is mention exclude backup, how i'm supposed to backups this new hard drive?
* Maybe i have to generate 2 tasks, one for each drive ?

- When I duplicate this virtual drive, how can I add this new drive to another virtual machine?



Code:
I carry out tests to validate my process.
I have two bands in a row.

2 questions.
When I add a disk (virtio) to a virtual machine, when I make a backup of the machine with exclusion of the new disk. How to make specific disk backups?

When I duplicate the disc, how do I add the disc to another machine?


Code:
root@srv-noth01:/dev/mapper# fdisk -l
Disk /dev/sda: 111.8 GiB, 120034123776 bytes, 234441648 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 11CF7F6F-82B2-4AA5-8854-A6459B37EAAB

Device      Start       End   Sectors   Size Type
/dev/sda1    2048      4095      2048     1M BIOS boot
/dev/sda2    4096    528383    524288   256M EFI System
/dev/sda3  528384 234441614 233913231 111.6G Linux LVM


Disk /dev/mapper/pve-root: 27.8 GiB, 29796335616 bytes, 58195968 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/sdb: 1.8 TiB, 2000397852160 bytes, 3907027055 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xfc191ab2

Device     Boot Start        End    Sectors  Size Id Type
/dev/sdb1        2048 3907026943 3907024896  1.8T 83 Linux


Disk /dev/sdc: 119.5 GiB, 128312147968 bytes, 250609664 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x47c1fdb3

Device     Boot Start       End   Sectors   Size Id Type
/dev/sdc1        2048 250609663 250607616 119.5G 8e Linux LVM


Disk /dev/mapper/pve-swap: 7 GiB, 7516192768 bytes, 14680064 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk /dev/mapper/pve-vm--202--disk--2: 20 GiB, 21474836480 bytes, 41943040 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 65536 bytes / 65536 bytes


Disk /dev/mapper/pve-vm--202--disk--1: 2.5 GiB, 2684354560 bytes, 5242880 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 65536 bytes / 65536 bytes
Disklabel type: dos
Disk identifier: 0x4589bcd4

Device                                 Boot  Start     End Sectors  Size Id Type
/dev/mapper/pve-vm--202--disk--1-part1 *      2048  206847  204800  100M 83 Linux
/dev/mapper/pve-vm--202--disk--1-part2      206848  993279  786432  384M 82 Linux swap / Solaris
/dev/mapper/pve-vm--202--disk--1-part3      993280 5242879 4249600    2G 83 Linux


Disk /dev/mapper/pve-vm--202--disk--3: 10 GiB, 10737418240 bytes, 20971520 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 65536 bytes / 65536 bytes


Disk /dev/mapper/pve-vm--101--disk--1: 2.5 GiB, 2684354560 bytes, 5242880 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 65536 bytes / 65536 bytes
Disklabel type: dos
Disk identifier: 0x4589bcd4

Device                                 Boot  Start     End Sectors  Size Id Type
/dev/mapper/pve-vm--101--disk--1-part1 *      2048  206847  204800  100M 83 Linux
/dev/mapper/pve-vm--101--disk--1-part2      206848  993279  786432  384M 82 Linux swap / Solaris
/dev/mapper/pve-vm--101--disk--1-part3      993280 5242879 4249600    2G 83 Linux
 
Last edited:
- When I add a disk (virtio) to a virtual machine where is mention exclude backup, how i'm supposed to backups this new hard drive?
* Maybe i have to generate 2 tasks, one for each drive ?
You usually backup complete VMs and configure a exclusion for a disk. Check out the docs, for details. https://pve.proxmox.com/pve-docs/pve-admin-guide.html#chapter_vzdump

- When I duplicate this virtual drive, how can I add this new drive to another virtual machine?
You clone manually a disk? You clone a complete VM/template, not a single disks. As it is all connected to qemu process having the disks.
 
As exemple virtio2 is a copy of virtio1 (i don't delete source, when i move it).

I move the disk virtio1, so i was thinking, it's possible to backup virtio1 separately of virtio0.
Ans in the same time; it's possible to link the new drive that a move to an other VM.

upload_2017-12-6_10-37-33.png
So you confirm, if i want move some data to an other VM, i have to copy paste all the hard drive to a new one ?
 
I move the disk virtio1, so i was thinking, it's possible to backup virtio1 separately of virtio0.
No, you always backup a VM, not a single disk.

Ans in the same time; it's possible to link the new drive that a move to an other VM.
You can manually edit the vmid.conf in /etc/pve/qemu/ and delete/add the disk from a VM. But you will be using the same naming of the VM disk.
 
you always backup a VM, not a single disk

I think I'm missing something in virtual disk management.
If I can't make a specific backup for a disk, what's the point of excluding it from a backup?
You have to be able to restart VMs at some point.

Ok for the duplication of a disk, but in the long run, if the VM name is keep, there can be confusion in the names when link to other VM... but ok.

However, how do I delete a moved disk? Because if I delete the disk (GUI), only the line in /etc/pve/qemu/<id>. conf is deleted, the disk is always present in the content list.

Thank you
 
I think I'm missing something in virtual disk management.
If I can't make a specific backup for a disk, what's the point of excluding it from a backup?
You have to be able to restart VMs at some point.
As the options says, you exclude the disk from the VM backup, only non-excluded disks are then in the backup file. You don't need to restart servers for backup, you just need to make sure that any application inside the VM is flushing its content from memory to disk before the backup takes place. Qemu will then do a snapshot of the disk(s) and backup that state as it is consistent. Afterwards it will remove the snapshot again.

Ok for the duplication of a disk, but in the long run, if the VM name is keep, there can be confusion in the names when link to other VM... but ok.
Exactly. That's why you either do all duplication manually or clone the whole VM.

However, how do I delete a moved disk? Because if I delete the disk (GUI), only the line in /etc/pve/qemu/<id>. conf is deleted, the disk is always present in the content list.
If you click "remove disk" then it will be displayed as "unused disk" and the next step deletes it from storage. If it is not able to, you should get a error message.
 
  • Like
Reactions: remy_dev

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!