Commit Graph

712 Commits

Author SHA1 Message Date
Wolfgang Link
b6adff3385 fix perl scope issues
Add parameter array to foreach_volid to use is in the functions.
correct typos.
2016-06-16 11:26:37 +02:00
Wolfgang Bumiller
387ba25792 split old style pipe open call 2016-06-09 18:12:26 +02:00
Alexandre Derumier
7a131888d7 add hyperv enlightments : hv_reset, hv_vpindex, hv_runtime
add them by default for qemu 2.6
(support is already present in qemu 2.5, but we don't want to break live migration for current running vm)

vpindex && runtime need host kernel 4.4

Theses 3 enlightements are needed by windows to use vmbus
http://searchwindowsserver.techtarget.com/definition/Microsoft-Virtual-Machine-Bus-VMBus

details :

- When Hyper-V "vpindex" is on, guest can use MSR HV_X64_MSR_VP_INDEX
to get virtual processor ID.

- Hyper-V "runtime" enlightement feature allows to use MSR
HV_X64_MSR_VP_RUNTIME to get the time the virtual processor consumes
running guest code, as well as the time the hypervisor spends running
code on behalf of that guest.

- Hyper-V "reset" allows guest to reset VM.

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2016-06-07 10:08:25 +02:00
Thomas Lamprecht
54323eed5f migrate: unlink unix socket before starting migration
Just to be sure nobody else has (wrongfully) left that file here.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2016-06-03 16:02:25 +02:00
Thomas Lamprecht
1c9d54bfd0 migrate: use ssh forwarded UNIX socket tunnel
We cannot guarantee when the SSH forward Tunnel really becomes
ready. The check with the mtunnel API call did not help for this
prolem as it only checked that the SSH connection itself works and
that the destination node has quorum but the forwarded tunnel itself
was not checked.

The Forward tunnel is a different channel in the SSH connection,
independent of the SSH `qm mtunnel` channel, so only if that works
it does not guarantees that our migration tunnel is up and ready.

When the node(s) where under load, or when we did parallel
migrations (migrateall), the migrate command was often started
before a tunnel was open and ready to receive data. This led to
a direct abortion of the migration and is the main cause in why
parallel migrations often leave two thirds or more VMs on the
source node.
The issue was tracked down to SSH after debugging the QEMU
process and enabling debug logging showed that the tunnel became
often to late available and ready, or not at all.

Fixing the TCP forward tunnel is quirky and not straight ahead, the
only way SSH gives as a possibility is to use -N (no command)
-f (background) and -o "ExitOnForwardFailure=yes", then it would
wait in the foreground until the tunnel is ready and only then
background itself. This is not quite the nicest way for our special
use case and our code base.
Waiting for the local port to become open and ready (through
/proc/net/tcp[6]] as a proof of concept is not enough, even if the
port is in the listening state and should theoretically accept
connections this still failed often as the tunnel was not yet fully
ready.

Further another problem would still be open if we tried to patch the
SSH Forward method we currently use - which we solve for free with
the approach of this patch - namely the problem that the method
to get an available port (next_migration_port) has a serious race
condition which could lead to multiple use of the same port on a
parallel migration (I observed this on my many test, seldom but if
it happens its really bad).

So lets now use UNIX sockets, which ssh supports since version 5.7.
The end points are UNIX socket bound to the VMID - thus no port so
no race and also no limitation of available ports (we reserved 50 for
migration).

The endpoints get created in /run/qemu-server/VMID.migrate and as
KVM/QEMU in current versions is able to use UNIX socket just as well
as TCP we have not to change much on the interaction with QEMU.
QEMU is started with the migrate_incoming url at the local
destination endpoint and creates the socket file, we then create
a listening socket on the source side and connect over SSH to the
destination.
Now the migration can be started by issuing the migrate qmp command
with an updated uri.

This breaks live migration from new to old, but *not* from old to
new, so there is a upgrade path.
If a live migration from new to old must be made (for whatever
reason), use the unsecure_migration setting (man datacenter.conf)
to allow this, although that should only be done in trusted network.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2016-06-03 11:51:46 +02:00
Wolfgang Bumiller
8e59d952be use enter_systemd_scope instead of systemd-run
With systemd-run qemu's --daemonize forks often happen
before systemd finishes setting up the scopes, which means
the limits we apply often don't work.
We now use enter_systemd_scope() to create the scope before
running qemu directly without systemd-run.

Note that vm_start() runs in a forked-worker or qm cli
command, so entering the scope in such a process should not
affect the rest of the pve daemon.
2016-06-03 11:41:31 +02:00
Dominik Csapak
596a0a2056 do not ignore hotplug parse errors
if we got an option which was not valid, we still
wrote it to the config, and subsequently returned
it on every api call

instead, now we die instead of warn and do not accept
invalid options

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2016-05-31 12:15:32 +02:00
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
Dominik Csapak
77cde36b4e deactivate volumes if vm start command fails
also for current master
cleanup of patch from Dhaussy Alexandre from 02/15/2016

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2016-02-20 10:26:05 +01:00
Dietmar Maurer
b42d3cf9d4 rename $ost to $ostype 2016-02-18 12:54:47 +01:00
Alexandre Derumier
b7be4ba92f disable vnc server and add -nographic is no vga card is present
For passthrough, we need to be sure that card is primary,
so we need to disable vnc server

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2016-02-18 12:54:47 +01:00
Alexandre Derumier
bd92244c35 passthrough : reenable hyperv and add hv_vendor_id for windows
qemu 2.5 support a new hyper-v feature: hv_vendor_id
This allow nvidia drivers to install on windows with hyper-v feature on.

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2016-02-18 12:54:47 +01:00
Dominik Csapak
381b8fae81 delete ram state files when restoring a backup
currently we leave orphaned vmstate files when we restore a
backup over a vm, which has snapshots with saved ram state.

this patch deletes those files on a restore.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2016-02-18 11:53:46 +01:00
Fabian Grünbichler
7efedbf397 Refactor snapshot code
Split vmstate saving into its own sub in preparation of
LXC/QemuServer codebase refactoring.
2016-02-15 13:26:28 +01:00
Wolfgang Link
4dcc780c2a If we freeze the fs with the Qemu-Guest-Agent test if QGA is running. 2016-02-15 12:50:14 +01:00
Fabian Grünbichler
8317c759bf Drop skiplock from write_config
Since write_config was always called with skiplock=1 except
once, it makes sense to drop this parameter like in
PVE::LXC::write_config . If needed in the future, the
caller can use check_lock before write_config anyway.
2016-02-12 12:16:57 +01:00
Fabian Grünbichler
63be43a947 Refactor update_config_nolock -> write_config
The method update_config wrapped update_config_nolock
using lock_config, but to prevent update races the whole
"read config", "do something", "write config" flow was
always protected by lock_config anyway, and update_config
was never called.

Thus, we can safely drop update_config and rename
update_config_nolock to write_config like in PVE::LXC .
2016-02-12 12:14:52 +01:00
Dominik Csapak
a6b9aee42a use better usb config parsing
since we want the usb3 option to be really boolean and not only
'usb3=yes', we have to change the usb json format a little

to not break existing configs for 'usbX: spice', we set the 'host'
option as non-optional and default_key and allow 'spice' as its
content (this also makes the option less ambiguous)

another side effect is that previously accepted multiple 'host='
entries are now forbidden

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2016-02-11 16:42:24 +01:00
Wolfgang Bumiller
c0f7406e93 remove a superfluous condition
This is only reached if the $line from which $virtdev
originates matches, and the part in $virtdev can never be
false then.
2016-02-10 17:46:54 +01:00
Wolfgang Bumiller
d9faf79016 restore: deal with new backup=0 property string 2016-02-10 17:45:56 +01:00
Dominik Csapak
da8b4189d8 add usb3 option for usb-devices
adding a flag for usb devices (usb3), if this is set to yes,
add a xhci controller and attach the specified devices to it

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2016-02-10 17:33:26 +01:00
Wolfgang Bumiller
15cc878469 pass $skiplock all the way through to destroy_vm
The API passes $skiplock to vm_destroy() which performed a
check conditionally depending on the $skiplock parameter and
then simply calls destroy_vm() inside lock_config() which
did yet another check_lock() without any way to avoid that.

Added the $skiplock parameter to destroy_vm() and removed
the conditional check in vm_destroy() as both happened after
locking the config.
2016-02-08 11:52:23 +01:00
Alexandre Derumier
f7b4356fe6 disk hotplug : allow hotplug of physical host /dev/ disks
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2016-02-04 18:09:38 +01:00
Wolfgang Bumiller
7d4e30f389 detect_zeroes is a boolean 2016-01-29 12:21:59 +01:00
Wolfgang Bumiller
47c28a687c Fix #878: disk-size format
disk-size is a format, not a type
2016-01-29 10:04:05 +01:00
Wolfgang Link
3457d090c6 Create firewall dir on VM restore 2016-01-28 11:02:55 +01:00
Wolfgang Bumiller
16a91d65f3 add hidden option to cpu type
This passes kvm=off to qemu's -cpu switch to disable KVM
identification via the cpuid instruction.
2016-01-26 16:57:13 +01:00
Wolfgang Link
5b61bff247 Use format raw if a disk is passthrough to VM.
To prevent error at VM starting, when we passthrough a harddrive from host to vm.
2016-01-25 17:32:21 +01:00
Wolfgang Bumiller
16d08ecfc3 use safe_string_ne for trunks
It's a list of numbers, not just one.
2016-01-18 11:00:28 +01:00
Alexandre Derumier
c30aea2b10 add support for network trunks
This add support for net trunks vlan filtering
for ovs and linux vlan-aware bridge

Can be mixed with current "tag" option

examples:
----------

allow only 802.1Q packets with vlanid 2,3,4 :

netx: .....,trunks=2,3,4

allow only 802.1Q packets with vlanid 2,3,4 and tag non-802.1Q packets to vlanid 5 :

netx: tag=5,trunks=2,3,4

tag non-802.1Q packets to vlanid 5

netx: tag=5
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2016-01-15 17:23:59 +01:00
Wolfgang Bumiller
0541eeb88b use property strings for drive options 2016-01-14 16:40:37 +01:00
Wolfgang Bumiller
bd27e851d3 use property string for smbios1 2016-01-14 16:36:23 +01:00
Wolfgang Bumiller
ff0394e04c Closes #787: add Haswell-noTSX and Broadwell-noTSX cpu types 2016-01-13 16:41:28 +01:00
Wolfgang Bumiller
277ca170b4 io throttle: pass pool parameters (*_max)
These have been passed but haven't been used.
2016-01-13 06:17:01 +01:00
Alexandre Derumier
230a438200 ovmf : don't pass x-vga to vfio-pci
x-vga vfio-pci flag is to enable seabios quirks only.

This patch keep using x-vga=on from proxmox config, to disable hyperv,kvm=off,vga=none by default
but don't pass x-vga to vfio-pci when ovmf is enabled.

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2016-01-10 15:10:26 +01:00
Alexandre Derumier
2315b39c8a disable hyper-v enlightment when xvga is enabled
Geforce drivers (> 344.11) crash with code43 error if they detect hyper-v enlighment with pci passtthrough
http://awilliam.github.io/presentations/KVM-Forum-2014/#/5/3

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2016-01-04 06:26:02 +01:00
Wolfgang Bumiller
6e47c3b4b7 add detect_zeroes option
On some storages BLKZEROOUT commands do not work properly
and return without error while having no effect whatsoever.
This can produce various filesystem errors and thus needs
to be made optional.

A drive can now have 'detect_zeroes=off' to disable this
behavior. By default the behavior is the same as before:
always-on (and set to 'unmap' if discard is enabled).
2015-12-18 09:19:18 +01:00
Wolfgang Bumiller
77019edfe0 fix bug #841: replace get_used_paths with is_volume_in_use
get_used_paths returned a hash of used paths for all the
volumes in a VM's config, which is not enough to figure out
whether there are snapshots, as snapshots often have
different paths.  Eg. on ZFS it is not enough to check for
/dev/zvol/tank/vm-123-disk-1 because the snapshot's path is
/dev/zvol/tank/vm-123-disk-1@snap1 and thus we allowed
deleting the drive. Then when trying to delete the snapshot
later you get:
  zfs error: cannot open 'tank/vm-751-disk-1': dataset does not exist
and it refuses to delete the snapshot.

Since its only use was to check whether or not a drive is
still in use it is now renamed to is_volume_in_use and
beside checking paths now also checks volume-ids as those
should stay the same.
2015-12-10 12:13:12 +01:00
Dietmar Maurer
2bd70893fb always copy OVMF_VARS-pure-efi.fd file
To avoid the impression that we can store BIOS settings. They also
gets lost when we migrate the VM.
2015-12-10 11:11:02 +01:00
Dietmar Maurer
3edb45e749 introcude new 'bios' option (replace ovmf option) 2015-12-10 10:48:04 +01:00
Alexandre Derumier
a783c78e0d add ovmf uefi roms support V2
changelog:

use OVMF-pure-efi.fd instead OVMF_CODE-pure-efi.fd to have virtio drivers support

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2015-12-09 17:45:15 +01:00
Wolfgang Bumiller
1b2761c07c fix bug #828: activate disks before hotplugging them 2015-11-27 16:57:19 +01:00
Wolfgang Link
6738ab9c59 restore firewall config from backup 2015-11-26 11:50:00 +01:00
Alexandre Derumier
1f720e28c7 reenable steal time
we have fixed it in kernel last month
https://www.mail-archive.com/pve-devel@pve.proxmox.com/msg14072.html

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2015-11-26 09:18:08 +01:00
Dietmar Maurer
ea002a8f6d fix bug #783: set KillMode=none, so that systemd don't kill them at shutdown 2015-11-24 16:52:22 +01:00
Emmanuel Kasper
d44712fc43 Don't treat serial devices as a local resource if they point to a socket.
Close: https://bugzilla.proxmox.com/show_bug.cgi?id=470
2015-11-13 07:01:12 +01:00
Dietmar Maurer
6bb91c1797 qemu_img_convert: activate source volume
For example, this is required if we copy from lvmthin snapshots.
2015-11-12 11:16:50 +01:00
Wolfgang Link
c4c844ef8e improve complete_storage, only show storages which have the capability to run qemu images. 2015-11-10 07:46:27 +01:00
Alexandre Derumier
208ba94e96 add pve-bridge-hotplug script
use it for nic hotplug, because pve-bridge script will
not work after a live migration, because of the PVE_MIGRATED_FROM env var.

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2015-11-06 16:22:54 +01:00
Alexandre Derumier
8718099ce4 nic hotplug : use pxe roms for older machinetype
we want to avoid mix some nics with pxe rom and other with efi rom.

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2015-11-06 10:51:59 +01:00
Alexandre Derumier
249c4a6c75 add qemu_use_old_bios_files sub
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2015-11-06 10:51:48 +01:00
Alexandre Derumier
42dbd2ee30 add qemu_machine_pxe
return machinename with .pxe suffix if a nic with pxe romfile exist

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2015-11-06 10:51:14 +01:00
Alexandre Derumier
7bac824e19 use qom-get to check if pxe file are used V2
fix qemu 2.4 pxe -> qemu 2.4 efi

Changelog : forget to add a check on qom-get result

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2015-11-06 07:55:07 +01:00
Wolfgang Bumiller
407e0b8bef migration: improve ipv6 case
Qemu parses hostnames in brackets correctly but sets an ipv6
flag for them as if they were ipv6 addresses, only insert
brackets for ipv6 addresses.
2015-11-06 07:53:03 +01:00
Dietmar Maurer
67812f9c97 simplify code: consistently use old bios files for older machine types 2015-10-29 07:37:00 +01:00
Dietmar Maurer
ba9e10002f use old netdevice bios files for older machine types 2015-10-28 09:07:03 +01:00
Alexandre Derumier
289e0b8564 migrate : add nocheck for resume
Users have reported resume bug when HA is used.

They seem to have a little race (bench show >0s < 1s) between the vm conf file move on source node and replication to,
and resume on target node.

I don't known why this is only with HA, maybe this occur will standard migration too.

Anyway, we don't need to read the vm config file to resume the vm on target host,
as we are sure that the vm is migrated, and config file move action is correct in the cluster.

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2015-10-15 12:41:13 +02:00
Wolfgang Bumiller
0f2812c25a support serial numbers and models for disks
Note that the model is only supported for IDE harddisks via
the -device option, whereas the serial is part of the -drive
option.

Closes #153
2015-09-30 10:55:10 +02:00
Alexandre Derumier
ab7540f7e4 disable kvm_steal_time
It's currently buggy with live migration

https://bugs.launchpad.net/qemu/+bug/1494350
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2015-09-29 07:14:02 +02:00
Alexandre Derumier
b62532e4e8 migration: disable compress
it's already disable by default,
but we want to be sure if it's change in later release

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2015-09-25 17:58:44 +02:00
Alexandre Derumier
0b0a47e8ec enable xbzrle
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2015-09-25 17:58:40 +02:00
Dietmar Maurer
806873a198 fix kvm version parser for CVE stable releases, bump version to 4.0-25 2015-09-23 11:48:41 +02:00
Alexandre Derumier
6ea8cd3b52 pci passthough : make vfio default
and remove old legacy code.
(deprecated and disabled by default since kernel 4.2)

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2015-09-21 06:31:33 +02:00
Wolfgang Link
6965d5d1f8 fix error message: allocate to much v-CPUs. 2015-09-14 09:42:04 +02:00
Wolfgang Link
5f96f4df75 add possibility to restore backup on rbd in krbd mode 2015-09-09 07:47:42 +02:00
Wolfgang Link
116da78402 add krbd support to online snapshot 2015-09-09 07:22:20 +02:00
Dietmar Maurer
335af808a4 improve bash completion 2015-09-07 08:13:07 +02:00
Dietmar Maurer
65e866e5da implement a few bash completion helpers 2015-09-06 16:01:59 +02:00
Alen Grizonic
cb0e4540f7 VM protection mode added
used to prevent an unintended virtual machine remove operation

v3 changes:

- changed man page message
- removed protection parameter (where not needed)
2015-09-06 11:31:05 +02:00
Wolfgang Link
1dbd6d30e0 fix move_disk on RBD
activating the disk when use RBD is necessary to have the given path.
2015-09-06 11:05:51 +02:00
Dietmar Maurer
d853f40aef fix: start kvm with os type other
this check is necessary, because we do not set ostype in qemu config when type is other

Seem that x2apic is now enabled by default when kvm is used

since this commit
http://git.qemu.org/?p=qemu.git;a=commit;h=ef02ef5f4536dba090b12360a6c862ef0e57e3bc

So we just need to disable it for solaris
2015-08-28 11:10:44 +02:00
Wolfgang Link
40b977f328 fix bug #688: if vm is not owner of this disk remove from config 2015-08-20 12:28:50 +02:00
Wolfgang Bumiller
cee01bcbd7 merge delete_drive into try_deallocate_drive
It used to be private and is only used once.
2015-08-13 12:34:12 +02:00
Wolfgang Bumiller
3dc38fbb74 pending-delete: remember force-deletes
The -force flag didn't have any effect since the pending
changes didn't carry over the the flag.
Now forced deletes have an exclamation mark prepended to the
option name.
2015-08-13 11:08:45 +02:00
Dietmar Maurer
b0ec896e43 correctly handle empty description in pending section
So that we can delete descriptions with

 qm set <vmid> --descr ''
2015-08-11 11:24:41 +02:00
Alexandre Derumier
525814b230 add memory_unplug support V2
qemu 2.4 feature

changelog: rebase on last git

Note that currently linux guest don't support unplug of dimm when it'sused by kernel memory.
They are some tunning to do with memory zone movable.
http://events.linuxfoundation.org/sites/events/files/lcjp13_chen.pdf

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2015-07-29 10:16:28 +02:00
Thomas Lamprecht
38f7f26c44 fixed bug 662, wrong subroutine for parsing startup order
Changed from old, now missing, subroutine parse_startup() to new
pve_parse_startup_order() in qemu-server and pve-manager

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2015-07-22 12:44:30 +02:00
Alexandre Derumier
f1f7ea886a cpuflags : don't enforce with tcg mode
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2015-07-22 12:40:47 +02:00
Alexandre Derumier
dac7c6190c cpuflags : remove enforce for cpumodel=host
Currently enforce with cpumodel=host on amd cpus don't work,
because amd cpus have unsupported flags in qemu.

This is a protection, and this is good.

but cpumodel host should be never use by users for production (only for testing).
For production and stability, users need to choose a true cpu model which filter
the supported cpuflags by qemu.

So I think we can remove the enforce for host model as for testing it's ok.

warning: host doesn't support requested feature: CPUID.80000001H:EDX [bit 0]
warning: host doesn't support requested feature: CPUID.80000001H:EDX [bit 1]
warning: host doesn't support requested feature: CPUID.80000001H:EDX [bit 2]
warning: host doesn't support requested feature: CPUID.80000001H:EDX [bit 3]
warning: host doesn't support requested feature: CPUID.80000001H:EDX [bit 4]
warning: host doesn't support requested feature: CPUID.80000001H:EDX [bit 5]
warning: host doesn't support requested feature: CPUID.80000001H:EDX [bit 6]
warning: host doesn't support requested feature: CPUID.80000001H:EDX [bit 7]
warning: host doesn't support requested feature: CPUID.80000001H:EDX [bit 8]
warning: host doesn't support requested feature: CPUID.80000001H:EDX [bit 9]
warning: host doesn't support requested feature: CPUID.80000001H:EDX [bit 12]
warning: host doesn't support requested feature: CPUID.80000001H:EDX [bit 13]
warning: host doesn't support requested feature: CPUID.80000001H:EDX [bit 14]
warning: host doesn't support requested feature: CPUID.80000001H:EDX [bit 15]
warning: host doesn't support requested feature: CPUID.80000001H:EDX [bit 16]
warning: host doesn't support requested feature: CPUID.80000001H:EDX [bit 17]
warning: host doesn't support requested feature: CPUID.80000001H:EDX [bit 23]
warning: host doesn't support requested feature: CPUID.80000001H:EDX [bit 24]
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2015-07-22 12:40:20 +02:00
Alexandre Derumier
0dc48c3d5b cpuflags : remove -rdtscp for Opteron cpu models
rdtscp is not supported by qemu and with enforce it's not starting
warning: host doesn't support requested feature: CPUID.80000001H:EDX.rdtscp [bit 27]

from to qemu wiki
http://wiki.qemu.org/Features/CPUModels#Disabling_features_that_were_always_disabled_on_KVM
"Fact: currently libvirt runs CPU models having rdtscp without the "enforce" flag, and rdtscp is silently disabled
Consequence: libvirt SHOULD use something like "-cpu Opteron_G5,-rdtscp",
especially when it starts using (or emulating) enforce mode
This will require a solution on libvirt side. QEMU will just provide the mechanisms to report CPU model information
and check what the host and QEMU supports, but the decision to disable rdtscp to be able
to run Opteron_G[2345] needs to be taken by libvirt."

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2015-07-22 12:38:47 +02:00
Alexandre Derumier
22967505c4 qemu-server : drive-mirror : allow to interrupts at the scanning bitmap phase
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2015-07-01 06:39:50 +02:00
Alexandre Derumier
604ea64464 qemuserver : vm_status : add extended stats (disks, nics, memory) V3
Add extended stats results for each nics,disks and memory on full stats mode only.

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2015-06-16 13:23:24 +02:00
Dietmar Maurer
85bdc6afc0 remove outdated host_device format
Newer qemu does not need it.

https://lists.nongnu.org/archive/html/qemu-devel/2011-06/msg02790.html
2015-06-10 10:29:30 +02:00
Dietmar Maurer
d81f0f09fc parse_drive: do not overwrite configured format
Instead, we use qemu_img_format() to query the format when we need it.
We also pass the format to qemu in print_drive_full to avoid qemu warnings.
2015-06-10 10:22:42 +02:00
Wolfgang Bumiller
b2ee900e3c fix aio O_DIRECT check for cdrom drives
Only non-cdrom drives default to cache=none, so the check
for whether to default to aio=native needs to take the same
condition into account.
I combined them close together to make their relation more
visible.
2015-06-02 16:11:01 +02:00
Dietmar Maurer
c6f773b818 cpulimit: use number instead of integer 2015-06-02 16:03:25 +02:00
Alexandre Derumier
58be00f10a implement cpuunit with cgroups
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2015-06-02 15:56:52 +02:00
Dietmar Maurer
3a515a8805 code cleanup 2015-05-29 08:23:13 +02:00
Alexandre Derumier
ba02e591f0 remove old openvz fairscheduler code
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2015-05-29 08:11:07 +02:00
Alexandre Derumier
c8effec354 implement hotplug for cpuunits
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2015-05-29 08:11:04 +02:00
Alexandre Derumier
f08e17c7be implement cgroups through systemd-run
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2015-05-29 08:11:02 +02:00
Wolfgang Bumiller
fd1f36ac6f localhost instead of 127.0.0.1 makes ipv6 life easier 2015-05-27 08:25:38 +02:00
Wolfgang Bumiller
2fbd27eabc migration: put the source address in brackets
Always adding brackets around the address works. They're required for
ipv6 and qemu also accepts them for ipv4 and hostnames.
2015-05-21 17:30:30 +02:00
Wolfgang Bumiller
af0eba7e35 pass port family to next_*_port() calls 2015-05-12 12:28:56 +02:00
Alexandre Derumier
38e0c3b8ae qmp drive-mirror : set big timeout
drive-mirror is doing lseek on source image before starting, and this can take a lot of time for big nfs volume
during this time, qmp socket is hanging
http://lists.nongnu.org/archive/html/qemu-devel/2015-05/msg01838.html
so we need to setup a big timeout

qemu devs are currently working to fix this

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2015-05-12 08:18:42 +02:00
Alexandre Derumier
ad123d97f9 qemu-mirror : block job complete : use ready flag
Since qemu 2.2, a new "ready" flag has been added to blockjob
http://git.qemu.org/?p=qemu.git;a=commit;h=ef6dbf1e46ebd1d41ab669df5bba0bbdec6bd374
to known if we can complete it.

we can't use len==offset to known if all block are mirrored, because behaviour will change soon in qemu 2.3

http://git.qemu.org/?p=qemu.git;a=commit;h=b21c76529d55bf7bb02ac736b312f5f8bf033ea2
"block/mirror: Improve progress report

Instead of taking the total length of the block device as the block
job's length, use the number of dirty sectors. The progress is now the
number of sectors mirrored to the target block device. Note that this
may result in the job's length increasing during operation, which is
however in fact desirable.
"

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2015-05-12 08:18:30 +02:00
Wolfgang Link
e5eaa02815 remove running from Storage and check it in QemuServer
It is better to check if a VM is running in QemuServer then in Storage.
for the Storage there is no difference if it is running or not.

Signed-off-by: Wolfgang Link <w.link@proxmox.com>
2015-05-06 11:47:11 +02:00
Dietmar Maurer
43574f738d use new standard option 'pve-startup-order' 2015-04-22 10:02:33 +02:00
Alexandre Derumier
6e11f14318 implement virtio-scsi multiqueues
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2015-04-04 10:03:38 +02:00
Alexandre Derumier
3f548708d3 use aio=native only with O_DIRECT (cache=none|directsync)
Currently qemu auto fallback to aio=threads if cache=none|directsync
It's better to handle that correctly

see:
https://bugzilla.redhat.com/show_bug.cgi?id=1086704

http://wiki.qemu.org/ChangeLog/2.3
Future incompatible changes:
Block device parameter aio=native has no effect without cache.direct=on. It will be made an error.

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2015-04-04 09:57:53 +02:00
Alexandre Derumier
8bcf3068eb forbid hot-unplug of virtioscsi + iothread drive
qemu (<=2.3) currently segfault on drive_del

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2015-04-01 06:16:16 +02:00