Commit Graph

662 Commits

Author SHA1 Message Date
Wolfgang Bumiller
3b4cf0f0fc cleanup: whitespaces & style 2017-01-05 10:03:10 +01:00
Alexandre Derumier
5619e74aed live clone_vm : suspend or freezefs before block-job-cancel
if qga is enabled, we try to freeze the fs before cancelling block job.
if not , we pause the vm.

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2017-01-05 09:09:46 +01:00
Alexandre Derumier
35e4ab0498 add socat and unix socket for storage migration
This is a workaround for nbd infinite timeout connect

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2017-01-05 09:09:46 +01:00
Alexandre Derumier
63a0937008 add qm nbdstop
we use it to stop remote nbd server

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2017-01-05 09:09:46 +01:00
Alexandre Derumier
2189246c5c add targetstorage to vm_start
This will create a new drive for each local drive found,
and start the vm with this new drives.

if targetstorage == 1, we use same sid than original vm disk

a nbd server is started in qemu and expose local volumes to network port

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2017-01-05 09:09:46 +01:00
Alexandre Derumier
5a34596743 qemu_drive_mirror : handle multiple jobs
we can use multiple drive_mirror in parralel.

block-job-complete can be skipped, if we want to add more mirror job later.

also add support for nbd uri to qemu_drive_mirror

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2017-01-05 09:09:46 +01:00
Fabian Grünbichler
31b522478d destroy_vm: allow vdisk_free to fail
otherwise we end up with undeletable VM configs in case
vdisk_free fails (which could happen because of cluster-wide
lock contention, storage problems, ..).

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2016-12-22 12:40:09 +01:00
Dietmar Maurer
b017fbda29 avoid "No balloon device has been activated" warnings in vmstatus 2016-12-20 10:11:56 +01:00
Thomas Lamprecht
b7a5a2251b allow insecure migrations from older qemu-servers
When trying to migrate a VM from a node with qemu server <= 4.0-92 to
a node with qemu server >= 4.0-93 we failed as the remote qemu-server
got no explicit migration_type' from the older qemu server on the
source.

Check if migration_type is defined on a incoming migration start, if
not set it.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2016-12-02 18:48:49 +01:00
Emmanuel Kasper
0cb9971ec2 Add entry for windows 10 and 2016 support
All special flags for Windows 8 and Windows 2012 (win8 type)
are kept the same , since we set flags based on checking  if
/^win(\d+)$/ is greater than 6 or 7
2016-11-29 09:08:42 +01:00
Alexandre Derumier
1ef7592f1e qemu_volume_snapshot_delete : fix krbd snapshot delete
like for snapshot, we need to check if krbd is enabled, to known
if we need to use qmp delete-drive-snapshot or storage command directly

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2016-11-17 09:46:16 +01:00
Alexandre Derumier
ac08761682 qxlnum: use $winversion
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2016-11-11 09:54:39 +01:00
Alexandre Derumier
5aba3953bd hv_vendor_id : for winversion >= 6 , not >=7.
as It was previously.

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2016-11-11 09:54:28 +01:00
Alexandre Derumier
4317f69fc5 cleanup windows version handling and hyperv enlightments
This cleanup windows guest os version handling,
with normalizing ostype with numbers in a new windows_version sub.

if($ostype eq 'wxp' || $ostype eq 'w2k3' || $ostype eq 'w2k') {
      $winversion = 5;
} elsif($ostype eq 'w2k8' || $ostype eq 'wvista') {
      $winversion = 6;
} elsif ($ostype =~ m/^win(\d+)$/) {
      $winversion = $1;
}

so we can simply do test on windows version with lower or upper version

Hyperv enlightments configuration is centralized
in a new add_hyperv_enlighments sub.

