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',
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],
};
+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
VERSION=2.0
PACKAGE=pve-manager
-PACKAGERELEASE=29
+PACKAGERELEASE=30
BINDIR=${DESTDIR}/usr/bin
PERLLIBDIR=${DESTDIR}/usr/share/perl5
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') ],
vm_command('start');
}
});
+
+ 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'),
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: [
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() {