Commit Graph

486 Commits

Author SHA1 Message Date
Thomas Lamprecht
69f2907c79 fixup: renamed conf_table_with_pending to config_with_pending_array
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-10-18 21:00:27 +02:00
Oguz Bektas
59ef70033c api: use guesthelper method for vm_pending path
we can use the shared conf_table_with_pending guesthelper to produce the
config table with the extra delete and pending columns.

Signed-off-by: Oguz Bektas <o.bektas@proxmox.com>
2019-10-18 18:45:27 +02:00
Oguz Bektas
98bc3aeb92 use new config helpers from guest-common for pending changes
most of the pending changes related code has been moved into
AbstractConfig, so we have to call them as class methods from QemuConfig instead.

Signed-off-by: Oguz Bektas <o.bektas@proxmox.com>
2019-10-18 18:45:27 +02:00
Oguz Bektas
d3179e1c36 api: use shared methods in config GET
in config GET call, we can now use the new shared methods from
guest-common, namely load_current_config and load_snapshot_config.

the correct method is called depending on the parameters 'current' or
'snapshot'

Signed-off-by: Oguz Bektas <o.bektas@proxmox.com>
2019-10-18 18:45:27 +02:00
Thomas Lamprecht
5172770df7 followup: use new base config provided destroy_config method
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-10-18 11:20:52 +02:00
Dominic Jäger
3e8e214d73 Fix #2412: Missing VMs in pools
Between calling vm_destroy and removing the ID from user.cfg (remove_vm_access)
creating a new VM with this ID was possible. VMs could go missing from pools as
a consequence.

Adding a lock solves this for clones from the same node. Additionally,
unlinking must happen at the very end of the deletion process to avoid that
other nodes use the ID in the meanwhile.

Co-developed-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
Signed-off-by: Dominic Jäger <d.jaeger@proxmox.com>
2019-10-17 19:23:49 +02:00
Mira Limbeck
7d6c99f0a0 fix #2217: don't copy cloudinit disk on clone
This removes the cloudinit disk from the list of drives to clone. As the
cloudinit disk is recreated on every VM start, it's not necessary to
clone it.

Signed-off-by: Mira Limbeck <m.limbeck@proxmox.com>
2019-09-26 18:13:26 +02:00
Thomas Lamprecht
ed94b2adaa followup: reorder error so that $volid is last (potential long)
and add "current" as keyword, further remove the parenthesis for the
post-if, to adapt to Proxmox general perl code style

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-09-23 18:26:27 +02:00
Tim Marx
f8b829aaba add check to resize disk if current size could not be determined
This check ensures that disks aren't unintentionally shrunken, if the
size is zero due to an underlying problem.
2019-09-23 18:25:01 +02:00
Thomas Lamprecht
fda7291362 followup: add newline in warn to avoid extra perl-internal info
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-09-23 13:15:30 +02:00
Fabian Ebner
1373938627 Improve handling and description of migrate with --online
Thanks to Stefan and Thomas for the suggestions.

Changes from v1:
* update parameter description
* warn instead of die

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2019-09-23 13:12:08 +02:00
Thomas Lamprecht
f70a6ea97d api: config deletion: avoid regex on undefined values
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-09-23 12:53:04 +02:00
Dominik Csapak
4c1f3929ea api: deletion: check also pending values for serial/usb
otherwise a user with only VM.Config.HWType cannot
delete a 'pending' usbX: spice or serial: socket option

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2019-09-23 11:24:57 +02:00
Dominik Csapak
165411f0c2 api: add reboot api call
this creates a reboot request file (inspired by pve-container)
and relies on the 'qm cleanup' call by the qmeventd to detect
and restart the vm afterwards

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2019-09-11 14:13:35 +02:00
Dominik Csapak
58f9db6ada api: add missing index child links
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2019-09-10 14:55:28 +02:00
Christian Ebner
de0119f57f Newline cleanup
Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
2019-09-04 16:28:31 +02:00
Dominik Csapak
ccab68c22c fix remote viewer live migration
for some reason not setting port results in a port of '65535' which
triggers an execption in http-server anyevent, so we set the port to 0

also, we have to read the ticket from stdin even for 'unix' type secure
migration

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2019-08-20 11:49:24 +02:00
Aaron Lauterer
b2dd61a045 Add audio device to HW permissions
Signed-off-by: Aaron Lauterer <a.lauterer@proxmox.com>
2019-07-18 08:24:39 +02:00
Thomas Lamprecht
32075a2cb8 check_local_storage_availability: only count each unavailable storage once
and some general cleanup

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-06-28 17:39:16 +02:00
Tim Marx
f25852c27e migrate: handle storage not selected manually in storage config
e.g. local storage was considered not allowed for offline migration
even if it is available on all nodes, this should now be fixed as it
is now considered available on all nodes if a local storage isn't
restricted to a specific subset of the available nodes. The user is
responseable to make sure that the datacenter storage config reflects
the actual setup, so there is no additional check for local storages
which aren't available on all nodes if they are not explicitly marked
at datacenter level.

