5
0
mirror of git://git.proxmox.com/git/qemu-server.git synced 2025-03-09 08:58:25 +03:00

1165 Commits

Author SHA1 Message Date
Thomas Lamprecht
16a01738cb qm showcmd: add simple 'pretty' parameter
Shows each parameter value pair in a new line with a backslash at the
end, so it's still possible to copy, paste and execute it, while
being easier to read and edit by humans. This is opt in.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2018-01-10 15:47:05 +01:00
Alexandre Derumier
f38de678e4 increase start timeout when hugepages are enabled.
Hugepages can take some time to be allocated by qemu at start (60s for 120G of 1G hugepages).
This patch increase start timeout to 5min when hugepages are enabled.
2018-01-10 15:08:26 +01:00
Wolfgang Bumiller
39fd79e2ad add 'flags' property to cpu option
Currently this only allows specifying '+pcid' or '-pcid'
but might be extended in the future.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2018-01-09 15:42:53 +01:00
Wolfgang Bumiller
13bca7b4de fix efi disk format detection
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Fixes: 2bfbee039bbe ("include format for efidisk")
Reviewed-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Tested-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2018-01-09 15:20:51 +01:00
Emmanuel Kasper
3618ee99aa Use default values from load_defaults() when none is specified in conf
This also fixes a bug where VMs with no memory defined in the config
where reported as using 0MB instead of 512.

Signed-off-by: Emmanuel Kasper <e.kasper@proxmox.com>
2017-12-15 13:05:59 +01:00
Wolfgang Bumiller
ccb88f4578 termproxy, vncproxy: use -escape 0 for qm terminal
There's no reason to have Ctrl+O terminate these sessions.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Reviewed-by: Dominik Csapak <d.csapak@proxmox.com>
2017-12-13 14:52:28 +01:00
Wolfgang Bumiller
aa320bcd16 qm terminal: add --escape option
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Reviewed-by: Dominik Csapak <d.csapak@proxmox.com>
2017-12-13 14:52:28 +01:00
Dominik Csapak
9e6d6e97c4 enable vncproxy with vncterm for serial ports
this enables the output via vncterm when the vm has
configured a serial port

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2017-12-12 08:34:03 +01:00
Dominik Csapak
8730200273 add termproxy api call
for xtermjs web client

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2017-12-12 08:34:03 +01:00
Dominik Csapak
a2fab11a46 fix #1570: fix template backup with pigz
when using pigz the resulting commandline would look like:

pigz -p 4>file

which resulted in pigz erroring out because it got no parameter for -p
(because the shell interpreted the 4>file as a file descriptor)

this patch adds a space so that the resulting line is
pigz -p 4 > file

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Reviewed-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2017-12-06 14:54:00 +01:00
Dominik Csapak
c449137a04 do not add unused disk when already as unused on another storage
when having an unused disk on a storage for which there are multiple
definitions, we added it again on another storage when that storage
was alphabetically before the already existing one

this happens for example when using our automatically generated
ceph storages: 'pool_ct' and 'pool_vm' and having a vm with
an unused disk

with this patch, we also leave the unused disks in the hash

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2017-11-20 14:38:48 +01:00
Dominik Csapak
6a567ae731 make ssh connection transparent
do not use an escape character for vncproxy

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2017-11-17 10:38:26 +01:00
Dominik Csapak
aea47dd6a0 fix #1471: change keyboard default to undef
this means that we do not include the '-k' parameter anymore by default
(which is deprecated by qemu)

with this, noVNC and spice always respect the guest keyboard
configuration and altgr keys work without problems

