Commit Graph

605 Commits

Author SHA1 Message Date
Alexandre Derumier
0567a4d572 move memory config generation to QemuServer::Memory::config
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2016-05-23 10:04:31 +02:00
Alexandre Derumier
6779f1ac3c move qemu_memory_hotplug && qemu_dimm_list to QemuServer::Memory
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2016-05-23 10:03:40 +02:00
Alexandre Derumier
3f669af25d move foreach_dimm && foreach_reverse_dimm to QemuServer::Memory
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2016-05-23 10:02:29 +02:00
Dietmar Maurer
faab53066c hostpci docs: move notes into verbose_description 2016-05-20 11:59:30 +02:00
Dietmar Maurer
fad17f04fc add full path reference to datacenter.conf file 2016-05-19 16:27:30 +02:00
Dietmar Maurer
522619458c improve documentation 2016-05-19 13:13:25 +02:00
Dominik Csapak
9f41a659a1 allow VLAN 1 tag in qemu-kvm vms
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2016-05-18 11:25:29 +02:00
Fabian Grünbichler
19333c9b82 add --description to systemd scope unit
otherwise, long kvm commands lead to systemd unit files with
very long lines, with confuses the systemd unit file parser.

apparently systemd has a length limit for unit file lines and
(line-)breaks the description string at that point. since
the rest of the description is probably not a valid key/value
pair, this leads to warnings. the default semantics of systemd-run
is to use the executed command as description unless a description
is specified explicitly.

note that this behaviour of systemd could allow an attacker
with access to the VM configuration to craft a kvm commandline
that starts or stops arbitrary systemd units.
2016-05-14 09:02:58 +02:00
Dietmar Maurer
30983c3bac remove unneeded keyAlias option 2016-05-11 13:04:59 +02:00
Dietmar Maurer
7f694a7113 fix #975, use new keyAlias feature.
Also remove unneccessary format_descriptions for boolean and enums.
2016-05-11 10:11:49 +02:00
Dominik Csapak
e7a5104daa add warning for iothread with invalid scsi controller
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2016-05-04 11:11:32 +02:00
Dietmar Maurer
8930da746f correctly set cpu vendor 2016-05-01 09:24:25 +02:00
Wolfgang Bumiller
3c525055dd restore: pass format to vma extract
This silences the "probing guessed raw" warnings of
'qmrestore'.
2016-04-29 09:02:34 +02:00
Alexandre Derumier
2b401189e3 vm_start : force systemctl stop if orphan scope exist
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2016-04-22 11:09:09 +02:00
Dominik Csapak
ffa42b860d fix #947: reenable disk/cdrom passthrough
previously, we did not check the file parameter of a disk,
allowing passthrough of a block device (by design)

with the change to the json parser for the disks, the format
became 'pve-volume-id' which is only valid for our volume ids
(and later we also allowed the value 'none')

this patch alternatively checks if the parameter is a path
or 'cdrom'

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2016-04-21 11:54:55 +02:00
Fabian Grünbichler
c7a8aad601 docs: cleanup 2016-04-15 16:37:41 +02:00
Wolfgang Bumiller
2e953867ad Fix #848: deactivate old volume after clone before deletion
Otherwise some move operations will fail to delete the old
disk (eg. when moving from ceph to local storage).

Note that in order for the deactivation to succeed we need
to make sure qemu has closed its file descriptors, so we
need to wait for the job to disappear the same way we do in
$cancel_job().
Factored the waiting out into $finish_job().
2016-04-13 08:24:13 +02:00
Wolfgang Bumiller
ec3582b52a property string update: watchdog 2016-04-01 09:31:40 +02:00
Wolfgang Bumiller
1f4f447b58 property string update: hostpci*
This commit changes the listing of virtual functions from
multiple host= entries to one semicolon-separated host list.
2016-04-01 09:31:25 +02:00
Wolfgang Bumiller
cd9c34d186 property string update: net*
This requires the new 'group' schema mechanism.
2016-04-01 09:31:06 +02:00
Wolfgang Bumiller
ffc0d8c793 property string update: numa*
Additionally since the cpu and host node list isn't
restricted to a single range one can now provide multipel
ranges separated by semicolons. (eg. cpus=0-3;5;7)
2016-04-01 09:30:45 +02:00
Wolfgang Bumiller
822c8a0776 drive schema: allow 'none' again 2016-04-01 09:30:01 +02:00
Wolfgang Bumiller
bb9207e0e1 cputype: format_description to avoid huge enum in manpage 2016-04-01 09:27:35 +02:00
Wolfgang Bumiller
ff6ffe20c9 cleanup: naming consistency 2016-04-01 09:27:12 +02:00
Wolfgang Bumiller
93c0971cec fix a few property string descriptions 2016-04-01 09:26:51 +02:00
Fabian Grünbichler
20519efc76 use PVE::Storage::config(), not cfs_read_file() 2016-03-30 10:37:22 +02:00
Dietmar Maurer
8a61e0fd38 use asciidoc compatible markup
s/Note:/NOTE:/
2016-03-23 10:22:17 +01:00
Wolfgang Bumiller
ba8fc5d13e limit serial and model and document their real limits
The urlencoded format currently cannot check the real
decoded length, so we limit to an upper bound and document
the real limits. Ideally we'd introduce a decodedLength
schema parameter at some point...
2016-03-21 11:19:55 +01:00
Wolfgang Bumiller
988e2714ad clone: use the zeroinit filter for sparseinit storages 2016-03-21 09:59:49 +01:00
Wolfgang Bumiller
46630a5fd4 cfg: use the 'urlencoded' format for drive model and serial 2016-03-21 09:01:15 +01:00
Wolfgang Bumiller
918d09150e clanup: qemu_drive_options is only used inside the one function
and it doesn't contain 'bootindex'
2016-03-21 09:00:47 +01:00
Thomas Lamprecht
1917695c93 Fix some typos in JSON schema descriptions
/cirrur/cirrus/
/devive/device/
/Numa/NUMA/
and a few grammar fixes, rewrites of sentences