Also disable hyperv with win < 8 + ovmf.

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2016-11-11 06:06:28 +01:00
Dietmar Maurer
36e54bd7f1 remove format_description from $met_fmt->{model} 2016-11-05 16:28:59 +01:00
Dietmar Maurer
8485b9ba68 remove unnecessary format_description from cputype 2016-11-05 15:56:12 +01:00
Dietmar Maurer
c7d2b65040 register new standard option 'pve-qm-image-format' 2016-11-03 13:21:53 +01:00
Dietmar Maurer
d3f3f1b348 fix add_throttle_desc - pass correct units 2016-11-03 12:48:24 +01:00
Wolfgang Bumiller
9196a8ec62 Close #1195: support iops/bps_max_length throttling options 2016-11-03 10:24:12 +01:00
Wolfgang Bumiller
6ecfbb4400 fix a warning: discard is not a number 2016-11-03 09:55:59 +01:00
Thomas Lamprecht
2de2d6f74e allow dedicated migration network, bug #1177
Without this patch we use the network were the cluster traffic runs
for sending migration traffic. This is not ideal as it may hinder
cluster traffic. Further some users have a powerful network which
would be perfect for migrations, with this patch they can run the
migration traffic over such a network without having the corosync
traffic on the same network.

The network is configurable through /etc/pve/datacenter.cfg which
got a new property, namely migration. migration has two
subproperties: type (replaces the old migration_unsecure property)
and network.

For the case of a network failure or that a VM has to be moved over
another network for arbitrary other reasons I added the
migration_type and migration_network parameters to qm migrate (and
respectively vm_start as this gets used on migration).
They allow overwriting the datacenter.cfg settings.

Fixes bug #1177

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2016-11-03 09:51:23 +01:00
Dietmar Maurer
613d76a179 change default value for cpuunits to 1024
Use the same default as containers.
2016-10-27 07:23:32 +02:00
Wolfgang Bumiller
b799312f2f Fix #1174: remove pve-qm-drive
Let 'cdrom' use the pve-qm-ide format, as it's supposed to
be an alias to ide2.
We're not using the 'alias' schema property since the qemu
configs still use a custom parser (due to the
pending-changes system and the filename-to-volume-id
conversion for legacy support) which does not deal with
schema aliases.
2016-10-18 11:45:41 +02:00
Wolfgang Bumiller
961af8a3c5 improve error messages 2016-10-17 14:49:05 +02:00
Alexandre Derumier
2e5416790f enable drive-mirror with iothread for qemu 2.7 v2
changelog : check running qemu binary version

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2016-10-17 14:34:56 +02:00
Alexandre Derumier
98cfd8b641 add get_running_qemu_version
return current running qemu process version

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2016-10-17 12:52:56 +02:00
Alexandre Derumier
eba3e64d2e cpu hotplug : add new cpu hotplug method for qemu 2.7
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2016-10-17 12:51:12 +02:00
Alexandre Derumier
1e881b75d8 cpu hotplug : add cpu hot-unplug support
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2016-10-17 12:51:12 +02:00
Alexandre Derumier
69c81430e0 cpu hotplug : add coldplugged cpu to qemu command line
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2016-10-17 12:51:12 +02:00
Alexandre Derumier
0efb537eb7 cpu hotplug : add print_cpu_device
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2016-10-17 12:51:12 +02:00
Wolfgang Link
5930c1ff6b fix #1111: qm showcmd wrong escape sequence 2016-10-04 08:38:09 +02:00
Wolfgang Link
4a5cf64a80 Avoid to parse empty property string.
Check if string exists before you try to parse it. Remove unnecessary
eval.
2016-10-04 08:35:52 +02:00
Fabian Grünbichler
6b72854b95 restore: better error handling for vdisk deletion
when restoring into an existing VM, we don't want to die
half-way through because we can't delete one of the existing
volumes. instead, warn about the deletion failure, but
continue anyway. the not deleted disk is then added as
unused automatically.
2016-09-15 14:16:12 +02:00
Dominik Csapak
dbea44152e add seabios bootsplash and use it
this adds a bootsplash image in /usr/share/qemu-server
and if this file exists, use it for seabios

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2016-09-08 12:22:01 +02:00
Dominik Csapak
2ddc0a5c75 use efidisk0 for efivars
if efidisk0 is defined, use it as a efivars disk,
to permanently store efivars (such as boot options)

