5
0
mirror of git://git.proxmox.com/git/qemu-server.git synced 2025-01-10 01:18:01 +03:00
Commit Graph

2047 Commits

Author SHA1 Message Date
Thomas Lamprecht
a4262553de api/qemu: extra line cleanup
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-06-06 09:41:52 +02:00
Rhonda D'Vine
3e494a3ca7 Fix #1999: cli: listsnapshot: handle multiple roots and mark orphaned as root
This commit addresses the following things:

* There can be multiple independent snapshot tree roots, display them
  all
* If a snapshot defines a parent that doesn't exist, it is now
  considered a snapshot root

There is a potential issue (which was also before and also affects the
GUI): circular snapshot trees.  That plays into the second mentioned
issue above.  If you manage to have a snapshot that defines a
non-existing root in the config, and then create a snapshot with that
exact name as a child of that snapshot, it would create a circular
dependency.  This would have to get addressed in the GUI too.

Signed-off-by: Rhonda D'Vine <rhonda@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-06-05 19:22:30 +02:00
Thomas Lamprecht
90041ba890 drop references to un-maintained sheepdog plugin
we remove it from pve-storage as it's abandoned

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-06-04 17:43:11 +02:00
Thomas Lamprecht
8aa2ed7c85 refactor do_snapshots_with_qemu a bit cleaner
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-06-04 17:41:23 +02:00
Tim Marx
c2ed338eff whitespace cleanup
Signed-off-by: Tim Marx <t.marx@proxmox.com>
2019-05-27 13:59:08 +02:00
Thomas Lamprecht
6801213d13 common sources.list: move from stretch to buster
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-05-27 13:58:45 +02:00
Fabian Grünbichler
3e24733bdf vm_resume: correctly honor $nocheck
for both vm_mon_cmd calls. under certain circumstances, the following
sequence of events can otherwise fail when live-migrating under load:

S...source node
T...target node

0: migration is complete, handover from S to T starts
1: S: logically move VM config file from S to T via rename()
2: S: rename returns, config file is (visibly) moved on S
3: S: trigger resume on T via mtunnel
4a: T: call vm_resume while config file move is not yet visible on T
4b: T: call vm_resume while config file move is already visible on T

4a instead of 4b means vm_mon_cmd will die in check_running unless
vm_mon_cmd_nocheck is used.

under heavy pmxcfs load and a slow cluster/corosync network, there can
be a few seconds of delay between 1 and 2, with a subsequent race ending in 4a
instead of 4b.

this issue was reported to occur on bulk migrations.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2019-05-25 11:28:26 +02:00
Thomas Lamprecht
e6afd9e13b d/changelog: correct distribution
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-05-22 19:12:54 +02:00
Thomas Lamprecht
2b6f3c421e bump version to 6.0-0+1
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-05-22 19:06:26 +02:00
Thomas Lamprecht
79cf869514 d/control: remove dependency to essential libc
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-05-22 19:00:36 +02:00
Thomas Lamprecht
22ea82a2f8 bump debian compat level to 11
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-05-22 18:47:53 +02:00
Thomas Lamprecht
51e85ba1eb buildsys: use dpkg-dev makefile helpers for pkg info
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-05-22 18:47:23 +02:00
Thomas Lamprecht
987e7ab4e4 test: config2command: fallback to hardcoded version
especially useful when bootstrapping, where  pve-qemu-kvm may not yet
be build

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-05-22 18:37:04 +02:00
Thomas Lamprecht
bf4a933e52 fixup: delete cloudinit disk before restoring
cloudinit is just completely broken...
Until we rewrite this to a sane designe (i.e., never backup, mirror,
... any CI disk anywhere - the state is in the config and gets
created on start and deleted on stop anyway) do this..

Co-developed-by: Mira Limbek <m.limbek@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-05-17 12:09:56 +02:00
Thomas Lamprecht
2b2923aefd QemuServer: code cleanup
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-05-17 10:53:50 +02:00
Thomas Lamprecht
87056e1821 follouwp: set is_cloudinit in drive to avoid always rechecking
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-05-17 10:53:30 +02:00
Mira Limbeck
c4ab3c5584 map cloudinit disk to new vmid on restore
Resolves the issue of restoring a VM that has a cloudinit drive
configured to a new VMID. The VMID of the disk name gets now remapped
correctly and in the process the cloudinit disk is created with the same size
as in PVE/API2/Qemu.pm create_disks and in PVE/QemuServer/Cloudinit
commit_cloudinit_disk as the same constant is used.

This is done by matching any line starting with either 'ide', 'sata' or
'scsi' and then check if it is a cloudinit drive. As cloudinit drives
are attached as cdrom, only those 3 are possible. For the cloudinit
check we use 'parse_drive' followed by 'drive_is_cloudinit' so no custom
regex is necessary.

'--targetstorage' is also taken into account on restore now for
cloudinit disks. If a target storage is specified the format is either
kept if possible, or changed to the default of that storage.

This should fix #1807 completely. The restore error was already resolved
with commit 7e8ab2a, but the vmid of the disk might not have matched the new
one.

Signed-off-by: Mira Limbeck <m.limbeck@proxmox.com>
2019-05-16 16:29:02 +02:00
Mira Limbeck
7d761a016d introduce one global CLOUDINIT_DISK_SIZE constant
The variable is used instead of the literal value so we have one single
place to change the actual value of every use.

Signed-off-by: Mira Limbeck <m.limbeck@proxmox.com>
2019-05-16 16:29:02 +02:00
Thomas Lamprecht
a357092190 fixup: shorter/conciser comment
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-05-16 16:29:02 +02:00
Mira Limbeck
e1afab6e28 fix clone_disk with formats other than raw/qcow2
with commit 64d1a6a it's now possible to specify a format other than raw
or qcow2 when creating VMs. This can lead to an error when cloning the
VMs and a cloudinit disk with a different format is attached (e.g.
vmdk).

We use QEMU_FORMAT_RE in drive_is_cloudinit and according to the
QEMU_FORMAT_RE we support 7 different formats.

With this change we add any format other than 'raw' as '.<format>' to the
name and no longer die on any other format. Cloudinit disks with invalid
format are not cloned as the drive is recognized as cdrom, not cloudinit.

Signed-off-by: Mira Limbeck <m.limbeck@proxmox.com>
2019-05-16 16:27:07 +02:00
Thomas Lamprecht
5cda6c69e3 followup: fixup comment
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-05-15 16:33:46 +02:00
Mira Limbeck
9680b09d64 fix existing cloudinit volume not available for file_size_info
file_size_info can't find the file if it is not available, e.g.,
RBD storage with KRBD or LVM where the volume was not yet activated,
returns then 0, which we interpret as the disk not existing, thus
call vdisk_alloc which errors as the disk, in fact, really already exists.

With this patch we call activate_volume before trying
file_size_info, so if the volume exists we get it available and else
we can really create it.
If the disk does not exist and is created with vdisk_alloc we still
require an additional call to activate_volume for the new disk.

Signed-off-by: Mira Limbeck <m.limbeck@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-05-15 16:31:52 +02:00
Thomas Lamprecht
96f00fd866 fix #503: print correct offline time for stop mode backups
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-05-15 16:28:15 +02:00
Thomas Lamprecht
460fd91560 d/control: add ${misc:Depends} to Depends list
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-05-13 16:06:56 +00:00
Thomas Lamprecht
9e05909534 fixup: correct initial prefix
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-05-13 06:05:51 +00:00
Thomas Lamprecht
e85263a20e minor followup cleanups
remove now out of date commen about 'our', left over from previous
revision

Pass firs $prefix directly to function and some other small stuff

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-05-13 05:50:37 +00:00
Rhonda D'Vine
5f1dc9af73 fix #1999: create a tree view for qm listsnapshot
The look of the tree is based on the GUI variant, so that we have a
consistent output when run multiple times, too.

Signed-off-by: Rhonda D'Vine <rhonda@proxmox.com>
2019-05-13 05:38:36 +00:00
Tim Marx
ca6abacf6b migrate: log which local resource causes error
Signed-off-by: Tim Marx <t.marx@proxmox.com>
2019-05-07 10:22:12 +00:00
Tim Marx
370b05e719 whitespace cleanup
Signed-off-by: Tim Marx <t.marx@proxmox.com>
2019-05-07 10:22:12 +00:00
Thomas Lamprecht
0410703f51 bump version to 5.0-51
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-04-30 14:08:27 +00:00
Thomas Lamprecht
92fcaab73a cloudinit: use detected format in volname parsing
keep the ?, as format is raw if no file ending is there, which we
want to handle too.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-04-30 13:24:56 +00:00
Thomas Lamprecht
84821d1515 followup: do not query size of image we just created
we know the size, and even if a storage plugin pads this up (it
mustn't alloc something smaller, but something bigger can be OK) we
know that our 4MB is OK, and can only be used anyway to make this
compatible between storage plugins.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-04-30 13:09:23 +00:00
Thomas Lamprecht
6aaf593cfd followup: make ISO exists check a bit stricter
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-04-30 13:07:55 +00:00
Mira Limbeck
b56d56cf3a fix #2173: use qemu-img to check cloudinit disk existence
use file_size_info to check for existence of cloudinit disk instead of
'-e'. It uses `qemu-img info` to get some file info, which can handle
rbd, and various other paths for volumes not exposed as normal file
or not mapped, yet.

this addresses a problem with rbd where the path returned available
is not checkable with '-e'.

Any size > 0 is interpreted as the image existing.

Signed-off-by: Mira Limbeck <m.limbeck@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-04-30 12:53:28 +00:00
Christian Ebner
5294c110bb fix: #1075: Restore VM template to VM and try to convert to template.
The restore of a backup from a VM template will first restore the VM and then
convert the restored VM back into a template.
This automatically performes the steps of the current behaviour, where the user
has to manually convert the restored VM back to a template.

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
2019-04-24 17:35:32 +00:00
Thomas Lamprecht
4fdc1d3dfc create ci disk: long line cleanup
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-04-24 13:33:32 +00:00
Thomas Lamprecht
c152600b93 followup: keep raw as default for non-path based stores
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-04-24 13:27:16 +00:00
Wolfgang Link
64d1a6aedf fix #1829: Cloudinit ignore format parameter
When a Cloudinit image is created, we allow choosing
the format as parameter.
So, the parameter should also be taken into account.

The default for Cloudinit will stay qcow2 on directory storages.
2019-04-16 08:14:22 +00:00
Thomas Lamprecht
9741526189 followup: expand check_vm_modify_config_perm comment
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-04-12 16:19:45 +02:00
Dominik Csapak
165be267eb allow non root users to add spice usb port
using the same logic like serialX: socket
users need VM.Config.HWType for usbX: spice
but only root can add/remove real devices

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2019-04-12 16:13:52 +02:00
Dominik Csapak
e30f75c571 move check for serialX: socket
since we do not want the user to change a device which has a real
devices already set, we have to check it later when we have the config

so we do not have to give the params to vm_check_modify_config_perm anymore

also improve the regex to \d+

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2019-04-12 16:13:46 +02:00
Dominik Csapak
e545304343 fix #1811: allow non root user to edit serialX: socket entries
use VM.Config.HWType for 'socket' and root@pam for real serial devices

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2019-04-11 14:06:48 +02:00
Thomas Lamprecht
f0dbdb6896 code cleanup
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-04-05 17:37:18 +02:00
Alwin Antreich
ee43cd487c fix creating clone if target storage is same as source storage
the clone API calls (target) 'storage' parameter is optional as we
simply use the source storage in this case, but we did not handle
this case when we added the bandwidth_limit abillity, address that.

This patch only pushes the storage parameter into the storage_list array
if it is defined.

Signed-off-by: Alwin Antreich <a.antreich@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-04-05 14:46:53 +02:00
Thomas Lamprecht
c68305a497 bump version to 5.0-50
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-04-04 16:22:39 +02:00
Thomas Lamprecht
f6409f6169 followup: remove unused variable and add spave between value and unit
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-04-02 14:33:10 +02:00
Thomas Lamprecht
41756a3b8a followup: reword bwlimit default wording
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-04-02 11:01:35 +02:00
Stoiko Ivanov
0aab5a16b3 bwlimit: add parameter to API2 calls
for migrate_vm, clone_vm and move_vm_disk and extract it. The 'migrate_vm' call
passes it to PVE::QemuMigrate->migrate for handling.

Additionally the bwlimit option's description of the 'create_vm' call gets
consistent capitalization of I/O.

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
2019-04-02 11:01:35 +02:00
Stoiko Ivanov
7e303ef3e4 bwlimit: add parameter to QemuServer::clone_disk
and pass it to qemu_drive_mirror (used for online disks).

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
2019-04-02 11:01:35 +02:00
Stoiko Ivanov
d189e5901b bwlimit: add parameter for QemuMigrate::phase2
used for online local disks via qemu_drive_mirror

Add TODO comment for offline disks, as clone_disk calls `qemu-img
convert`, which does not have a bandwidth limit parameter.

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
2019-04-02 11:00:28 +02:00