Signed-off-by: Tim Marx <t.marx@proxmox.com>
2019-06-28 15:22:33 +02:00
Tim Marx
71fc647ff9 add migration precondition api endpoint
Signed-off-by: Tim Marx <t.marx@proxmox.com>
2019-06-15 11:13:14 +02:00
Mira Limbeck
7370974930 add new API for dumping cloudinit config
Adds the path '{vmid}/cloudinit/dump' and requires the parameter 'type'
that's either 'user', 'network' or 'meta'. Returns the generated config as
string.

Signed-off-by: Mira Limbeck <m.limbeck@proxmox.com>
2019-06-06 14:34:11 +02:00
Thomas Lamprecht
736c92f6d1 api/qemu: start: add helper for root-only param extraction
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-06-06 09:43:49 +02:00
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
Tim Marx
c2ed338eff whitespace cleanup
Signed-off-by: Tim Marx <t.marx@proxmox.com>
2019-05-27 13:59:08 +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
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
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
Dominik Csapak
f17fb184c6 change task name for suspend with and without disk
so that we can differentiate in the gui

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2019-03-30 14:36:50 +01:00
Mira Limbeck
7e8ab2a9ab cloudinit: create disk if it does not exist on start
create a fixed size cloudinit disk if it is referenced in config and
does not exist. the size of the disk created when first added to the
config is reduced to 4MiB to match the one created in
commit_cloudinit_disk.
maximum file size per snippet file (network, user, meta) is increased to 1MiB.
preparation for offline migration without the cloudinit disk (that is
always regenerated on start).

also fixes #1807, although a further patch is required to change the
vmid on restore

Signed-off-by: Mira Limbeck <m.limbeck@proxmox.com>
Tested-by: Dominik Csapak <d.csapak@proxmox.com>
2019-03-29 18:11:33 +01:00
Thomas Lamprecht
cd9a035b56 api/resume: allow to resume 'to-disk suspended' VMs
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Cc: Dominik Csapak <d.csapak@proxmox.com>
Reviewed-by: Dominik Csapak <d.csapak@proxmox.com>
Tested-by: Dominik CSapak <d.csapak@proxmox.com>
2019-03-19 13:24:06 +01:00
Dominik Csapak
48b4cdc210 add statestorage parameter to suspend API
this makes it possible to give a storage for state saving, if one
wants to use a different storage than for snapshots or does not
want to save this info into the config

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2019-03-19 08:53:14 +01:00
Dominik Csapak
22371fe00e add ability to suspend a vm to disk from the api
this enables the use of the suspend to disk code

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2019-03-19 08:53:14 +01:00
David Limbeck
cb702ebe0f cloud-init: allow custom network/user data files via snippets
Adds the 'cicustom' option to specify either or both network and user
options as property strings. Their parameters are files in a snippets
storage (e.g. local:snippets/network.yaml). If one or both are specified
they are used instead of their respective generated configuration.
This allows the use of completely custom configurations and is also a
possible solution for bug #2068 by specifying a custom user file that
contains package_upgrade: false.

Tested with Ubuntu 18.10 and cloud-init 18.4.7

Signed-off-by: David Limbeck <d.limbeck@proxmox.com>
2019-03-07 09:02:33 +01:00
Dominik Csapak
9e784b1154 add pre- start/stop hookscripts to VMs
this adds a new config option for it, and executes it on four
points in time:

'pre-start'
'post-start'
'pre-stop'
'post-stop'

on pre-start we abort if the script fails
and pre-stop will not be called if the vm crashes or if
the vm gets powered off from inside the guest

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2019-02-01 12:58:37 +01:00
Thomas Lamprecht
87d92707b6 followup code cleanup
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-01-30 15:08:15 +01:00
Thomas Lamprecht
2a68ec7893 fix some indentaion errors
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-01-30 15:08:00 +01:00
Rhonda D'Vine
b14477e718 Fix #1924: add snapshot parameter
The qm CLI command offer the config and showcmd functions. Both of those
outputs may vary with respect to a given snapshot. This adds a switch
that shows the corresponding snapshot's config and command line.

The code needs a newer libpve-guest-common-perl, thus bumping the
dependency.