Also if already touching those lines lets break them up from one
liners to a column limit of ~80.
2016-03-16 16:46:08 +01:00
Fabian Grünbichler
e79706d47a Use has_lock to check for specific lock 2016-03-14 09:03:28 +01:00
Wolfgang Bumiller
4f4fbeb048 fix #909: pass rate to tap_plug()
When using OVS tap_plug() resets rate limiting so we need
to pass it along to reapply it.

The rate on its own can still be hot-plugged with the
regular tap_rate_limit() call.
2016-03-08 15:52:31 +01:00
Fabian Grünbichler
8793d4950e Refactor add_unused_volume
Drop add_unused_volume from PVE::QemuServer in favor of
(identical) implementation in PVE::AbstractConfig
2016-03-08 11:42:51 +01:00
Fabian Grünbichler
b2c9558da8 Rework snapshot code, has_feature
Drop snapshot_create, snapshot_delete and snapshot_rollback
in favour of PVE::AbstractConfig. Qemu-specific parts are
implemented in __snapshot_XX methods in PVE::QemuConfig.

has_feature is made an implementation of the abstract
has_feature, and thus moves to PVE::QemuConfig.

Note: a new hook method needed to be introduced to be called
before creating a volume snapshot, after creating a volume
snapshot, and after unfreezing the guestfs after creating a
volume snapshot. The base method in PVE::AbstractConfig is a
noop, the implemention in PVE::QemuConfig runs the necessary
Qemu monitor commands.
2016-03-08 11:42:37 +01:00
Fabian Grünbichler
ffda963f46 Refactor basic config-related methods
Drop load_config, write_config, lock_config[_xx],
check_lock, check_protection, is_template and config_file
in favour of implementions in PVE::AbstractConfig.

Implement guest_type, __config_max_unused_disks,
config_file_lock and cfs_config_path from
PVE::AbstractConfig in PVE::QemuConfig.
2016-03-08 11:41:59 +01:00
Fabian Grünbichler
74479ee9bb Make foreach_drive order deterministic
Previously, foreach_drive iterated over all configuration
keys (in a random order) and checked whether the current key
is a valid drive name. Instead, we now iterate over a list
of valid drive names (with deterministic order) and check
whether a drive with such a name exists in the
configuration.

Also rename the two involved methods from valid_drive_name
to is_valid_drive_name (for the check) and from disknames
to valid_drive_names (for the list of valid keys), for
consistency. These two were only used in the qemu-server
code base.
2016-03-04 06:25:48 +01:00
Fabian Grünbichler
521c52e09c Remove dead code
This sub is not used anywhere.
2016-03-01 09:31:09 +01:00
Fabian Grünbichler
ff9922861a Don't apply snapshot config in snapshot_commit
We hold a lock from snapshot_prepare until snapshot_commit,
so there is no need to copy back the snapshot config to the
actual config. This allows to drop a workaround for not
copying the 'machine' type config option.
2016-03-01 08:37:05 +01:00
Wolfgang Bumiller
69bcf246bd indentation cleanup 2016-02-27 10:20:19 +01:00
Wolfgang Bumiller
6ada5d61c2 only perform scsi inquiry on device nodes
We don't have any storage types other than LVM which react
to scsi inquiry, and we don't want to treat LVM as a scsi
device, so now we only query devices added as actual /dev
path. This was originally intended to be a pass-through
feature anyway, so this makes sense.
2016-02-27 10:20:01 +01:00
Fabian Grünbichler
b2ca930a79 Refactor has_feature
backup_only is currently not used as snapshot backups are
handled by qemu, but this makes the signatures identical
to LXC.pm's has_feature.
2016-02-26 10:34:21 +01:00
Fabian Grünbichler
afa5eae56a Make snapshot_save_vmstate proper sub 2016-02-26 10:33:43 +01:00
Thomas Lamprecht
09b1142906 kvm_user_version: update code to use our framework
Replace backticks with run_command and also do not use
`kvm -help` which produces a lot of unecessary output, lets use
`kvm -version` instead.
2016-02-26 07:54:35 +01:00
Thomas Lamprecht
74cc511fda fix undefined value when starting a q35 machine VM
As there the signleton function "kvm_user_version" may not have been
called and with the machine alias q35 the regex from the
qemu_machine_feature_enabled method does not match and thus we
need a valid kvm version here
2016-02-26 07:48:35 +01:00
Fabian Grünbichler
2d3caa008c Refactor snapshot_create to match LXC.pm 2016-02-25 09:23:02 +01:00
Dominik Csapak
88240a83fb change check for write-zeros
instead of hardcoding the storagetypes for writing zeros on a
backup restore, we use volume_has_feature with 'sparseinit'
for determining if we can omit writing zeros

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2016-02-24 17:18:50 +01:00
Alexandre Derumier
d1363934b8 qemu_machine_pxe : return $machine if no pxe
Currently migration is broken, because qemu_machine_pxe return nothing if no pxe rom exist.

That mean that we don't pass -machine flag to migration, and migration is broken between qemu 2.4->2.5

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2016-02-22 17:33:27 +01:00
Fabian Grünbichler
ec61e9383f Make snapshot_prepare and snapshot_commit proper subs 2016-02-22 16:19:16 +01:00