Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
pve-manager
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
pve-manager
Commits
af79261b
Commit
af79261b
authored
Feb 20, 2012
by
Dietmar Maurer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add mount/unmount command for openvz
parent
ba4c1233
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
127 additions
and
2 deletions
+127
-2
OpenVZ.pm
PVE/API2/OpenVZ.pm
+96
-0
pvectl
bin/pvectl
+2
-0
changelog.Debian
debian/changelog.Debian
+6
-0
defines.mk
defines.mk
+1
-1
Utils.js
www/manager/Utils.js
+2
-0
Config.js
www/manager/openvz/Config.js
+20
-1
No files found.
PVE/API2/OpenVZ.pm
View file @
af79261b
...
...
@@ -1099,6 +1099,102 @@ __PACKAGE__->register_method({
return
$upid
;
}});
__PACKAGE__
->
register_method
({
name
=>
'
vm_mount
',
path
=>
'
{vmid}/status/mount
',
method
=>
'
POST
',
protected
=>
1
,
proxyto
=>
'
node
',
description
=>
"
Mounts container private area.
",
permissions
=>
{
check
=>
['
perm
',
'
/vms/{vmid}
',
[
'
VM.PowerMgmt
'
]],
},
parameters
=>
{
additionalProperties
=>
0
,
properties
=>
{
node
=>
get_standard_option
('
pve-node
'),
vmid
=>
get_standard_option
('
pve-vmid
'),
},
},
returns
=>
{
type
=>
'
string
',
},
code
=>
sub
{
my
(
$param
)
=
@_
;
my
$rpcenv
=
PVE::RPCEnvironment::
get
();
my
$authuser
=
$rpcenv
->
get_user
();
my
$node
=
extract_param
(
$param
,
'
node
');
my
$vmid
=
extract_param
(
$param
,
'
vmid
');
die
"
CT
$vmid
is running
\n
"
if
PVE::OpenVZ::
check_running
(
$vmid
);
my
$realcmd
=
sub
{
my
$upid
=
shift
;
syslog
('
info
',
"
mount CT
$vmid
:
$upid
\n
");
my
$cmd
=
['
vzctl
',
'
mount
',
$vmid
];
run_command
(
$cmd
);
return
;
};
return
$rpcenv
->
fork_worker
('
vzmount
',
$vmid
,
$authuser
,
$realcmd
);
}});
__PACKAGE__
->
register_method
({
name
=>
'
vm_umount
',
path
=>
'
{vmid}/status/umount
',
method
=>
'
POST
',
protected
=>
1
,
proxyto
=>
'
node
',
description
=>
"
Unmounts container private area.
",
permissions
=>
{
check
=>
['
perm
',
'
/vms/{vmid}
',
[
'
VM.PowerMgmt
'
]],
},
parameters
=>
{
additionalProperties
=>
0
,
properties
=>
{
node
=>
get_standard_option
('
pve-node
'),
vmid
=>
get_standard_option
('
pve-vmid
'),
},
},
returns
=>
{
type
=>
'
string
',
},
code
=>
sub
{
my
(
$param
)
=
@_
;
my
$rpcenv
=
PVE::RPCEnvironment::
get
();
my
$authuser
=
$rpcenv
->
get_user
();
my
$node
=
extract_param
(
$param
,
'
node
');
my
$vmid
=
extract_param
(
$param
,
'
vmid
');
die
"
CT
$vmid
is running
\n
"
if
PVE::OpenVZ::
check_running
(
$vmid
);
my
$realcmd
=
sub
{
my
$upid
=
shift
;
syslog
('
info
',
"
umount CT
$vmid
:
$upid
\n
");
my
$cmd
=
['
vzctl
',
'
umount
',
$vmid
];
run_command
(
$cmd
);
return
;
};
return
$rpcenv
->
fork_worker
('
vzumount
',
$vmid
,
$authuser
,
$realcmd
);
}});
__PACKAGE__
->
register_method
({
name
=>
'
vm_shutdown
',
path
=>
'
{vmid}/status/shutdown
',
...
...
bin/pvectl
View file @
af79261b
...
...
@@ -75,6 +75,8 @@ my $cmddef = {
start
=>
[
'
PVE::API2::OpenVZ
',
'
vm_start
',
['
vmid
'],
{
node
=>
$nodename
},
$upid_exit
],
shutdown
=>
[
'
PVE::API2::OpenVZ
',
'
vm_shutdown
',
['
vmid
'],
{
node
=>
$nodename
},
$upid_exit
],
stop
=>
[
'
PVE::API2::OpenVZ
',
'
vm_stop
',
['
vmid
'],
{
node
=>
$nodename
},
$upid_exit
],
mount
=>
[
'
PVE::API2::OpenVZ
',
'
vm_mount
',
['
vmid
'],
{
node
=>
$nodename
},
$upid_exit
],
umount
=>
[
'
PVE::API2::OpenVZ
',
'
vm_umount
',
['
vmid
'],
{
node
=>
$nodename
},
$upid_exit
],
migrate
=>
[
"
PVE::API2::OpenVZ
",
'
migrate_vm
',
['
vmid
',
'
target
'],
{
node
=>
$nodename
},
$upid_exit
],
};
...
...
debian/changelog.Debian
View file @
af79261b
pve-manager (2.0-30) unstable; urgency=low
* add unmount button to openvz GUI
-- Proxmox Support Team <support@proxmox.com> Mon, 20 Feb 2012 10:11:13 +0100
pve-manager (2.0-29) unstable; urgency=low
* fix datacenter options GUI
...
...
defines.mk
View file @
af79261b
...
...
@@ -2,7 +2,7 @@ RELEASE=2.0
VERSION=2.0
PACKAGE=pve-manager
PACKAGERELEASE=
29
PACKAGERELEASE=
30
BINDIR=${DESTDIR}/usr/bin
PERLLIBDIR=${DESTDIR}/usr/share/perl5
...
...
www/manager/Utils.js
View file @
af79261b
...
...
@@ -389,6 +389,8 @@ Ext.define('PVE.Utils', { statics: {
vzmigrate
:
[
'
CT
'
,
gettext
(
'
Migrate
'
)
],
vzstart
:
[
'
CT
'
,
gettext
(
'
Start
'
)
],
vzstop
:
[
'
CT
'
,
gettext
(
'
Stop
'
)
],
vzmount
:
[
'
CT
'
,
gettext
(
'
Mount
'
)
],
vzumount
:
[
'
CT
'
,
gettext
(
'
Unmount
'
)
],
vzshutdown
:
[
'
CT
'
,
gettext
(
'
Shutdown
'
)
],
srvstart
:
[
'
SRV
'
,
gettext
(
'
Start
'
)
],
srvstop
:
[
'
SRV
'
,
gettext
(
'
Stop
'
)
],
...
...
www/manager/openvz/Config.js
View file @
af79261b
...
...
@@ -39,6 +39,15 @@ Ext.define('PVE.openvz.Config', {
}
});
var
umountBtn
=
Ext
.
create
(
'
Ext.Button
'
,
{
text
:
gettext
(
'
Unmount
'
),
disabled
:
true
,
hidden
:
true
,
handler
:
function
()
{
vm_command
(
'
umount
'
);
}
});
var
stopBtn
=
Ext
.
create
(
'
PVE.button.Button
'
,
{
text
:
gettext
(
'
Stop
'
),
confirmMsg
:
Ext
.
String
.
format
(
gettext
(
"
Do you really want to stop VM {0}?
"
),
vmid
),
...
...
@@ -96,7 +105,7 @@ Ext.define('PVE.openvz.Config', {
Ext
.
apply
(
me
,
{
title
:
Ext
.
String
.
format
(
gettext
(
"
Container {0} on node {1}
"
),
descr
,
"
'
"
+
nodename
+
"
'
"
),
hstateid
:
'
ovztab
'
,
tbar
:
[
startBtn
,
shutdownBtn
,
stopBtn
,
removeBtn
,
tbar
:
[
startBtn
,
shutdownBtn
,
umountBtn
,
stopBtn
,
removeBtn
,
migrateBtn
,
consoleBtn
],
defaults
:
{
statusStore
:
me
.
statusStore
},
items
:
[
...
...
@@ -166,6 +175,16 @@ Ext.define('PVE.openvz.Config', {
shutdownBtn
.
setDisabled
(
status
!==
'
running
'
);
stopBtn
.
setDisabled
(
status
===
'
stopped
'
);
removeBtn
.
setDisabled
(
status
!==
'
stopped
'
);
if
(
status
===
'
mounted
'
)
{
umountBtn
.
setDisabled
(
false
);
umountBtn
.
setVisible
(
true
);
stopBtn
.
setVisible
(
false
);
}
else
{
umountBtn
.
setDisabled
(
true
);
umountBtn
.
setVisible
(
false
);
stopBtn
.
setVisible
(
true
);
}
});
me
.
on
(
'
afterrender
'
,
function
()
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment