We extract them from the json data by first deleting all
quotes, then deleting everything up to their entries, then
everything after the next comma. If the entry is at the end
there's no comma, instead there are closing braces, so we
need to strip away these as well.
Thomas Lamprecht [Mon, 25 Sep 2017 12:39:43 +0000 (14:39 +0200)]
remove obsolete Posix use clause
besides the cleanup purpose this fixes an actual problem, perls POSIX
module has the following caveat:
`Everything is exported by default (with a handful of exceptions).
This is an unfortunate backwards compatibility feature and its use is
strongly discouraged. You should either prevent the exporting (by
saying "use POSIX ();", as usual) and then use fully qualified names
(e.g. "POSIX::SEEK_END"), or give an explicit import list. If you do
neither and opt for the default (as in "use POSIX;"), you will import
hundreds and hundreds of symbols into your namespace.'
see `perldoc POSIX`
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Thomas Lamprecht [Fri, 22 Sep 2017 12:20:27 +0000 (14:20 +0200)]
window.Wizard: increase default size
The current size was choosen with the older, more compact, classic
theme. The Crisp theme, now in use, has a bit more spaces and bigger
font sizes to adapt to the increased pixel density of current
displays.
Increase the size a bit (~13%) but try to keep the aspect ratio.
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Thomas Lamprecht [Fri, 22 Sep 2017 12:20:25 +0000 (14:20 +0200)]
wizard: merge CD/DVD and OS panels
We had a single column for the CD/DVD panel, fill the second column
with the now in size reduced OS type selector, as ISO selection and
OS type selection are tied together.
Reduces steps needed for creating a VM.
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Thomas Lamprecht [Fri, 22 Sep 2017 12:20:24 +0000 (14:20 +0200)]
OSType edit: switch to combobox
Move from the radiogroup to two comboboxes, where the base OS and
then a specific Version can be choosen.
Avoids multiple occurences of strings like "Microsoft Windows" and
saves a lot of space - which will be used to merge this panel with
the ISO selector panel in the create wizard.
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Thomas Lamprecht [Fri, 22 Sep 2017 12:20:22 +0000 (14:20 +0200)]
refactor OSDefaults, OSTypeEdit: add and use getDefaults
encapuslation wise it makes sense to have a helper which assembles a
os specific setting object in the OSDefaults class, where those
settings are defined.
Else we always need to check if the current OSType on the user side
of this class, which is against encapsulation.
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Thomas Lamprecht [Thu, 21 Sep 2017 09:03:26 +0000 (11:03 +0200)]
ui: reuse ResourceStores default handling for guest description
First, there was an additional space between "'" and ")" which lead
me to this.
I could never trigger the case where vmname is undefined, and saw
that we have a almost same default handling in data/ResourceStore.js
So, just use that one instead here - it misses the single-quotes
inside the parentheses, but as there are already said parentheses
this is visually still very OK, IMO.
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Thomas Lamprecht [Wed, 13 Sep 2017 08:30:15 +0000 (10:30 +0200)]
use log method from base VZDump::Plugin
we copied our log method over there to resolve a cyclic dependency,
now use it here to reduce code duplication.
As we are below pve-guest-common in the dpendency hierachy we may use
it, but it does not may (or at least should) use us.
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Thomas Lamprecht [Wed, 13 Sep 2017 09:10:57 +0000 (11:10 +0200)]
vzdump/pigz: use ProcFSTools for core count, not sysconf
A "sysconf(84)" is not really descripitve. There is no POSIX const
entry for _SC_NPROCESSORS_ONLN (number of processors online) as its
not standard but an adoption of glibc.
Better just use our proven ProcFSTool's cpuinfo method for getting
the desired information.
This is kept only for backwards compatibillity as we guaranteed that
we use #cpus/2 if 'pigz' is set to 1, else I would have removed this
alltogether and just directly passed 'pigz' to the command...
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Emmanuel Kasper [Thu, 24 Aug 2017 09:45:20 +0000 (11:45 +0200)]
Turn the offline/online checkbox of the Migrate Windows into a displayfield
This checkbox had not effect whatsoever:
* if the VM was online and offline was selected, the migration would fail
with the message that the --online flag is needed for running VMs
* if the the VM was offline and online was selected, the migration would
happen offline anyway
the name 'pve-manager' collides with our pve-manager package name,
which - from the user point of view - provides mainly the API and
WebUI.
An user could thus think that restarting 'pve-manager' would restart
the WebUIs server, which is relatable.
But, the pve-manager.service does not controls the WebUI or its
server but is responsible for starting all guest with 'onboot=1' in
their config on system boot and to stop all remaining running guests
on system shutdown.
Thus rename it to pve-guests and adapt its description. This may not
seem as ideal name at first glance, but its better than the current
option. Further it leads to log messages like:
> Starting PVE guests (Service providing start-on-boot and stop-all-on-shutdown)
> [...]
> Started PVE guests (Service providing start-on-boot and stop-all-on-shutdown)
> [...]
> Stopping PVE guests (Service providing start-on-boot and stop-all-on-shutdown)
which makes it clearer what happens, or what this service is for.
Alias the new service to the old pve-manager.service for legacy
reasons. While our services do not depend on it an user could have
made an own service which used pve-manager.service as synchronisation
point.
Linitian then complains about init.d/pve-manager not having a related
systemd service file. Instead of renmaning it just drop it.
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This services is responsible for bringing up 'onboot' marked guests
on host power-on and stop _all_ guests gracefully on host shutdown
(be it reboot, shutdow, halt, ..)
It's type is set to 'oneshot', which implies a TimeoutStartSec of
'infinity', by default. With Jessies Version of Systemd the
TimeoutStopSec defaulted to TimeoutStartSec, if not set – so also
'infinity'.
But, Debian Stretchs Version of Systemd makes TimeoutStopSec defaults
to 'DefaultTimeoutStopSec' if it was not set, which is by default 90
seconds – much less than infinity.
This may cause non-gracefull shutdowns of guests, as after the 90
seconds systemd sends a SIGKILL to the pvesh 'stopall' process.
This may end in a bad guest state then. But besides that it can also
lead to a hanging shutdown in some cirumstancesm, as some guest still
operated on storages, so systemd-shutdown - the binary which gets
exec'ed by systemd to become the new PID 1 cannot finish its
sync/umount/shutdown procedure. It has a watchdog armed on sync, if
that triggers you may even get a fully shut down system.
Else it can possibly hang forever, at least until the power plug gets
pulled or similar actions are taken.
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
this is for adding a pve managed ceph rbd storage, so that the user
just has to select the pool, and does not need to write the monitor
hosts and copy the keyring
we sometimes want to give the api call a parameter,
with this, we don't have to encode it into the url
everytime ourselves, but just give a 'params' object
introduce new API parameter 'add_storages'. if set, one
storage each is configured using the created pool:
- for containers using KRBD
- for VMs using librbd
Thomas Lamprecht [Tue, 29 Aug 2017 10:08:29 +0000 (12:08 +0200)]
create: clear iothread on disable
A user may set the `iothread` option and then change the bus type to
something which does not support it (sata, ide), while we disable
it the previously set value remains, which is confusing.
An user could think he coulkd trick the Wizard into using iothreads
for SATA/IDE but we just ignore the value in this case.
Set iothread to false in the case it gets disabled.
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Emmanuel Kasper [Tue, 29 Aug 2017 10:08:28 +0000 (12:08 +0200)]
Change the SCSI controller type when editing a harddisk only when creating a VM.
If not, the following could happen:
* user has a VM with two disks attached to a LSI controller
* adding a third disk, he notices the iothread option, and clicks it
* the scsihw type for all disks is changed now to virtio-scsi-single
* on next cold restart, STOP 0x0000007B INACCESSABLE_BOOT_DEVICE for a Windows VM
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Thomas Lamprecht [Tue, 29 Aug 2017 10:08:25 +0000 (12:08 +0200)]
disk/controllerselector: adapt flex
The bus tye selector gets now 2/3 of the space and the bus number
spinner gets 1/3.
It looked a bit strange with both of them getting half of the space,
as on a lot of GUIs the spinner get less space (its just a number
(max 13) vs a wider text).
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Dominik Csapak [Fri, 18 Aug 2017 07:04:53 +0000 (09:04 +0200)]
fix nodeselector when no element in the tree is selected
it can happen that nothing in the tree is selected,
then PVE.curSelectedNode is undefined, generating an exception there.
so we check if this is available
because unlike the git-rev-parse man page says, the default
length is actually calculated based on the number of packed
objects in the clone of the repository.
we don't want this to depend on the build environment and
how the repository was cloned there, so fix a length of 8
for now.
since ceph 12.1.1 the (deprecated) parameter 'crush_ruleset' is removed
and replaced with 'crush_rule' while changing this, change from
integer to string so that we can later use the names of the rules
instead of the id
(for now there seems to be a bug that you can only use the name and
not the id)