Signed-off-by: Rhonda D'Vine <rhonda@proxmox.com>
2019-01-30 14:56:43 +01:00
Thomas Lamprecht
f1e277cd88 api/create: print correct error message if cleanup fails
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-01-26 14:39:38 +01:00
Dominik Csapak
8fef2bdb95 fix #2003: give 'qm terminal' a terminal over ssh
this prevents a connection loop when using novnc on a vm with
vga: serialX
when proxying via ssh

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2019-01-03 09:07:54 +01:00
Dominik Csapak
414b42d8ef vnc/termproxy: use ssh_info_to_command for ssh tunnel
this way we have two places less where we define a ssh cmd

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2019-01-03 09:07:54 +01:00
Wolfgang Bumiller
96ed3574d4 use AAVMF for arm
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2018-11-13 14:44:28 +01:00
Wolfgang Bumiller
40c3bcf876 create_vm: don't add vmgenid for ARM machines by default
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2018-11-13 14:44:28 +01:00
Dominik Csapak
6ee499fff8 fix #1908: add vmgenid config/device
this adds a VM Generation ID device uses by Windows (Server) to determine
some specific actions that may have happened with the vm
such as rollback, restore, etc.

see:

https://docs.microsoft.com/en-us/windows/desktop/hyperv_v2/virtual-machine-generation-identifier

for details on how it works and when it should change

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2018-09-19 12:23:24 +02:00
Dominik Csapak
c725dd5f92 improve 'pending changes' message for clone
$newconf->{pending} is a reference to an empty hash, which is not falsy,
thus we always printed the warning

so check if there are actual values there and if yes,
give the names of the properties for which pending changes are found

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2018-09-12 10:54:27 +02:00
Stoiko Ivanov
ca6621315e Fix #1242 : clone_disk : call qga fstrim after clone
Some storage like rbd or lvm can't keep thin-provising after a qemu-mirror.

Call qga guest-fstrim if qga is available and fstrim_cloned_disks is enabled
after move_disk and migrate.

Co-Authored-By: Alexandre Derumier <aderumier@odiso.com>
Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
2018-08-02 11:35:50 +02:00
Stoiko Ivanov
9d66b39769 Make agent a property string, add fstrim_cloned_disks
Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
2018-08-02 11:35:50 +02:00
Dietmar Maurer
b1a70cab3d vmstatus: define return propertries
We can use the same properties in vmlist and vmstatus.

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2018-08-01 12:58:21 +02:00
Dietmar Maurer
03f879fd85 vmlist: document 'uptime' and 'cpus' returmn value 2018-07-31 13:31:49 +02:00
Dietmar Maurer
ce9b0a3807 qm: add more return schema definitions
Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2018-07-11 10:19:49 +02:00
Wolfgang Bumiller
5bf9618308 api create: cleanup the new config log on error
Otherwise cases like trying to restore a protected VM would
leave a lock in the config.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2018-06-12 10:53:56 +02:00
Thomas Lamprecht
e33f774d00 api create: allow auto vm start after create finished
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2018-06-12 09:44:39 +02:00
Thomas Lamprecht
4fedc13b45 reserve config with create lock early
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2018-06-12 09:44:39 +02:00
Thomas Lamprecht
8ba8418ca1 API/create: move locking inside worker
Move the locking inside worker, so that the process doing the actual
work (create or restore) holds the lock, and can call functions which
do locking without deadlocking.

This mirrors the behaviour we use for containers, and allows to add
an 'autostart' parameter which starts the VM after successful
creation. vm_start needs the lock and as not the worker but it's
parents held it, it couldn't know that it was actually save to
continue...

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2018-06-12 09:44:39 +02:00
Dietmar Maurer
7ee990cd30 implement permission checks for cloud-init related options
Most cloud-init options are network related, so we simply check
for VM.Config.Network priviledge.

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2018-05-14 11:16:40 +02:00
Dominik Csapak
68e46b8452 fix #1749: do not copy pending changes when cloning a vm
cloning a vm means copying the current state, not the
state of 'some time in the future, when the vm is started again'
we should not copy the pending changes, which also fixes the
issue that we got a wrong pending change on the disks,net,smbios,etc.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2018-05-04 08:26:26 +02:00
Thomas Lamprecht
eb84566b49 sync bwlimit description with the container one 2018-03-21 11:15:35 +01:00
Wolfgang Bumiller
7c536e11c4 restore: implement rate limiting
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2018-03-21 11:15:35 +01:00
Dietmar Maurer
1ae43f8c11 clone: add command line completion for newid
Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2018-03-20 11:09:45 +01:00
Dietmar Maurer
fd13b1d0e1 clone: use better default for parameter 'full'
template => linked clone
normal VM => full clone

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2018-03-20 11:09:45 +01:00
Dominik Csapak
2254ffcf87 cloudinit: hide password on the api
since password is easily decrypted, hide it on the api
if someone needs it, they can get it directly from the
config

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2018-03-16 10:03:57 +01:00
Wolfgang Bumiller
cefb41fa76 cloud-init: replace password parameter in log messages
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2018-03-12 12:43:44 +01:00
Wolfgang Bumiller
230406dc52 cloud-init: pre-hash passwords
We don't leave this up to cloud-init as we don't want
un-hashed values at all in our configs.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2018-03-08 14:59:27 +01:00
Wolfgang Bumiller
231f824b1a whitespace fixup
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2018-03-08 14:58:34 +01:00
Wolfgang Bumiller
931432bd2d cloud-init: clone/move support
move: don't error out with "you can't move a cdrom"
clone: always full-clone cloud-init images
  They get completely replaced anyway at the next start, so
  there's no point in keeping them.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2018-03-07 09:11:31 +01:00