tested:
ubuntu with english intl and german with novnc and spice
windows 10 with english intl and german with novnc and spice
live migration

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2017-11-15 13:16:38 +01:00
Wolfgang Bumiller
6941ee4e1c fix typo
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2017-11-10 11:27:05 +01:00
Dominik Csapak
1a988fd2e8 check if ga runs before a fsfreeze-freeze/thaw
since the guest-fsfreeze-freeze command has a timeout of 1 hour,
we want to check if the guest-agent even runs before executing that,
or else we wait 1 hour and then continue

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Reviewed-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2017-11-10 11:20:55 +01:00
Thomas Lamprecht
44c2a647ff update ostype documentation
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2017-11-07 08:47:15 +01:00
Dominik Csapak
2bfbee039b include format for efidisk
if the efidisk is in 'raw' format, qemu will prevent writes
on block zero if the format is not explicitely given

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2017-11-07 08:45:25 +01:00
Philip Abernethy
237239bf60 correct cpuunits range
'These options take an integer value and control the "cpu.shares"
control group attribute. The allowed range is 2 to 262144. Defaults to
1024.' – man 5 systemd.resource-control
2017-10-17 14:10:49 +02:00
Dominik Csapak
5e67a2d2c4 check if base volumes are unused before deleting a template
we only checked if a vm had in use base disks when deleting them,
at which point we do not stop to delete the vm even when a
disk deletion fails, which means we could successfully delete the config
and all not used (base) disks of a template, resulting in left over vm disks

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2017-10-13 10:18:34 +02:00
Emmanuel Kasper
5d942f5aff importovf: explicitly returns undef
We set the returns value to  { type => 'null' } but we returned an empty
string, which was confusing the cli handler.
2017-09-27 14:54:56 +02:00
Wolfgang Bumiller
0f80f1ab6d qm importovf: --dryrun: use json output format 2017-09-25 13:51:53 +02:00
Wolfgang Bumiller
b533b99534 qm importovf: set return type to null 2017-09-25 13:51:53 +02:00
Wolfgang Bumiller
f6306646d8 whitespace fixup 2017-09-25 13:51:53 +02:00
Emmanuel Kasper
7cd9f6d77e Add new qm command 'importovf', to create VMs from an OVF manifest
Currently the following extracted parameters are used to create a VM:
* VM name
* Memory
* Number of cores
* Disks
2017-09-25 13:31:55 +02:00
Emmanuel Kasper
ae2fcb3be6 Refactor defaut bootdisk and smbios1 uuid generation in own subs
This will allow code reuse for qm importovf
2017-09-25 13:31:55 +02:00
Emmanuel Kasper
d16287d8d2 Initial support for importing OVF virtual machines
Following OVF parameters will be extracted:
 * VM name
 * Memory
 * Number of cores
 * disks and their associated controllers
2017-09-25 13:31:55 +02:00
Fabian Grünbichler
8ddbcf8bd6 use foreach_drive in foreach_storage_used_by_vm
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2017-09-22 10:02:54 +02:00
Fabian Grünbichler
8cad5e9bd8 config: make vmstatestorage hotpluggable
since this is just an option for PVE, and does not concern the VM at all.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2017-09-22 10:02:54 +02:00
Fabian Grünbichler
65a5ce88e6 rename foreach_writable_storage to foreach_storage_used_by_vm
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2017-09-22 10:02:54 +02:00
Fabian Grünbichler
2eeb0c9321 snapshot: use explicitly configured vmstate storage
and simplify storage loop

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2017-09-22 10:02:54 +02:00
Fabian Grünbichler
253624c76f config: add vmstatestorage option
and permission checks

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2017-09-22 10:02:54 +02:00
Matthias Urban
c268337d93 VM.Snapshot.Rollback privilege added
VM.Snapshot.Rollback privilege added

Signed-off-by: Matthias Urban <matthias.urban@pure-systems.com>
2017-09-22 09:26:55 +02:00
Emmanuel Kasper
6cb0144ae3 do not overwrite global signal handlers
perls 'local' must be either used in front of each $SIG{...}
assignments or they must be put in a list, else it affects only the
first variable and the rest are *not* in local context.

In all cases the global signal handlers we overwrote were in cli programs or
forked workers, not in daemons.
2017-09-14 15:25:28 +02:00
Alexandre Derumier
d296ed08d3 migration : enable mtunnel for insecure migration V2
We only use it to send commands faster like resume

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2017-09-12 14:15:33 +02:00
Thomas Lamprecht
4dcce9ee3c ovmf: deprecate old legay ovmf image and refactor
this was only kept for PVE 4.X where the switch to the newer OVMF
image with actual working persisten EFIVARS was made.

We do not ship this old image in PVE 5.0 anymore so remove this
legacy code as it can never trigger anyhow.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2017-09-11 10:04:46 +02:00
Thomas Lamprecht
3e1f112286 create_disks: refactor out and improve efidisk creation
factor out code in a new create_efidisk submethod, as else this code
is hardly readable as the efidisk0 case is a special case. Refer from
putting all this specialised handling directly to the much shorter
code for all other cases.

Also the disk was created with a specific format and then a format
detection on the newly created disk was done, which is pretty
useless, clear that up.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2017-09-11 10:04:46 +02:00
Thomas Lamprecht
a1d8c038c5 efidisk: do not hard code efivar base image size
The size of this image is not fixed, it increased to 528k in more
recent build of OVMF and could increase further (not likely, but
possible).

Instead of changing the hardcoded value move to a more generic
approach and read the size from the base image at creation time.

Use the new convert_size method and generalise the assignment of
size and volid between the efidisk and the normal case, as a part of
this change.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2017-09-11 10:04:46 +02:00
Emmanuel Kasper
c2327320a8 Remove unused variable declaration 2017-09-07 11:22:32 +02:00
Emmanuel Kasper
46dd42f70c Fix #1441: Do not unplug controllers when the mirroring is finished
This should not be needed since we call 'block-job-complete' before
in qemu_drive_mirror_monitor(), and after benchmarking it does not
appear to be needed nor provide a measurable improvement when shutting
down the source.
2017-09-07 11:22:32 +02:00
Thomas Lamprecht
5b97ef2441 restore_vma_archive: do not overwrite global signal handlers
perls 'local' must be either used in front of each $SIG{...}
assignments or they must be put in a list, else it affects only the
first variable and the rest are *not* in local context.

This may cause weird behaviour where daemons seemingly do not get
terminating signals delivered correctly and thus may not shutdown
gracefully anymore.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2017-09-07 10:39:34 +02:00
Thomas Lamprecht
eaae66be9f API/clone: do not overwrite global signal handlers
perls 'local' must be either used in front of each $SIG{...}
assignments or they must be put in a list, else it affects only the
first variable and the rest are *not* in local context.

This may cause weird behaviour where daemons seemingly do not get
terminating signals delivered correctly and thus may not shutdown
gracefully anymore.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2017-09-07 10:39:28 +02:00
Fabian Grünbichler
edd48c325a update_vm: sort logged parameters
otherwise the (log) output looks really strange when mass-updating VMs, e.g.:
update VM 400001: -scsi1 somestore:64 -scsi0 somestore:64 -ide2 isostore:iso/somefile.iso,media=cdrom
update VM 400002: -ide2 isostore:iso/somefile.iso,media=cdrom -scsi1 somestore:64 -scsi0 somestore:64
update VM 400003: -scsi0 somestore:64 -ide2 isostore:iso/somefile.iso,media=cdrom -scsi1 somestore:64

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2017-09-07 10:21:47 +02:00
Philip Abernethy
bfcd9b7eac Fix #1125. Check for KVM support before starting VM
Moved the check to the beginning of the function.
VMs configured to use KVM won't start if KVM is not available.
VMs not configured to use KVM will start regardless.
2017-08-21 16:19:20 +02:00
Philip Abernethy
74c02ef7f8 Refactors $nokvm to $kvm
for improved readability and consistency with the option name.
2017-08-21 16:19:20 +02:00
Philip Abernethy
075e8249fa Refactor HyperV enlightenments
Fixes a typo in the function name and removes the $nokvm parameter, as it's only
used to immideately exit the function. Instead calling the function
conditionally.
2017-08-21 16:19:20 +02:00
Fabian Grünbichler
4305207d61 migrate: reduce polling intervals
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2017-08-07 09:23:56 +02:00
Fabian Grünbichler
4bdd20ab14 migrate: keep track of replication
and only transfer state and switch direction if there
actually are any replicated volumes.

once we add support for live-migration with replicated
volumes, adding a set-replication-state command to the
tunnel and using that probably makes sense.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2017-08-07 09:23:56 +02:00
Fabian Grünbichler
2e7fee87df migrate: finish tunnel in phase 3
after resuming the VM over the tunnel.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2017-08-07 09:23:56 +02:00
Fabian Grünbichler
1d5aaa1db5 qm mtunnel/migrate: add resume VMID command
and reformat the legacy SSH variant for readability.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2017-08-07 09:23:56 +02:00
Fabian Grünbichler
bcb51ae8f9 mtunnel: add and handle OK/ERR replies
because we want commands to return meaningful errors, and
print them on the client/source side.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2017-08-07 09:23:56 +02:00