we check if the files exist, and act accordingly

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2016-09-08 11:31:28 +02:00
Dominik Csapak
6470743ff9 add efidisk0 to config
just a simple disk (only size, format and volid) for
efivars disk

also do not add it to command line in foreach_drive

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2016-09-08 11:10:52 +02:00
Wolfgang Bumiller
a3139f90dc hostpci: bring back multifunction pass-through shortcut 2016-08-29 10:08:00 +02:00
Alexandre Derumier
2af848a2da disable drive-mirror when iothread is enabled
drive-mirror is not working with qemu 2.6 when iothread is enabled.

with virtio-blk : mirror is working, but block-job-completed crash the vm
with virtio-scsi : mirror hang at start.

This should be fixed in qemu 2.7

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2016-08-23 09:28:54 +02:00
Alexandre Derumier
eed2430325 qemu-img convert : use default cache=unsafe instead writeback
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2016-08-01 10:40:03 +02:00
Wolfgang Bumiller
ec647db4f8 Fix #1057: make protection a fast-plug option
Otherwise you need to shutdown a VM to disable protection,
which is inconvenient for a few tasks such as for instance
deleting an unused disk.
2016-07-26 14:47:30 +02:00
Fabian Grünbichler
3999f370b1 only activate the newly created volume
instead of the whole list.
2016-07-14 12:31:36 +02:00
Wolfgang Bumiller
b5b9979081 pass datacenter.cfg's mac_prefix to random_ether_addr 2016-07-14 09:02:24 +02:00
Dominik Csapak
f745762b2e disable usb hotplug for now
we have a few problems with hotplug at the moment:
qemu may add usb hubs when adding usb devices but fails to remove them
when removing the usb device (this is a qemu bug)

also when starting a guest with a usb device we add ehci and uchi
controllers, which we cannot hot unplug

with those devices, it is impossible to live migrate the guest
to another host, meaning even if you remove all usb devices,
the migrate fails

so we deactivate usb hotplugging for now

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2016-07-05 09:23:57 +02:00
Dominik Csapak
4eb6860435 implement usb hotplug
this patch introduces working usb hotplugging

you can now add a usb device while a vm is running

this does not work with spice at the moment, only
with usb passthrough

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2016-06-22 09:13:16 +02:00
Dominik Csapak
16521d6353 add qemu_usb_hotplug
this adds a function for hotplugging usb devices

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2016-06-22 09:13:16 +02:00
Dominik Csapak
deb091c500 get usbdevices in vm_devices_list
since usb devices do not have their own
"query" command in qmp, we have to use
qom-list /machines/peripheral

which essentially gets a list of peripheral devices of
the vm

there we only get the usb devices

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2016-06-22 09:13:16 +02:00
Dominik Csapak
d40e5e1852 use the refactored usb functions
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2016-06-22 09:13:16 +02:00
Dominik Csapak
de9768f002 refactor PCI into own file
to reduce QemuServer.pm size
also move the $device hash out of any function

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2016-06-22 09:13:16 +02:00
Alexandre Derumier
7023f3ea16 add hugepages option
vm configuration
----------------
hugepages: (any|2|1024)

any: we'll try to allocate 1GB hugepage if possible, if not we use 2MB hugepage
2: we want to use 2MB hugepage
1024: we want to use 1GB hugepage. (memory need to be multiple of 1GB in this case)

optionnal host configuration for 1GB hugepages
----------------------------------------------
1GB hugepages can be allocated at boot if user want it.
hugepages need to be contiguous, so sometime it's not possible to reserve them on the fly

/etc/default/grub : GRUB_CMDLINE_LINUX_DEFAULT="quiet hugepagesz=1G hugepages=x"

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
Acked-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2016-06-22 09:11:11 +02:00
Fabian Grünbichler
b74ff0476e add @param to foreach_drive 2016-06-17 16:20:57 +02:00