Wolfgang Bumiller
9ed7a77c6e cloud-init: hotplug support
*) always replace old cloudinit images
*) apply pending cloudinit changes when generating a new
image

For cloudinit we now always use vdisk_free before
vdisk_alloc in order to always replace old images, this
allows us to hotplug a new drive by setting it to
`none,media=cdrom` first (to eject the disk), then setting
it back to 'storage:cloudinit' to have a new image generated
after applying the currently pending changes.
2018-03-07 09:11:31 +01:00
Alexandre Derumier
0c9a7596f6 implement cloudinit
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
Co-developed-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2018-03-07 09:11:31 +01:00
Dominik Csapak
b8158701aa move guest agent api call to its own file
so we do not pollute the Qemu.pm too much

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2018-02-20 09:55:15 +01:00
Dominik Csapak
c9a074b8bf add agent flag to vm status api call
so that we can check in the gui if we have the agent set without
having to load the whole config

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2018-02-20 09:55:15 +01:00
Thomas Lamprecht
e5caa02e05 avoid harmful '<>' pattern, explicitly read from STDIN
Fixes problems in CLIHandler using the code pattern:

while (my $line = <>) {
    ...
}

For why this causes only _now_ problems lets first look how <>
behaves:

"The null filehandle <> is special: [...] Input from <> comes either
from standard input, or from each file listed on the command line.
Here's how it works: the first time <> is evaluated, the @ARGV array
is checked, and if it is empty, $ARGV[0] is set to "-" , which when
opened gives you standard input.  The @ARGV array is then processed
as a list of filenames." - 'perldoc perlop'

Recent changes in the CLIHandler code changed how we modfiied @ARGV
Earlier we assumed that the first argument must be the command and
thus shifted it out of @ARGV, now we can have multiple levels of
(sub)commands. This change also changed how we handle @ARGV, we do
not unshift anything but go through the arguments until we got to
the final command and copy the rest of @ARGV as we know that this
must be the commandos arguments.

For '<>' this means that ARGV was still fully populated and perl
tried to open element as a file, which naturally failed.
Thus the change in pve-common only exposed this 'dangerous' code
pattern.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2018-01-22 14:56:27 +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
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
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
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
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
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
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
Wolfgang Bumiller
bf1312d811 cleanup: more the new-disk regex deduplication 2017-06-30 09:31:29 +02:00
Dominik Csapak
c46366fd49 fix #1417: check if storage has 'images' set in content
otherwise, qm and the api ignore this setting completely when creating
a vm

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2017-06-30 09:26:53 +02:00
Wolfgang Link
223e032b74 Remove guest states to ensure no old states are exists 2017-06-27 15:31:41 +02:00
Wolfgang Bumiller
9b1396edd2 allow disks on shared storages on replicated VMs 2017-06-27 15:22:08 +02:00
Wolfgang Bumiller
17677004cc refuse to add non-replicatable disks to replicating VMs
Unless replication is explicitly disabled for them.
2017-06-27 10:37:07 +02:00
Thomas Lamprecht
0276584456 API HA tasks: we request states not execute them
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2017-06-27 07:59:12 +02:00
Dietmar Maurer
7c876ec165 PVE/API2/Qemu.pm: cleanup - remove unused $upid parameter 2017-06-12 11:09:47 +02:00
Dietmar Maurer
f53c6ad8b9 PVE/API2/Qemu.pm: aquire guest_migration_lock inside worker 2017-06-12 11:05:46 +02:00