small refactoring in get_filtered_vmlist: save a VMs config in its
own subhash to avoid collisions with other data which we want to save
in the vmid list, for now this is only `type` but in the next patch
I want to save also the class
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
(cherry picked from commit 627fa10467a1578c5a3c7d2a292bbe6f14a881ca)
we cannot use a rados connection before having at least one monitor,
so we have to move it down
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
(backported from commit 738ce0f235daf46aecedab3e33147d871d3959fa)
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
since ids can contain '-', we have to include them in the pattern
for the service names
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
(cherry picked from commit 38e20dad713db1024eb91fb9a1becd07f9c940df)
this patch adds the create-/destroymgr commands to the api and pveceph,
so that advanced users can split monitor and manager daemons
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
(cherry picked from commit ad9411c9480aa8f9b5fdbf677e0fb4a1e6997cb7)
we now want to add a ceph-mgr daemon to every node where a ceph-mon
daemon runs, as per ceph documentation recommendation, because in
luminous the mgr daemons will not be automatically created/started
with a monitor anymore
we also give the createmon an optional id parameter, so that one
can set a custom id, and make the creation/removal of the manager
optional but the default
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
(cherry picked from commit f77a087446390840846cd9300ce3dbe7f4bc7fd6)
extjs cannot "convert" and id from other fields, so the ids in the
diffstore and the realstore are different and we re-add every element on
every update
to mitigate this, we generate the id (which is "uid:hostname") in the
backend, and simply use it in the frontend
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
since bash does not play well with utf8 encoded input,
eg. pressing ALTGR + M on an english intl keyboard layout int novnc
does not enter the mu symbol but makes bash think you pressed alt+5,
we should use login without authorization when logging in as root
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
use the new keeplocale parameter from run_command and do not delete the
LANG and LANGUAGE variable for the vncshell
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
instead of using get_start_stop_list in a rather hacky way use the
new get_filtered_vmlist method and adapt the loop, as now only one
level is required.
most changes are just an indent shift left as we lost an unnecessary
loop level
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
we used get_start_stop_list for assembling a list of VMIDs for
stopall, startall and migrateall.
While get_start_stop_list did already some filtering we did some
more in the specific startall and stopall calls.
Add a new private helper which does all the filtering and just
assemble the startup order in the get_start_stop_list method.
Move the template and ha managed filtering in the new
get_filtered_vmlist method, this allows us to remove the filtering
from the API calls them self and we do not load the vms config twice
(it was cached, but nonetheless unnecessary)
get_filtered_vmlist is also intended to be used by migrateall in a
next patch
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Instead, pass the HTTP server as last argument to the page formater,
so that we can call $server->create_auth_cookie().
Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
this is a simple filter which allows us to limit the actions to specific
vmids
this makes it much simpler to start/stop/migrate a range of vms
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
this adds a hastate field to all vms/ct which have ha enabled
we will use this for showing the error state in the tree (in the webgui)
and for the cluster dashboard (to count the error state guests)
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
instead of using
'/dev/${real_dev}'
we use the devpath property directly
also we skip the smart check in the cleanup
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
instead of getting all disks, only get the info
from the one we get as parameter
and use the 'devname' value for the
ceph commands instead of the parameter itself
(this fixes the cciss!cXdY cciss/cXdY mismatch)
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
As some Makefiles in sub directories do not implement the distclean
target, namely:
PVE/Service/Makefile
PVE/CLI/Makefile
This target is broken.
As all other implementations just redirect to the 'clean' target I
do not implement the missing ones but rather remove all such
targets. Keep it just in the top level directory, for consistence
sake with other pve repos, and redirect it there directly to the
clean target.
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
removes the check for dir or nfs storage,
because a few lines below we check for
the content type vztmpl
which should only be allowed when we have a
location where we put templates, thus we should
be able to download them there
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
With the new calculation $pe->{maxcpu} was used before being
initialized to zero. Moving the initialization up.
Additionally setting $pe->{cpu} to $entry->{cpu} if maxcpu
is not set seems pointless as with its factor (maxcpu)
initialized to zero it is cancelled out anyway.
we only added the % of the vms in a pool
which lead to wrong results
e.g. having a pool with 3 vms with 4 cores each and a
cpu usage of 50% each (2 cores at 100%)
lead to :
vm1 50%
vm2 50%
vm3 50%
pool 150%
instead we new calculate the percentage for the whole pool
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
also introduces a force parameter to this call
if force is true, the call destroys the ceph pool
even when it is use
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>