Re: [pve-devel] need help to debug random host freeze on multiple hosts

2014-12-29 Thread Michael Rasmussen
On Mon, 29 Dec 2014 20:05:35 +0100 (CET)
Alexandre DERUMIER  wrote:

> 
> Here the detail of microcode patch
> 
> 815 Processor May Read Partially Updated Branch Status
> Register
> Description
> Under a highly specific and detailed set of internal timing conditions, the 
> processor may read an internal branch
> status register (BSR) while the register is being updated resulting in an 
> incorrect rIP.
> Potential Effect on System
> The incorrect rIP causes unpredictable program or system behavior, usually 
> observed as a page fault.
> Suggested Workaround
> Contact your AMD representative for information on a BIOS update.
> Fix Planned
> No fix planned
> 
> 
> 
> I have another crash this afternoon, and this host was around 90% cpu usage 
> since 12h. (But loadaverage was ok).
> So maybe more cpu give more chance to reach the case.
> 
> I have patched this bios, I'll wait to see if it's improve or not.
> 
Sounds like a race condition to me. I also think high load due to lots
of KVM processes seems to be one way to trigger this behavior.

-- 
Hilsen/Regards
Michael Rasmussen

Get my public GnuPG keys:
michael  rasmussen  cc
http://pgp.mit.edu:11371/pks/lookup?op=get&search=0xD3C9A00E
mir  datanom  net
http://pgp.mit.edu:11371/pks/lookup?op=get&search=0xE501F51C
mir  miras  org
http://pgp.mit.edu:11371/pks/lookup?op=get&search=0xE3E80917
--
/usr/games/fortune -es says:
"Shelter," what a nice name for for a place where you polish your cat.


pgpfDcvrPNjb3.pgp
Description: OpenPGP digital signature
___
pve-devel mailing list
pve-devel@pve.proxmox.com
http://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel


Re: [pve-devel] [PATCH 2/5] add pending param to config api

2014-12-29 Thread Alexandre DERUMIER
>>I think this should have a 
>>
>>default => 1, 
>>
>>So that we are compatible with current behavior. 

Oh, yes, you are right.
Like this it'll not break whmcs modulegarden proxmox module. 
(I see that they are now partner with proxmox, their module is really great :)




- Mail original -
De: "dietmar" 
À: "aderumier" , "pve-devel" 
Envoyé: Lundi 29 Décembre 2014 14:47:34
Objet: Re: [pve-devel] [PATCH 2/5] add pending param to config api

> @@ -633,6 +633,11 @@ __PACKAGE__->register_method({ 
> properties => { 
> node => get_standard_option('pve-node'), 
> vmid => get_standard_option('pve-vmid'), 
> + pending => { 
> + optional => 1, 
> + type => 'boolean', 
> + description => "Get pending values instead running values", 
> + }, 

I think this should have a 

default => 1, 

So that we are compatible with current behavior. 

___
pve-devel mailing list
pve-devel@pve.proxmox.com
http://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel


Re: [pve-devel] need help to debug random host freeze on multiple hosts

2014-12-29 Thread Alexandre DERUMIER
>>I don't have info about microcode update, only a note from dell support which 
>>said that it's correcting 
>>instability on vmware. (So I don't known for kvm) 

Here the detail of microcode patch

815 Processor May Read Partially Updated Branch Status
Register
Description
Under a highly specific and detailed set of internal timing conditions, the 
processor may read an internal branch
status register (BSR) while the register is being updated resulting in an 
incorrect rIP.
Potential Effect on System
The incorrect rIP causes unpredictable program or system behavior, usually 
observed as a page fault.
Suggested Workaround
Contact your AMD representative for information on a BIOS update.
Fix Planned
No fix planned



I have another crash this afternoon, and this host was around 90% cpu usage 
since 12h. (But loadaverage was ok).
So maybe more cpu give more chance to reach the case.

I have patched this bios, I'll wait to see if it's improve or not.



- Mail original -
De: "aderumier" 
À: "datanom.net" 
Cc: "pve-devel" 
Envoyé: Lundi 29 Décembre 2014 16:56:32
Objet: Re: [pve-devel] need help to debug random host freeze on multiple hosts

>>Could this, given the high load, be caused by a race condition which is 
>>solved in the new microcode? 

I don't have info about microcode update, only a note from dell support which 
said that it's correcting 
instability on vmware. (So I don't known for kvm) 


>>Have you tried connecting a serial console to one of the nodes? 
>> 
>>If you have IPMI on the nodes you should also be able to monitor 
>>further than on the default console. 

I'm going to implement serial output over the dell idrac. 


- Mail original - 
De: "datanom.net"  
À: "pve-devel"  
Cc: "aderumier"  
Envoyé: Lundi 29 Décembre 2014 13:27:08 
Objet: Re: [pve-devel] need help to debug random host freeze on multiple hosts 

On Mon, 29 Dec 2014 07:31:32 +0100 (CET) 
Alexandre DERUMIER  wrote: 

> 
> Yes sure , I have nothing in logs. 
> (That's why I thinked of kdump to try to have more info). 
> 
> I'll really don't known if it's a software real kernel panic, or a hardware 
> bug. 
> 
> I just see on vmware forum some amd microcode bug, and see that dell provide 
> a new bios update this month. 
> I'll try to update to see if it's help. 
> 
Could this, given the high load, be caused by a race condition which is 
solved in the new microcode? 

Have you tried connecting a serial console to one of the nodes? 

If you have IPMI on the nodes you should also be able to monitor 
further than on the default console. 

-- 
Hilsen/Regards 
Michael Rasmussen 

Get my public GnuPG keys: 
michael  rasmussen  cc 
http://pgp.mit.edu:11371/pks/lookup?op=get&search=0xD3C9A00E 
mir  datanom  net 
http://pgp.mit.edu:11371/pks/lookup?op=get&search=0xE501F51C 
mir  miras  org 
http://pgp.mit.edu:11371/pks/lookup?op=get&search=0xE3E80917 
-- 
/usr/games/fortune -es says: 
We secure our friends not by accepting favors but by doing them. 
-- Thucydides 
___ 
pve-devel mailing list 
pve-devel@pve.proxmox.com 
http://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel 
___
pve-devel mailing list
pve-devel@pve.proxmox.com
http://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel


Re: [pve-devel] need help to debug random host freeze on multiple hosts

2014-12-29 Thread Alexandre DERUMIER
>>Could this, given the high load, be caused by a race condition which is
>>solved in the new microcode?

I don't have info about microcode update, only a note from dell support which 
said that it's correcting
instability on vmware. (So I don't known for kvm)


>>Have you tried connecting a serial console to one of the nodes?
>>
>>If you have IPMI on the nodes you should also be able to monitor
>>further than on the default console.

I'm going to implement serial output over the dell idrac.


- Mail original -
De: "datanom.net" 
À: "pve-devel" 
Cc: "aderumier" 
Envoyé: Lundi 29 Décembre 2014 13:27:08
Objet: Re: [pve-devel] need help to debug random host freeze on multiple hosts

On Mon, 29 Dec 2014 07:31:32 +0100 (CET) 
Alexandre DERUMIER  wrote: 

> 
> Yes sure , I have nothing in logs. 
> (That's why I thinked of kdump to try to have more info). 
> 
> I'll really don't known if it's a software real kernel panic, or a hardware 
> bug. 
> 
> I just see on vmware forum some amd microcode bug, and see that dell provide 
> a new bios update this month. 
> I'll try to update to see if it's help. 
> 
Could this, given the high load, be caused by a race condition which is 
solved in the new microcode? 

Have you tried connecting a serial console to one of the nodes? 

If you have IPMI on the nodes you should also be able to monitor 
further than on the default console. 

-- 
Hilsen/Regards 
Michael Rasmussen 

Get my public GnuPG keys: 
michael  rasmussen  cc 
http://pgp.mit.edu:11371/pks/lookup?op=get&search=0xD3C9A00E 
mir  datanom  net 
http://pgp.mit.edu:11371/pks/lookup?op=get&search=0xE501F51C 
mir  miras  org 
http://pgp.mit.edu:11371/pks/lookup?op=get&search=0xE3E80917 
-- 
/usr/games/fortune -es says: 
We secure our friends not by accepting favors but by doing them. 
-- Thucydides 
___
pve-devel mailing list
pve-devel@pve.proxmox.com
http://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel


Re: [pve-devel] [PATCH 2/5] add pending param to config api

2014-12-29 Thread Dietmar Maurer

> @@ -633,6 +633,11 @@ __PACKAGE__->register_method({
>   properties => {
>   node => get_standard_option('pve-node'),
>   vmid => get_standard_option('pve-vmid'),
> +pending => {
> +optional => 1,
> +type => 'boolean',
> +description => "Get pending values instead running values",
> +},

I think this should have a 

 default => 1,

So that we are compatible with current behavior.

___
pve-devel mailing list
pve-devel@pve.proxmox.com
http://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel


[pve-devel] [PATCH 2/5] align icons in grid to top

2014-12-29 Thread Alexandre Derumier

Signed-off-by: Alexandre Derumier 
---
 www/css/ext-pve.css |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/www/css/ext-pve.css b/www/css/ext-pve.css
index ffdfa3a..6f63bd0 100644
--- a/www/css/ext-pve.css
+++ b/www/css/ext-pve.css
@@ -58,7 +58,7 @@
 .pve-itype-icon-itype
 {
 background-repeat: no-repeat;
-background-position:3px center;
+background-position:3px center top;
 padding-left: 20px;
 }
 
-- 
1.7.10.4

___
pve-devel mailing list
pve-devel@pve.proxmox.com
http://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel


[pve-devel] [PATCH 3/5] hardware and option : pass pending param to config api

2014-12-29 Thread Alexandre Derumier

Signed-off-by: Alexandre Derumier 
---
 www/manager/qemu/HardwareView.js |2 +-
 www/manager/qemu/Options.js  |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/www/manager/qemu/HardwareView.js b/www/manager/qemu/HardwareView.js
index 31c8be0..f05f2eb 100644
--- a/www/manager/qemu/HardwareView.js
+++ b/www/manager/qemu/HardwareView.js
@@ -180,7 +180,7 @@ Ext.define('PVE.qemu.HardwareView', {
me.rstore.load();
};
 
-   var baseurl = 'nodes/' + nodename + '/qemu/' + vmid + '/config';
+   var baseurl = 'nodes/' + nodename + '/qemu/' + vmid + 
'/config?pending=1';
 
var sm = Ext.create('Ext.selection.RowModel', {});
 
diff --git a/www/manager/qemu/Options.js b/www/manager/qemu/Options.js
index 7cd302f..ccf0ccc 100644
--- a/www/manager/qemu/Options.js
+++ b/www/manager/qemu/Options.js
@@ -257,7 +257,7 @@ Ext.define('PVE.qemu.Options', {
}
};
 
-   var baseurl = 'nodes/' + nodename + '/qemu/' + vmid + '/config';
+   var baseurl = 'nodes/' + nodename + '/qemu/' + vmid + 
'/config?pending=1';
 
var reload = function() {
me.rstore.load();
-- 
1.7.10.4

___
pve-devel mailing list
pve-devel@pve.proxmox.com
http://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel


[pve-devel] [PATCH 1/5] pending grid demo

2014-12-29 Thread Alexandre Derumier
fixme:

- add missing options from config file in store
- remove ObjectStore2.js

Signed-off-by: Alexandre Derumier 
---
 www/manager/Makefile |2 +
 www/manager/data/ObjectStore2.js |   28 
 www/manager/data/PVEProxy.js |6 ++
 www/manager/grid/ObjectGrid2.js  |  132 ++
 www/manager/qemu/HardwareView.js |4 +-
 www/manager/qemu/Options.js  |4 +-
 6 files changed, 172 insertions(+), 4 deletions(-)
 create mode 100644 www/manager/data/ObjectStore2.js
 create mode 100644 www/manager/grid/ObjectGrid2.js

diff --git a/www/manager/Makefile b/www/manager/Makefile
index 704895d..b5f6ba6 100644
--- a/www/manager/Makefile
+++ b/www/manager/Makefile
@@ -19,6 +19,7 @@ JSSRC=
\
data/UpdateStore.js \
data/DiffStore.js   \
data/ObjectStore.js \
+   data/ObjectStore2.js\
data/ResourceStore.js   \
form/VLanField.js   \
form/Checkbox.js\
@@ -76,6 +77,7 @@ JSSRC=
\
grid/CheckColumn.js \
grid/SelectFeature.js   \
grid/ObjectGrid.js  \
+   grid/ObjectGrid2.js \
grid/ResourceGrid.js\
grid/PoolMembers.js \
grid/FirewallRules.js   \
diff --git a/www/manager/data/ObjectStore2.js b/www/manager/data/ObjectStore2.js
new file mode 100644
index 000..0946f03
--- /dev/null
+++ b/www/manager/data/ObjectStore2.js
@@ -0,0 +1,28 @@
+Ext.define('PVE.data.ObjectStore2',  {
+extend: 'PVE.data.UpdateStore',
+
+constructor: function(config) {
+   var me = this;
+
+config = config || {};
+
+   if (!config.storeid) {
+   config.storeid =  'pve-store-' + (++Ext.idSeed);
+   }
+
+Ext.applyIf(config, {
+   model: 'KeyValuePendingDelete',
+proxy: {
+type: 'pve',
+   url: config.url,
+   extraParams: config.extraParams,
+//reader: {
+// type: 'jsonobject',
+// rows: config.rows
+// }
+}
+});
+
+me.callParent([config]);
+}
+});
diff --git a/www/manager/data/PVEProxy.js b/www/manager/data/PVEProxy.js
index 46cecf6..219a620 100644
--- a/www/manager/data/PVEProxy.js
+++ b/www/manager/data/PVEProxy.js
@@ -67,6 +67,12 @@ Ext.define('PVE.RestProxy', {
idProperty: 'key'
 });
 
+Ext.define('KeyValuePendingDelete', {
+   extend: "Ext.data.Model",
+   fields: [ 'key', 'value', 'pending', 'delete' ],
+   idProperty: 'key'
+});
+
 Ext.define('pve-string-list', {
extend: 'Ext.data.Model',
fields:  [ 'n', 't' ],
diff --git a/www/manager/grid/ObjectGrid2.js b/www/manager/grid/ObjectGrid2.js
new file mode 100644
index 000..76589da
--- /dev/null
+++ b/www/manager/grid/ObjectGrid2.js
@@ -0,0 +1,132 @@
+Ext.define('PVE.grid.ObjectGrid2', {
+extend: 'Ext.grid.GridPanel',
+alias: ['widget.pveObjectGrid2'],
+
+getObjectValue: function(key, defaultValue) {
+   var me = this;
+   var rec = me.store.getById(key);
+   if (rec) {
+   return rec.data.value;
+   }
+   return defaultValue;
+},
+
+renderKey: function(key, metaData, record, rowIndex, colIndex, store) {
+   var me = this;
+   var rows = me.rows;
+   var rowdef = (rows && rows[key]) ?  rows[key] : {};
+   return rowdef.header || key;
+},
+
+renderValue: function(value, metaData, record, rowIndex, colIndex, store) {
+   var me = this;
+   var rows = me.rows;
+   var key = record.data.key;
+   var rowdef = (rows && rows[key]) ?  rows[key] : {};
+   var renderer = rowdef.renderer;
+   var current = '';
+   var pendingdelete = '';
+   var pending = '';
+
+   if (renderer) {
+   current = renderer(value, metaData, record, rowIndex, colIndex, 
store);
+   if(record.data['pending']){
+   pending = renderer(record.data['pending'], metaData, record, 
rowIndex, colIndex, store);
+   }
+   }else{
+   current = value;
+   pending = record.data['pending'];
+   }
+   if(record.data['delete']){
+   pendingdelete = ''+ 
current +'';
+   }
+
+   value = current;
+   if(pending || pendingdelete){
+   value += '' + pending + pendingdelete + 
'';
+   }
+   return value;
+},
+
+initComponent : function() {
+   var me = this;
+
+   var rows = me.rows;
+
+   if (!me.rstore) {
+   if (!me.url) {
+

[pve-devel] pve-manager : pending patches v4

2014-12-29 Thread Alexandre Derumier
Need new qemu-server patchs series V4

I always stuck to display options not defined in config.

___
pve-devel mailing list
pve-devel@pve.proxmox.com
http://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel


[pve-devel] [PATCH 5/5] fix pending cpu rendering

2014-12-29 Thread Alexandre Derumier

Signed-off-by: Alexandre Derumier 
---
 www/manager/grid/ObjectGrid2.js  |   14 ++
 www/manager/qemu/HardwareView.js |   13 -
 2 files changed, 18 insertions(+), 9 deletions(-)

diff --git a/www/manager/grid/ObjectGrid2.js b/www/manager/grid/ObjectGrid2.js
index 76589da..5eb37e3 100644
--- a/www/manager/grid/ObjectGrid2.js
+++ b/www/manager/grid/ObjectGrid2.js
@@ -2,11 +2,17 @@ Ext.define('PVE.grid.ObjectGrid2', {
 extend: 'Ext.grid.GridPanel',
 alias: ['widget.pveObjectGrid2'],
 
-getObjectValue: function(key, defaultValue) {
+getObjectValue: function(key, defaultValue, pending) {
var me = this;
var rec = me.store.getById(key);
if (rec) {
-   return rec.data.value;
+   if (pending && rec.data['pending']) {
+   return rec.data['pending'];
+   }else if (rec.data.value) {
+   return rec.data.value;
+   }else {
+   return defaultValue;
+   }
}
return defaultValue;
 },
@@ -30,8 +36,8 @@ Ext.define('PVE.grid.ObjectGrid2', {
 
if (renderer) {
current = renderer(value, metaData, record, rowIndex, colIndex, 
store);
-   if(record.data['pending']){
-   pending = renderer(record.data['pending'], metaData, record, 
rowIndex, colIndex, store);
+   if(record.data['pending'] || rowdef.multiValues){
+   pending = renderer(record.data['pending'], metaData, record, 
rowIndex, colIndex, store, 1);
}
}else{
current = value;
diff --git a/www/manager/qemu/HardwareView.js b/www/manager/qemu/HardwareView.js
index 7b7aae2..52ef129 100644
--- a/www/manager/qemu/HardwareView.js
+++ b/www/manager/qemu/HardwareView.js
@@ -61,14 +61,17 @@ Ext.define('PVE.qemu.HardwareView', {
'PVE.qemu.ProcessorEdit' : undefined,
tdCls: 'pve-itype-icon-processor',
defaultValue: 1,
-   renderer: function(value, metaData, record, rowIndex, colIndex, 
store) {
-   var model = me.getObjectValue('cpu');
-   var cores = me.getObjectValue('cores');
+   multiValues: 1,
+   renderer: function(value, metaData, record, rowIndex, colIndex, 
store, pending) {
+
+   var sockets = me.getObjectValue('sockets', undefined, 
pending);
+   var model = me.getObjectValue('cpu', undefined, pending);
+   var cores = me.getObjectValue('cores', undefined, pending);
var res = '';
if (!cores || (cores <= 1)) {
-   res = value;
+   res = sockets;
} else {
-   res = (value*cores) + ' (' + value + ' sockets, ' + 
cores + ' cores)';
+   res = (sockets*cores) + ' (' + sockets + ' sockets, ' + 
cores + ' cores)';
}
if (model) {
res += ' [' + model + ']';
-- 
1.7.10.4

___
pve-devel mailing list
pve-devel@pve.proxmox.com
http://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel


[pve-devel] [PATCH 4/5] forbid edit|delete of pending delete, and move_disk of pending disk

2014-12-29 Thread Alexandre Derumier

Signed-off-by: Alexandre Derumier 
---
 www/manager/qemu/HardwareView.js |9 +
 1 file changed, 9 insertions(+)

diff --git a/www/manager/qemu/HardwareView.js b/www/manager/qemu/HardwareView.js
index f05f2eb..7b7aae2 100644
--- a/www/manager/qemu/HardwareView.js
+++ b/www/manager/qemu/HardwareView.js
@@ -270,6 +270,9 @@ Ext.define('PVE.qemu.HardwareView', {
if (!rec) {
return false;
}
+   if(rec.data['delete']){
+   return false;
+   }
var rowdef = rows[rec.data.key];
return !!rowdef.editor;
},
@@ -298,6 +301,9 @@ Ext.define('PVE.qemu.HardwareView', {
if (!rec || rec.data.key.match(/^unused\d+/)) {
return false;
}
+   if(rec.data['pending'] || rec.data['delete']){
+   return false;
+   }
var rowdef = rows[rec.data.key];
return rowdef.tdCls == 'pve-itype-icon-storage' && 
!rec.data.value.match(/media=cdrom/);
},
@@ -336,6 +342,9 @@ Ext.define('PVE.qemu.HardwareView', {
if (!rec) {
return false;
}
+   if(rec.data['delete']){
+   return false;
+   }
var rowdef = rows[rec.data.key];
 
return rowdef.never_delete !== true;
-- 
1.7.10.4

___
pve-devel mailing list
pve-devel@pve.proxmox.com
http://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel


[pve-devel] [PATCH 5/5] fix balloon pending update

2014-12-29 Thread Alexandre Derumier

Signed-off-by: Alexandre Derumier 
---
 PVE/QemuServer.pm |   15 ---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
index df9ce74..a212183 100644
--- a/PVE/QemuServer.pm
+++ b/PVE/QemuServer.pm
@@ -3537,6 +3537,10 @@ sub vmconfig_hotplug_pending {
} elsif ($opt eq 'cores') {
die "skip\n" if !$hotplug;
qemu_cpu_hotplug($vmid, $conf, 1);
+} elsif ($opt eq 'balloon') {
+   #enable balloon device is not hotpluggable
+   die "skip\n" if ((defined($conf->{balloon})) && 
($conf->{balloon} == 0));
+} elsif ($opt eq 'shares') {
} elsif ($opt =~ m/^net(\d+)$/) {
die "skip\n" if !$hotplug;
vm_deviceunplug($vmid, $conf, $opt);
@@ -3574,10 +3578,15 @@ sub vmconfig_hotplug_pending {
die "skip\n" if !$hotplug;
qemu_cpu_hotplug($vmid, $conf, $value);
} elsif ($opt eq 'balloon') {
-   die "skip\n" if !(defined($conf->{shares}) && ($conf->{shares} 
== 0));
+   # disable balloning device is not hotpluggable
+   die "skip\n" if ((defined($conf->{pending}->{balloon})) && 
($conf->{pending}->{balloon} == 0));
+   # enable balloning device is not hotpluggable
+   die "skip\n" if ((defined($conf->{balloon})) && 
($conf->{balloon} == 0));
# allow manual ballooning if shares is set to zero
-   my $balloon = $conf->{pending}->{balloon} || $conf->{memory} || 
$defaults->{memory};
-   vm_mon_cmd($vmid, "balloon", value => $balloon*1024*1024);
+   if (!(defined($conf->{shares}) && ($conf->{shares} == 0))) {
+   my $balloon = $conf->{pending}->{balloon} || 
$conf->{memory} || $defaults->{memory};
+   vm_mon_cmd($vmid, "balloon", value => $balloon*1024*1024);
+   }
} elsif ($opt =~ m/^net(\d+)$/) { 
# some changes can be done without hotplug
vmconfig_update_net($storecfg, $conf, $vmid, $opt, $value);
-- 
1.7.10.4

___
pve-devel mailing list
pve-devel@pve.proxmox.com
http://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel


[pve-devel] [PATCH 1/5] pending : add disk hot-unplug

2014-12-29 Thread Alexandre Derumier

Signed-off-by: Alexandre Derumier 
---
 PVE/QemuServer.pm |4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
index ab8565d..1d85ac8 100644
--- a/PVE/QemuServer.pm
+++ b/PVE/QemuServer.pm
@@ -3541,7 +3541,9 @@ sub vmconfig_hotplug_pending {
die "skip\n" if !$hotplug;
vm_deviceunplug($vmid, $conf, $opt);
} elsif (valid_drivename($opt)) {
-   die "skip\n"; # we do not allow to hot-remove disk? 
+   die "skip\n" if !$hotplug;
+   vm_deviceunplug($vmid, $conf, $opt);
+   vmconfig_register_unused_drive($storecfg, $vmid, $conf, 
parse_drive($opt, $conf->{$opt}));
} else {
die "skip\n";
}
-- 
1.7.10.4

___
pve-devel mailing list
pve-devel@pve.proxmox.com
http://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel


[pve-devel] [PATCH 3/5] resize disk : allow resize pending disk

2014-12-29 Thread Alexandre Derumier

Signed-off-by: Alexandre Derumier 
---
 PVE/API2/Qemu.pm  |   18 ++
 PVE/QemuServer.pm |4 ++--
 2 files changed, 16 insertions(+), 6 deletions(-)

diff --git a/PVE/API2/Qemu.pm b/PVE/API2/Qemu.pm
index 4467837..6acef08 100644
--- a/PVE/API2/Qemu.pm
+++ b/PVE/API2/Qemu.pm
@@ -2752,9 +2752,15 @@ __PACKAGE__->register_method({
 if $digest && $digest ne $conf->{digest};
 PVE::QemuServer::check_lock($conf) if !$skiplock;
 
-   die "disk '$disk' does not exist\n" if !$conf->{$disk};
+   die "disk '$disk' does not exist\n" if !$conf->{$disk} && 
!$conf->{pending}->{$disk};
+   
+   my $drive = undef;
 
-   my $drive = PVE::QemuServer::parse_drive($disk, $conf->{$disk});
+   if($conf->{pending}->{$disk}) {
+   $drive = PVE::QemuServer::parse_drive($disk, 
$conf->{pending}->{$disk});
+   } else {
+   $drive = PVE::QemuServer::parse_drive($disk, $conf->{$disk});
+   }
 
my $volid = $drive->{file};
 
@@ -2790,11 +2796,15 @@ __PACKAGE__->register_method({
 
 PVE::Cluster::log_msg('info', $authuser, "update VM $vmid: resize 
--disk $disk --size $sizestr");
 
-   PVE::QemuServer::qemu_block_resize($vmid, "drive-$disk", $storecfg, 
$volid, $newsize);
+   PVE::QemuServer::qemu_block_resize($vmid, "drive-$disk", $storecfg, 
$volid, $newsize, $conf->{pending}->{$disk});
 
$drive->{size} = $newsize;
-   $conf->{$disk} = PVE::QemuServer::print_drive($vmid, $drive);
 
+   if ($conf->{pending}->{$disk}) {
+   $conf->{pending}->{$disk} = PVE::QemuServer::print_drive($vmid, 
$drive);
+   } else {
+   $conf->{$disk} = PVE::QemuServer::print_drive($vmid, $drive);
+   }
PVE::QemuServer::update_config_nolock($vmid, $conf, 1);
};
 
diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
index 1d85ac8..67e3015 100644
--- a/PVE/QemuServer.pm
+++ b/PVE/QemuServer.pm
@@ -3416,13 +3416,13 @@ sub vm_monitor_command {
 }
 
 sub qemu_block_resize {
-my ($vmid, $deviceid, $storecfg, $volid, $size) = @_;
+my ($vmid, $deviceid, $storecfg, $volid, $size, $pending) = @_;
 
 my $running = check_running($vmid);
 
 return if !PVE::Storage::volume_resize($storecfg, $volid, $size, $running);
 
-return if !$running;
+return if !$running || $pending;
 
 vm_mon_cmd($vmid, "block_resize", device => $deviceid, size => int($size));
 
-- 
1.7.10.4

___
pve-devel mailing list
pve-devel@pve.proxmox.com
http://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel


[pve-devel] [PATCH 2/5] add pending param to config api

2014-12-29 Thread Alexandre Derumier
return the config when pending changes applied

Signed-off-by: Alexandre Derumier 
---
 PVE/API2/Qemu.pm |   27 +--
 1 file changed, 25 insertions(+), 2 deletions(-)

diff --git a/PVE/API2/Qemu.pm b/PVE/API2/Qemu.pm
index fb36ce8..4467837 100644
--- a/PVE/API2/Qemu.pm
+++ b/PVE/API2/Qemu.pm
@@ -624,7 +624,7 @@ __PACKAGE__->register_method({
 path => '{vmid}/config',
 method => 'GET',
 proxyto => 'node',
-description => "Get current virtual machine configuration. This does not 
include pending configuration changes (see 'pending' API).",
+description => "Get current virtual machine configuration",
 permissions => {
check => ['perm', '/vms/{vmid}', [ 'VM.Audit' ]],
 },
@@ -633,6 +633,11 @@ __PACKAGE__->register_method({
properties => {
node => get_standard_option('pve-node'),
vmid => get_standard_option('pve-vmid'),
+pending => {
+optional => 1,
+type => 'boolean',
+description => "Get pending values instead running values",
+},
},
 },
 returns => {
@@ -650,6 +655,17 @@ __PACKAGE__->register_method({
my $conf = PVE::QemuServer::load_config($param->{vmid});
 
delete $conf->{snapshots};
+
+   if($param->{pending}){
+   foreach my $opt (keys $conf->{pending}) {
+   foreach my $opt 
(PVE::Tools::split_list($conf->{pending}->{delete})) {
+   delete $conf->{$opt} if $conf->{$opt};
+   }
+   next if ref($conf->{pending}->{$opt}); # just to be sure
+   $conf->{$opt} = $conf->{pending}->{$opt};
+   }
+   }
+
delete $conf->{pending};
 
return $conf;
@@ -1113,6 +1129,10 @@ __PACKAGE__->register_method({
maximum => 30,
optional => 1,
},
+   pending => {
+   optional => 1,
+   type => 'boolean',
+   }
}),
 },
 returns => {
@@ -1156,6 +1176,10 @@ __PACKAGE__->register_method({
maxLength => 40,
optional => 1,
},
+   pending => {
+   optional => 1,
+   type => 'boolean',
+   }
}),
 },
 returns => { type => 'null' },
@@ -1166,7 +1190,6 @@ __PACKAGE__->register_method({
 }
 });
 
-
 __PACKAGE__->register_method({
 name => 'destroy_vm',
 path => '{vmid}',
-- 
1.7.10.4

___
pve-devel mailing list
pve-devel@pve.proxmox.com
http://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel


[pve-devel] [PATCH 4/5] don't try to hotplug|unplug ide && sata drive

2014-12-29 Thread Alexandre Derumier
We can't hotplug theses devices,
so we can avoid to throw always an error when adding them

Signed-off-by: Alexandre Derumier 
---
 PVE/QemuServer.pm |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
index 67e3015..df9ce74 100644
--- a/PVE/QemuServer.pm
+++ b/PVE/QemuServer.pm
@@ -3541,7 +3541,7 @@ sub vmconfig_hotplug_pending {
die "skip\n" if !$hotplug;
vm_deviceunplug($vmid, $conf, $opt);
} elsif (valid_drivename($opt)) {
-   die "skip\n" if !$hotplug;
+   die "skip\n" if !$hotplug || $opt =~ m/(ide|sata)(\d+)/;
vm_deviceunplug($vmid, $conf, $opt);
vmconfig_register_unused_drive($storecfg, $vmid, $conf, 
parse_drive($opt, $conf->{$opt}));
} else {
@@ -3788,7 +3788,7 @@ sub vmconfig_update_disk {
}
 
 } else { 
-   die "skip\n" if !$conf->{hotplug};
+   die "skip\n" if !$conf->{hotplug} || $opt =~ m/(ide|sata)(\d+)/;   
# hotplug new disks
vm_deviceplug($storecfg, $conf, $vmid, $opt, $drive);
 }
-- 
1.7.10.4

___
pve-devel mailing list
pve-devel@pve.proxmox.com
http://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel


[pve-devel] qemu-server : pending patches v4

2014-12-29 Thread Alexandre Derumier
Here a new patch series with improvements and bugfix

___
pve-devel mailing list
pve-devel@pve.proxmox.com
http://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel


Re: [pve-devel] need help to debug random host freeze on multiple hosts

2014-12-29 Thread Michael Rasmussen
On Mon, 29 Dec 2014 07:31:32 +0100 (CET)
Alexandre DERUMIER  wrote:

> 
> Yes sure , I have nothing in logs.
> (That's why I thinked of kdump to try to have more info).
> 
> I'll really don't known if it's a software real kernel panic, or a hardware 
> bug.
> 
> I just see on vmware forum some amd microcode bug, and see that dell provide 
> a new bios update this month.
> I'll try to update to see if it's help.
> 
Could this, given the high load, be caused by a race condition which is
solved in the new microcode?

Have you tried connecting a serial console to one of the nodes?

If you have IPMI on the nodes you should also be able to monitor
further than on the default console.

-- 
Hilsen/Regards
Michael Rasmussen

Get my public GnuPG keys:
michael  rasmussen  cc
http://pgp.mit.edu:11371/pks/lookup?op=get&search=0xD3C9A00E
mir  datanom  net
http://pgp.mit.edu:11371/pks/lookup?op=get&search=0xE501F51C
mir  miras  org
http://pgp.mit.edu:11371/pks/lookup?op=get&search=0xE3E80917
--
/usr/games/fortune -es says:
We secure our friends not by accepting favors but by doing them.
-- Thucydides


pgpuijvDoPVbD.pgp
Description: OpenPGP digital signature
___
pve-devel mailing list
pve-devel@pve.proxmox.com
http://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel


[pve-devel] [PATCH] Change check for better understanding!

2014-12-29 Thread Wolfgang Link

Signed-off-by: Wolfgang Link 
---
 PVE/QemuServer.pm |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
index cb84f42..9ef186e 100644
--- a/PVE/QemuServer.pm
+++ b/PVE/QemuServer.pm
@@ -3724,7 +3724,7 @@ sub vm_stop {
 
eval {
if ($shutdown) {
-   if (!$nocheck && $conf->{agent}) {
+   if (defined($conf) && $conf->{agent}) {
vm_qmp_command($vmid, { execute => "guest-shutdown" }, 
$nocheck);
} else {
vm_qmp_command($vmid, { execute => "system_powerdown" }, 
$nocheck);
-- 
1.7.10.4


___
pve-devel mailing list
pve-devel@pve.proxmox.com
http://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel


Re: [pve-devel] need help to debug random host freeze on multiple hosts

2014-12-29 Thread Alexandre DERUMIER
I'm around 60-70% load on this quad opteron platforms. 

>>You have check too, that 60-70 % are normal use? 
Well, yes, Xmas period, so I have more traffic than usual.

>>You have Log-Files with 0 Bytes? (on host and in containers) 
No, all is fine

>>You have Hacking-Attacks from and to your servers? 
Everyday ;) But on the guests vms, not the host.
I thinked of a potential CVE in qemu and kvm, but even with updated qemu (2.2) 
or kvm host module with last rhe7.1 beta kernel,
it's crashing


>>Before freezing: 
>>
>>Is your memory consumption is going down? (htop) 
no
>>Scheduled/Running Prozesses going up? (htop) 
no
>>Disc-IO is going up? (atop) 
no



I really don't see nothing special when crash occur :(


- Mail original -
De: "Detlef Bracker" 
À: "aderumier" 
Envoyé: Lundi 29 Décembre 2014 09:29:54
Objet: Re: [pve-devel] need help to debug random host freeze on multiple hosts

You write: 

I'm around 60-70% load on this quad opteron platforms. 

You have check too, that 60-70 % are normal use? 
You have Log-Files with 0 Bytes? (on host and in containers) 
You have Hacking-Attacks from and to your servers? 

Before freezing: 

Is your memory consumption is going down? (htop) 
Scheduled/Running Prozesses going up? (htop) 
Disc-IO is going up? (atop) 

Regards 

Detlef 

___
pve-devel mailing list
pve-devel@pve.proxmox.com
http://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel