ShaoHe Feng has uploaded a new change for review.
Change subject: Added an option to create a watchdog device. ......................................................................
Added an option to create a watchdog device.
A support for a watchdog device was added to the "devices" configuration.
Also add the watchdog event callback.
model of watchdog: 'i6300esb' default model, emulating a PCI Intel 6300ESB 'ib700' emulating an ISA iBase IB700
action of watchdog: 'reset' default, forcefully reset the guest 'shutdown' gracefully shutdown the guest (not recommended) 'poweroff' forcefully power off the guest 'pause' pause the guest 'none' do nothing 'dump' automatically dump the guest
The watchdog device can used to detect guest crash, and if choose 'dump' action, the libvirt will dump the guest automatically. The directory to save dump files can be configured by auto_dump_path in file /etc/libvirt/qemu.conf.
The watchdog device requires an additional driver and management daemon in the guest. Just enabling the watchdog in the vdsm "devices" configuration does not do anything useful on its own.
Change-Id: I2b7970a9050ab0279fe03371b9a77692fba30af8 Signed-off-by: ShaoHe Feng shaohef@linux.vnet.ibm.com --- M vdsm/libvirtconnection.py M vdsm/libvirtev.py M vdsm/libvirtvm.py M vdsm/vm.py 4 files changed, 102 insertions(+), 3 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/35/7535/1
diff --git a/vdsm/libvirtconnection.py b/vdsm/libvirtconnection.py index e525996..25e2494 100644 --- a/vdsm/libvirtconnection.py +++ b/vdsm/libvirtconnection.py @@ -63,6 +63,12 @@ elif eventid == libvirt.VIR_DOMAIN_EVENT_ID_BLOCK_JOB: path, type, status = args[:-1] v._onBlockJobEvent(path, type, status) + elif eventid == libvirt.VIR_DOMAIN_EVENT_ID_WATCHDOG: + wdargs = args[:-1] + action = libvirtev.watchdogActionToString(wdargs[0]) + cif.log.debug("watchdog event: Domain %s(%s). Action: %s", + dom.name(), dom.ID(), action) + v._onWatchdogEvent(dom.name(), dom.ID(), action) else: v.log.warning('unknown eventid %s args %s', eventid, args) except: @@ -118,7 +124,8 @@ libvirt.VIR_DOMAIN_EVENT_ID_RTC_CHANGE, libvirt.VIR_DOMAIN_EVENT_ID_IO_ERROR_REASON, libvirt.VIR_DOMAIN_EVENT_ID_GRAPHICS, - libvirt.VIR_DOMAIN_EVENT_ID_BLOCK_JOB): + libvirt.VIR_DOMAIN_EVENT_ID_BLOCK_JOB, + libvirt.VIR_DOMAIN_EVENT_ID_WATCHDOG): conn.domainEventRegisterAny(None, ev, __eventCallback, (cif, ev)) for name in dir(libvirt.virConnect): diff --git a/vdsm/libvirtev.py b/vdsm/libvirtev.py index 92a7a0e..b12b916 100644 --- a/vdsm/libvirtev.py +++ b/vdsm/libvirtev.py @@ -444,6 +444,16 @@ return eventStrings[event]
+def watchdogActionToString(action): + actionStrings = ("No action, watchdog ignored", + "Guest CPUs are paused", + "Guest CPUs are reset", + "Guest is forcably powered off", + "Guest is requested to gracefully shutdown", + "No action, a debug message logged") + return actionStrings[action] + + def myDomainEventCallback1(conn, dom, event, detail, opaque): print ("myDomainEventCallback1 EVENT: Domain %s(%s) %s %d" % (dom.name(), dom.ID(), eventToString(event), detail)) diff --git a/vdsm/libvirtvm.py b/vdsm/libvirtvm.py index e95e94b..cc75d78 100644 --- a/vdsm/libvirtvm.py +++ b/vdsm/libvirtvm.py @@ -1188,6 +1188,20 @@ m.setAttribute('model', self.specParams['model']) return m
+class WatchdogDevice(LibvirtVmDevice): + def getXML(self): + """ + Create domxml for a watchdog device. + + <watchdog model='i6300esb' action='dump'> + <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/> + </watchdog> + """ + m = self.createXmlElem(self.type, None, ['address']) + m.setAttribute('model', self.specParams['model']) + if 'action' in self.specParams: + m.setAttribute('action', self.specParams['action']) + return m
class RedirDevice(LibvirtVmDevice): def getXML(self): @@ -1331,6 +1345,7 @@ self._getUnderlyingVideoDeviceInfo() self._getUnderlyingControllerDeviceInfo() self._getUnderlyingBalloonDeviceInfo() + self._getUnderlyingWatchdogDeviceInfo() # Obtain info of all unknown devices. Must be last! self._getUnderlyingUnknownDeviceInfo()
@@ -1420,6 +1435,7 @@ vm.CONTROLLER_DEVICES: ControllerDevice, vm.GENERAL_DEVICES: GeneralDevice, vm.BALLOON_DEVICES: BalloonDevice, + vm.WATCHDOG_DEVICES: WatchdogDevice, vm.REDIR_DEVICES: RedirDevice}
for devType, devClass in devMap.items(): @@ -2031,6 +2047,10 @@
self.saveState()
+ def _onWatchdogEvent(self, name, vmid, action): + self.log.debug("Watchdog event comes from guest %s(%s). " + "Action: %s", name, vmid, action) + def changeCD(self, drivespec): return self._changeBlockDev('cdrom', 'hdc', drivespec)
@@ -2374,6 +2394,38 @@ dev['address'] = address dev['alias'] = alias
+ def _getUnderlyingWatchdogDeviceInfo(self): + """ + Obtain watchdog device info from libvirt. + """ + watchdogxml = _domParseStr(self._lastXMLDesc).childNodes[0]. \ + getElementsByTagName('devices')[0]. \ + getElementsByTagName('watchdog') + for x in watchdogxml: + action = x.getAttribute('action') + # Ignore watchdog device without address. + if not x.getElementsByTagName('address'): + continue + + address = self._getUnderlyingDeviceAddress(x) + alias = x.getElementsByTagName('alias')[0].getAttribute('name') + + for dev in self._devices[vm.WATCHDOG_DEVICES]: + if not hasattr(dev, 'address'): + dev.address = address + dev.alias = alias + if not "action" in dev.specParams: + dev.specParams['action'] = action + + for dev in self.conf['devices']: + if ((dev['type'] == vm.WATCHDOG_DEVICES) and + not dev.get('address')): + dev['address'] = address + dev['alias'] = alias + if ((dev['type'] == vm.WATCHDOG_DEVICES) and + not "action" in dev['specParams']): + dev['specParams']['action'] = action + def _getUnderlyingVideoDeviceInfo(self): """ Obtain video devices info from libvirt. diff --git a/vdsm/vm.py b/vdsm/vm.py index 949a3ee..d24d1a4 100644 --- a/vdsm/vm.py +++ b/vdsm/vm.py @@ -45,6 +45,7 @@ GENERAL_DEVICES = 'general' BALLOON_DEVICES = 'balloon' REDIR_DEVICES = 'redir' +WATCHDOG_DEVICES = 'watchdog'
""" A module containing classes needed for VM communication. @@ -310,7 +311,8 @@ self._devices = {DISK_DEVICES: [], NIC_DEVICES: [], SOUND_DEVICES: [], VIDEO_DEVICES: [], CONTROLLER_DEVICES: [], GENERAL_DEVICES: [], - BALLOON_DEVICES: [], REDIR_DEVICES: []} + BALLOON_DEVICES: [], REDIR_DEVICES: [], + WATCHDOG_DEVICES: [],}
def _get_lastStatus(self): SHOW_PAUSED_STATES = ('Powering down', 'RebootInProgress', 'Up') @@ -381,11 +383,24 @@ 'index': 0, 'truesize': 0}) return removables
+ def _removeRedundantDevices(self, devices): + counters = 0 + for dev in self.conf['devices']: + if (dev['type'] == devices): + counters += 1 + if (counters > 1): + self.conf['devices'].remove(dev) + if (counters > 1): + self.log.warning("%d redundant %s devices are removed", + counters-1, devices) + return counters + def getConfDevices(self): devices = {DISK_DEVICES: [], NIC_DEVICES: [], SOUND_DEVICES: [], VIDEO_DEVICES: [], CONTROLLER_DEVICES: [], GENERAL_DEVICES: [], - BALLOON_DEVICES: [], REDIR_DEVICES: []} + BALLOON_DEVICES: [], REDIR_DEVICES: [], + WATCHDOG_DEVICES: []} for dev in self.conf.get('devices'): try: devices[dev['type']].append(dev) @@ -417,8 +432,23 @@ devices[CONTROLLER_DEVICES] = self.getConfController() devices[GENERAL_DEVICES] = [] devices[BALLOON_DEVICES] = [] + devices[WATCHDOG_DEVICES] = [] devices[REDIR_DEVICES] = [] else: + # libvirt only support one watchdog device + # before getting devices list, check WATCHDOG_DEVICES and + # try to remove redundant watchdog devices + self._removeRedundantDevices(WATCHDOG_DEVICES) + # must assign the model for watchdog device to libvirt + # but the action can be assigned default by libvirt + # so ignore the action + for dev in self.conf['devices']: + if (dev['type'] == WATCHDOG_DEVICES): + if not 'specParams' in dev: + dev['specParams'] = {} + if not 'model' in dev['specParams']: + dev['specParams']['model'] = 'i6300esb' + devices = self.getConfDevices()
# Normalize vdsm images
-- To view, visit http://gerrit.ovirt.org/7535 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange Gerrit-Change-Id: I2b7970a9050ab0279fe03371b9a77692fba30af8 Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: ShaoHe Feng shaohef@linux.vnet.ibm.com
oVirt Jenkins CI Server has posted comments on this change.
Change subject: Added an option to create a watchdog device. ......................................................................
Patch Set 2:
Build Successful
http://jenkins.ovirt.info/job/patch_vdsm_unit_tests/722/ : SUCCESS
-- To view, visit http://gerrit.ovirt.org/7535 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: I2b7970a9050ab0279fe03371b9a77692fba30af8 Gerrit-PatchSet: 2 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: ShaoHe Feng shaohef@linux.vnet.ibm.com Gerrit-Reviewer: Adam Litke agl@us.ibm.com Gerrit-Reviewer: Bing Bu Cao mars@linux.vnet.ibm.com Gerrit-Reviewer: Mark Wu wudxw@linux.vnet.ibm.com Gerrit-Reviewer: Ryan Harper ryanh@us.ibm.com Gerrit-Reviewer: ShaoHe Feng shaohef@linux.vnet.ibm.com Gerrit-Reviewer: Shu Ming shuming@linux.vnet.ibm.com Gerrit-Reviewer: Zhou Zheng Sheng zhshzhou@linux.vnet.ibm.com Gerrit-Reviewer: oVirt Jenkins CI Server
Bing Bu Cao has posted comments on this change.
Change subject: Added an option to create a watchdog device. ......................................................................
Patch Set 2: I would prefer that you didn't submit this
(1 inline comment)
.................................................... File vdsm/vm.py Line 382: 'path': floppyPath, 'iface': 'fdc', Line 383: 'index': 0, 'truesize': 0}) Line 384: return removables Line 385: Line 386: def _removeRedundantDevices(self, devices): I think removing one device is a really bad idea. Why not report error?
And also it is so expensive to add one function here to remove the multiple devices ,but it only happens in this patch case. So if must do that, please move this part to LINE 441. Line 387: counters = 0 Line 388: for dev in self.conf['devices']: Line 389: if (dev['type'] == devices): Line 390: counters += 1
-- To view, visit http://gerrit.ovirt.org/7535 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: I2b7970a9050ab0279fe03371b9a77692fba30af8 Gerrit-PatchSet: 2 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: ShaoHe Feng shaohef@linux.vnet.ibm.com Gerrit-Reviewer: Adam Litke agl@us.ibm.com Gerrit-Reviewer: Bing Bu Cao mars@linux.vnet.ibm.com Gerrit-Reviewer: Mark Wu wudxw@linux.vnet.ibm.com Gerrit-Reviewer: Ryan Harper ryanh@us.ibm.com Gerrit-Reviewer: ShaoHe Feng shaohef@linux.vnet.ibm.com Gerrit-Reviewer: Shu Ming shuming@linux.vnet.ibm.com Gerrit-Reviewer: Xu He Jie xuhj@linux.vnet.ibm.com Gerrit-Reviewer: Zhou Zheng Sheng zhshzhou@linux.vnet.ibm.com Gerrit-Reviewer: oVirt Jenkins CI Server
ShaoHe Feng has posted comments on this change.
Change subject: Added an option to create a watchdog device. ......................................................................
Patch Set 2: (1 inline comment)
.................................................... File vdsm/vm.py Line 382: 'path': floppyPath, 'iface': 'fdc', Line 383: 'index': 0, 'truesize': 0}) Line 384: return removables Line 385: Line 386: def _removeRedundantDevices(self, devices): why libvirt only support one watchdog? IMO, one watchdog is enough, and the libvirt recommend i6300esb model, so I'm considering remove the model configure. Just expose the action to user.
so user can only configure the watchdog action. actually, user seldom will add two watchdog device with conflict action configure. In case two watchdog device,This _removeRedundantDevices will remove one. I think it is no need to abort to create the VM. Line 387: counters = 0 Line 388: for dev in self.conf['devices']: Line 389: if (dev['type'] == devices): Line 390: counters += 1
-- To view, visit http://gerrit.ovirt.org/7535 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: I2b7970a9050ab0279fe03371b9a77692fba30af8 Gerrit-PatchSet: 2 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: ShaoHe Feng shaohef@linux.vnet.ibm.com Gerrit-Reviewer: Adam Litke agl@us.ibm.com Gerrit-Reviewer: Bing Bu Cao mars@linux.vnet.ibm.com Gerrit-Reviewer: Mark Wu wudxw@linux.vnet.ibm.com Gerrit-Reviewer: Ryan Harper ryanh@us.ibm.com Gerrit-Reviewer: ShaoHe Feng shaohef@linux.vnet.ibm.com Gerrit-Reviewer: Shu Ming shuming@linux.vnet.ibm.com Gerrit-Reviewer: Xu He Jie xuhj@linux.vnet.ibm.com Gerrit-Reviewer: Zhou Zheng Sheng zhshzhou@linux.vnet.ibm.com Gerrit-Reviewer: oVirt Jenkins CI Server
Ryan Harper has posted comments on this change.
Change subject: Added an option to create a watchdog device. ......................................................................
Patch Set 2: I would prefer that you didn't submit this
(2 inline comments)
I'd like to see this patch series also include changes to qemu.conf with auto_dump_path, and we need to decide where to put guest watchdog dumps as well (on the host). Maybe in the same place as the core files. This needs discussion on vdsm-devel.
Also, I like the idea of only exposing watchdog actions to the vm config instead of being able to add multiple watchdogs and then removing all but one of them. If the user can only specify the action, then multiple calls will only result in one watchdog with whatever the latest action value was passed.
.................................................... File vdsm/libvirtvm.py Line 1195: Create domxml for a watchdog device. Line 1196: Line 1197: <watchdog model='i6300esb' action='dump'> Line 1198: <address type='pci' domain='0x0000' bus='0x00' slot='0x07' Line 1199: function='0x0'/> You should leave out the <address> tag. Libvirt will automatically assign a pci slot for the devices. The code right now will put the watchdog always in slot 0x07 but this may collide with other devices.
Also, have we discussed the default action? Do we always want dump by default? If so, have we updated the vdsm changes to qemu.conf to put dumps in a common location? Line 1200: </watchdog> Line 1201: """ Line 1202: m = self.createXmlElem(self.type, None, ['address']) Line 1203: m.setAttribute('model', self.specParams['model'])
Line 2405: getElementsByTagName('devices')[0]. \ Line 2406: getElementsByTagName('watchdog') Line 2407: for x in watchdogxml: Line 2408: action = x.getAttribute('action') Line 2409: # Ignore watchdog device without address. Why? Line 2410: if not x.getElementsByTagName('address'): Line 2411: continue Line 2412: Line 2413: address = self._getUnderlyingDeviceAddress(x)
-- To view, visit http://gerrit.ovirt.org/7535 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: I2b7970a9050ab0279fe03371b9a77692fba30af8 Gerrit-PatchSet: 2 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: ShaoHe Feng shaohef@linux.vnet.ibm.com Gerrit-Reviewer: Adam Litke agl@us.ibm.com Gerrit-Reviewer: Bing Bu Cao mars@linux.vnet.ibm.com Gerrit-Reviewer: Mark Wu wudxw@linux.vnet.ibm.com Gerrit-Reviewer: Ryan Harper ryanh@us.ibm.com Gerrit-Reviewer: ShaoHe Feng shaohef@linux.vnet.ibm.com Gerrit-Reviewer: Shu Ming shuming@linux.vnet.ibm.com Gerrit-Reviewer: Xu He Jie xuhj@linux.vnet.ibm.com Gerrit-Reviewer: Zhou Zheng Sheng zhshzhou@linux.vnet.ibm.com Gerrit-Reviewer: oVirt Jenkins CI Server
ShaoHe Feng has posted comments on this change.
Change subject: Added an option to create a watchdog device. ......................................................................
Patch Set 2:
changes to qemu.conf with auto_dump_path will be in another patch.
It is better to add a new API to list and download files on the host. maybe not only dump files.
now the new patch will check the number of Wathchdog device, and throw an Exception
-- To view, visit http://gerrit.ovirt.org/7535 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: I2b7970a9050ab0279fe03371b9a77692fba30af8 Gerrit-PatchSet: 2 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: ShaoHe Feng shaohef@linux.vnet.ibm.com Gerrit-Reviewer: Adam Litke agl@us.ibm.com Gerrit-Reviewer: Bing Bu Cao mars@linux.vnet.ibm.com Gerrit-Reviewer: Mark Wu wudxw@linux.vnet.ibm.com Gerrit-Reviewer: Ryan Harper ryanh@us.ibm.com Gerrit-Reviewer: ShaoHe Feng shaohef@linux.vnet.ibm.com Gerrit-Reviewer: Shu Ming shuming@linux.vnet.ibm.com Gerrit-Reviewer: Xu He Jie xuhj@linux.vnet.ibm.com Gerrit-Reviewer: Zhou Zheng Sheng zhshzhou@linux.vnet.ibm.com Gerrit-Reviewer: oVirt Jenkins CI Server
Ryan Harper has posted comments on this change.
Change subject: Add an option to create a watchdog device. ......................................................................
Patch Set 4: I would prefer that you didn't submit this
Before you add a new API to list debuging core dump files, at least configure the qemu.conf auto_dump_path so we can have a common location where the dumps will be avaiable.
You can later post a series on a new API call to fetch debugging info which may include more data than just the watchdog dump file.
-- To view, visit http://gerrit.ovirt.org/7535 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: I2b7970a9050ab0279fe03371b9a77692fba30af8 Gerrit-PatchSet: 4 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: ShaoHe Feng shaohef@linux.vnet.ibm.com Gerrit-Reviewer: Adam Litke agl@us.ibm.com Gerrit-Reviewer: Bing Bu Cao mars@linux.vnet.ibm.com Gerrit-Reviewer: Mark Wu wudxw@linux.vnet.ibm.com Gerrit-Reviewer: Ryan Harper ryanh@us.ibm.com Gerrit-Reviewer: ShaoHe Feng shaohef@linux.vnet.ibm.com Gerrit-Reviewer: Shu Ming shuming@linux.vnet.ibm.com Gerrit-Reviewer: Xu He Jie xuhj@linux.vnet.ibm.com Gerrit-Reviewer: Zhou Zheng Sheng zhshzhou@linux.vnet.ibm.com Gerrit-Reviewer: oVirt Jenkins CI Server
Mark Wu has posted comments on this change.
Change subject: Add an option to create a watchdog device. ......................................................................
Patch Set 4: I would prefer that you didn't submit this
(13 inline comments)
.................................................... Commit Message Line 8: Line 9: A support for a watchdog device was added to the "devices" Line 10: configuration. Line 11: Line 12: Also add the watchdog event callback. Add a description for what you do in the callback function. Line 13: Line 14: model of watchdog: Line 15: 'i6300esb' default model, emulating a PCI Intel 6300ESB Line 16: 'ib700' emulating an ISA iBase IB700
Line 13: Line 14: model of watchdog: Line 15: 'i6300esb' default model, emulating a PCI Intel 6300ESB Line 16: 'ib700' emulating an ISA iBase IB700 Line 17: only one watchdog device was support. Only one watchdog device is supported for each VM. Line 18: Line 19: action of watchdog: Line 20: 'reset' default, forcefully reset the guest Line 21: 'shutdown' gracefully shutdown the guest (not recommended)
Line 15: 'i6300esb' default model, emulating a PCI Intel 6300ESB Line 16: 'ib700' emulating an ISA iBase IB700 Line 17: only one watchdog device was support. Line 18: Line 19: action of watchdog: action of watchdog timeout ? Line 20: 'reset' default, forcefully reset the guest Line 21: 'shutdown' gracefully shutdown the guest (not recommended) Line 22: 'poweroff' forcefully power off the guest Line 23: 'pause' pause the guest
Line 26: Line 27: the parameter of 'watchdog' device as follow: Line 28: {'device': 'watchdog', 'type': 'watchdog', Line 29: 'specParams': {'model': 'i6300esb', 'action': 'reset'}} Line 30: Move line 14 to line 30 to api schema Line 31: The watchdog device can used to detect guest crash, and if choose Line 32: 'dump' action, the libvirt will dump the guest automatically. Line 33: The directory to save dump files can be configured by auto_dump_path Line 34: in file /etc/libvirt/qemu.conf.
Line 27: the parameter of 'watchdog' device as follow: Line 28: {'device': 'watchdog', 'type': 'watchdog', Line 29: 'specParams': {'model': 'i6300esb', 'action': 'reset'}} Line 30: Line 31: The watchdog device can used to detect guest crash, and if choose can be used ... guest crash or hang, and if 'dump' is chosen for the action of watchdog timeout Line 32: 'dump' action, the libvirt will dump the guest automatically. Line 33: The directory to save dump files can be configured by auto_dump_path Line 34: in file /etc/libvirt/qemu.conf. Line 35:
Line 28: {'device': 'watchdog', 'type': 'watchdog', Line 29: 'specParams': {'model': 'i6300esb', 'action': 'reset'}} Line 30: Line 31: The watchdog device can used to detect guest crash, and if choose Line 32: 'dump' action, the libvirt will dump the guest automatically. 'dump' action, libvirt will dump guest's memory on timeout automatically. Line 33: The directory to save dump files can be configured by auto_dump_path Line 34: in file /etc/libvirt/qemu.conf. Line 35: Line 36: The watchdog device requires an additional driver and management
.................................................... File vdsm/libvirtconnection.py Line 63: elif eventid == libvirt.VIR_DOMAIN_EVENT_ID_BLOCK_JOB: Line 64: path, type, status = args[:-1] Line 65: v._onBlockJobEvent(path, type, status) Line 66: elif eventid == libvirt.VIR_DOMAIN_EVENT_ID_WATCHDOG: Line 67: wdargs = args[:-1] why introduce a new variable? Can you use agrs directly? Line 68: action = libvirtev.watchdogActionToString(wdargs[0]) Line 69: cif.log.debug("watchdog event: Domain %s(%s). Action: %s", Line 70: dom.name(), dom.ID(), action) Line 71: v._onWatchdogEvent(dom.name(), dom.ID(), action)
Line 66: elif eventid == libvirt.VIR_DOMAIN_EVENT_ID_WATCHDOG: Line 67: wdargs = args[:-1] Line 68: action = libvirtev.watchdogActionToString(wdargs[0]) Line 69: cif.log.debug("watchdog event: Domain %s(%s). Action: %s", Line 70: dom.name(), dom.ID(), action) Why not using UUID? Move the log into _onWatchdogEvent ? Line 71: v._onWatchdogEvent(dom.name(), dom.ID(), action) Line 72: else: Line 73: v.log.warning('unknown eventid %s args %s', eventid, args) Line 74: except:
.................................................... File vdsm/libvirtev.py Line 452: "Guest is requested to gracefully shutdown", Line 453: "No action, a debug message logged") Line 454: return actionStrings[action] Line 455: Line 456: Move this convert function to libvirtvm.py, and it should be only used for onWatchdogEvent() Line 457: def myDomainEventCallback1(conn, dom, event, detail, opaque): Line 458: print ("myDomainEventCallback1 EVENT: Domain %s(%s) %s %d" % Line 459: (dom.name(), dom.ID(), eventToString(event), detail)) Line 460:
.................................................... File vdsm/libvirtvm.py Line 2364: getElementsByTagName('watchdog') Line 2365: for x in watchdogxml: Line 2366: action = x.getAttribute('action') Line 2367: Line 2368: # PCI watchdog has "address" different with ISA watchdog s/different with ISA watchdog/different from ISA watchdog/ Line 2369: if x.getElementsByTagName('address'): Line 2370: address = self._getUnderlyingDeviceAddress(x) Line 2371: alias = x.getElementsByTagName('alias')[0].getAttribute('name') Line 2372:
.................................................... File vdsm/vm.py Line 401: # Update indices for drives devices Line 402: self.normalizeDrivesIndices(devices[DISK_DEVICES]) Line 403: return devices Line 404: Line 405: def checkWatchdogModel(self, dev): is it worth to define a new function? Line 406: if (dev['type'] == WATCHDOG_DEVICES): Line 407: if not 'specParams' in dev: Line 408: dev['specParams'] = {} Line 409: if not 'model' in dev['specParams']:
Line 402: self.normalizeDrivesIndices(devices[DISK_DEVICES]) Line 403: return devices Line 404: Line 405: def checkWatchdogModel(self, dev): Line 406: if (dev['type'] == WATCHDOG_DEVICES): is this check necessary? Line 407: if not 'specParams' in dev: Line 408: dev['specParams'] = {} Line 409: if not 'model' in dev['specParams']: Line 410: dev['specParams']['model'] = 'i6300esb'
Line 434: devices = self.getConfDevices() Line 435: Line 436: # libvirt only support one watchdog device Line 437: if len(devices[BALLOON_DEVICES]) > 1: Line 438: raise Exception("only a single watchdog device is supported") You shouldn't raise a generic exception. Line 439: if len(devices[BALLOON_DEVICES]) == 1: Line 440: self.checkWatchdogModel(devices[BALLOON_DEVICES][0]) Line 441: Line 442: # Normalize vdsm images
-- To view, visit http://gerrit.ovirt.org/7535 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: I2b7970a9050ab0279fe03371b9a77692fba30af8 Gerrit-PatchSet: 4 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: ShaoHe Feng shaohef@linux.vnet.ibm.com Gerrit-Reviewer: Adam Litke agl@us.ibm.com Gerrit-Reviewer: Bing Bu Cao mars@linux.vnet.ibm.com Gerrit-Reviewer: Mark Wu wudxw@linux.vnet.ibm.com Gerrit-Reviewer: Ryan Harper ryanh@us.ibm.com Gerrit-Reviewer: ShaoHe Feng shaohef@linux.vnet.ibm.com Gerrit-Reviewer: Shu Ming shuming@linux.vnet.ibm.com Gerrit-Reviewer: Xu He Jie xuhj@linux.vnet.ibm.com Gerrit-Reviewer: Zhou Zheng Sheng zhshzhou@linux.vnet.ibm.com Gerrit-Reviewer: oVirt Jenkins CI Server
Shu Ming has posted comments on this change.
Change subject: Add an option to create a watchdog device. ......................................................................
Patch Set 6: I would prefer that you didn't submit this
(1 inline comment)
.................................................... File vdsm/vm.py Line 426: else: Line 427: devices = self.getConfDevices() Line 428: Line 429: # libvirt only support one watchdog device Line 430: if len(devices[BALLOON_DEVICES]) > 1: Do you mean 'devices[WATCHDOG_DEVICES}' instead of 'devices[BALOON_DEVICES]' here? And the same questions as lines below. Line 431: raise ValueError("only a single watchdog device is supported") Line 432: if len(devices[BALLOON_DEVICES]) == 1: Line 433: if not 'specParams' in devices[BALLOON_DEVICES][0]: Line 434: devices[BALLOON_DEVICES][0]['specParams'] = {}
-- To view, visit http://gerrit.ovirt.org/7535 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: I2b7970a9050ab0279fe03371b9a77692fba30af8 Gerrit-PatchSet: 6 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: ShaoHe Feng shaohef@linux.vnet.ibm.com Gerrit-Reviewer: Adam Litke agl@us.ibm.com Gerrit-Reviewer: Bing Bu Cao mars@linux.vnet.ibm.com Gerrit-Reviewer: Mark Wu wudxw@linux.vnet.ibm.com Gerrit-Reviewer: Ryan Harper ryanh@us.ibm.com Gerrit-Reviewer: ShaoHe Feng shaohef@linux.vnet.ibm.com Gerrit-Reviewer: Shu Ming shuming@linux.vnet.ibm.com Gerrit-Reviewer: Xu He Jie xuhj@linux.vnet.ibm.com Gerrit-Reviewer: Zhou Zheng Sheng zhshzhou@linux.vnet.ibm.com Gerrit-Reviewer: oVirt Jenkins CI Server
Ryan Harper has posted comments on this change.
Change subject: Add an option to create a watchdog device. ......................................................................
Patch Set 7: I would prefer that you didn't submit this
(1 inline comment)
.................................................... File vdsm/libvirtvm.py Line 2015: "Guest CPUs are reset", Line 2016: "Guest is forcably powered off", Line 2017: "Guest is requested to gracefully shutdown", Line 2018: "No action, a debug message logged") Line 2019: return actionStrings[action] I don't see libvirt python bindings that translate the action value to the readable string. So for now, we should at least reference this list of actions (0-5) on the libvirt api page in comment so we can see where they came from.
Second, I think we should guard against action value greater than 5, your indexing operation will blow up if the action isn't less than the size of your string array.
Something like, if action is not in range(0,5), raise or log an error, received unknown watchdog action and provide the value. Line 2020: self.log.debug("Watchdog event comes from guest %s(%s). " Line 2021: "Action: %s", name, vmid, actionToString(action)) Line 2022: Line 2023: def changeCD(self, drivespec):
-- To view, visit http://gerrit.ovirt.org/7535 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: I2b7970a9050ab0279fe03371b9a77692fba30af8 Gerrit-PatchSet: 7 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: ShaoHe Feng shaohef@linux.vnet.ibm.com Gerrit-Reviewer: Adam Litke agl@us.ibm.com Gerrit-Reviewer: Bing Bu Cao mars@linux.vnet.ibm.com Gerrit-Reviewer: Mark Wu wudxw@linux.vnet.ibm.com Gerrit-Reviewer: Ryan Harper ryanh@us.ibm.com Gerrit-Reviewer: ShaoHe Feng shaohef@linux.vnet.ibm.com Gerrit-Reviewer: Shu Ming shuming@linux.vnet.ibm.com Gerrit-Reviewer: Xu He Jie xuhj@linux.vnet.ibm.com Gerrit-Reviewer: Zhou Zheng Sheng zhshzhou@linux.vnet.ibm.com Gerrit-Reviewer: oVirt Jenkins CI Server
Doron Fediuck has posted comments on this change.
Change subject: Add an option to create a watchdog device. ......................................................................
Patch Set 8: I would prefer that you didn't submit this
(1 inline comment)
ShaoHe, since vdsm is included in ovirt-node, you need to verify the patch you chose to hold the dump files exists and is capable of holding these files. Please contact mburns@redhat.com or any of the node dev's to make sure this will not break the node integration.
.................................................... File vdsm/vdsmd.init.in Line 31: RESPAWNPIDFILE=@VDSMRUNDIR@/respawn.pid Line 32: CORE_DUMP_PATH=/var/log/core/core.%p.%t.dump Line 33: DOM_METADATA_BACKUP_DIR=/var/log/vdsm/backup Line 34: CORE_PATTERN=/proc/sys/kernel/core_pattern Line 35: QEMU_DUMP_PATH="/var/lib/vdsm/dump" You need to verify this path exists in ovirt node and has a capacity to hold the expected output. Line 36: NEEDED_SERVICES="iscsid multipathd ntpd wdmd sanlock" Line 37: CONFLICTING_SERVICES="libvirt-guests" Line 38: Line 39: LCONF=/etc/libvirt/libvirtd.conf
-- To view, visit http://gerrit.ovirt.org/7535 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: I2b7970a9050ab0279fe03371b9a77692fba30af8 Gerrit-PatchSet: 8 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: ShaoHe Feng shaohef@linux.vnet.ibm.com Gerrit-Reviewer: Adam Litke agl@us.ibm.com Gerrit-Reviewer: Bing Bu Cao mars@linux.vnet.ibm.com Gerrit-Reviewer: Doron Fediuck dfediuck@redhat.com Gerrit-Reviewer: Mark Wu wudxw@linux.vnet.ibm.com Gerrit-Reviewer: Ryan Harper ryanh@us.ibm.com Gerrit-Reviewer: ShaoHe Feng shaohef@linux.vnet.ibm.com Gerrit-Reviewer: Shu Ming shuming@linux.vnet.ibm.com Gerrit-Reviewer: Xu He Jie xuhj@linux.vnet.ibm.com Gerrit-Reviewer: Zhou Zheng Sheng zhshzhou@linux.vnet.ibm.com Gerrit-Reviewer: oVirt Jenkins CI Server
Michael Burns has posted comments on this change.
Change subject: Add an option to create a watchdog device. ......................................................................
Patch Set 8: I would prefer that you didn't submit this
(1 inline comment)
.................................................... File vdsm/vdsmd.init.in Line 31: RESPAWNPIDFILE=@VDSMRUNDIR@/respawn.pid Line 32: CORE_DUMP_PATH=/var/log/core/core.%p.%t.dump Line 33: DOM_METADATA_BACKUP_DIR=/var/log/vdsm/backup Line 34: CORE_PATTERN=/proc/sys/kernel/core_pattern Line 35: QEMU_DUMP_PATH="/var/lib/vdsm/dump" Any reason we can't send this to /var/log/core? We persist that to /data so it's not in-memory and persists across reboots.
The location does exist and would *work*, but you'd be consuming available memory every time this happens and a reboot would wipe the file out.
Also worth noting that there is no facility to read or retrieve this dump on ovirt-node Line 36: NEEDED_SERVICES="iscsid multipathd ntpd wdmd sanlock" Line 37: CONFLICTING_SERVICES="libvirt-guests" Line 38: Line 39: LCONF=/etc/libvirt/libvirtd.conf
-- To view, visit http://gerrit.ovirt.org/7535 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: I2b7970a9050ab0279fe03371b9a77692fba30af8 Gerrit-PatchSet: 8 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: ShaoHe Feng shaohef@linux.vnet.ibm.com Gerrit-Reviewer: Adam Litke agl@us.ibm.com Gerrit-Reviewer: Bing Bu Cao mars@linux.vnet.ibm.com Gerrit-Reviewer: Doron Fediuck dfediuck@redhat.com Gerrit-Reviewer: Mark Wu wudxw@linux.vnet.ibm.com Gerrit-Reviewer: Michael Burns mburns@redhat.com Gerrit-Reviewer: Ryan Harper ryanh@us.ibm.com Gerrit-Reviewer: ShaoHe Feng shaohef@linux.vnet.ibm.com Gerrit-Reviewer: Shu Ming shuming@linux.vnet.ibm.com Gerrit-Reviewer: Xu He Jie xuhj@linux.vnet.ibm.com Gerrit-Reviewer: Zhou Zheng Sheng zhshzhou@linux.vnet.ibm.com Gerrit-Reviewer: oVirt Jenkins CI Server
ShaoHe Feng has posted comments on this change.
Change subject: Add an option to create a watchdog device. ......................................................................
Patch Set 8: (1 inline comment)
.................................................... File vdsm/vdsmd.init.in Line 31: RESPAWNPIDFILE=@VDSMRUNDIR@/respawn.pid Line 32: CORE_DUMP_PATH=/var/log/core/core.%p.%t.dump Line 33: DOM_METADATA_BACKUP_DIR=/var/log/vdsm/backup Line 34: CORE_PATTERN=/proc/sys/kernel/core_pattern Line 35: QEMU_DUMP_PATH="/var/lib/vdsm/dump" how can we get the dump file in /var/log/core? scp or other way? Line 36: NEEDED_SERVICES="iscsid multipathd ntpd wdmd sanlock" Line 37: CONFLICTING_SERVICES="libvirt-guests" Line 38: Line 39: LCONF=/etc/libvirt/libvirtd.conf
-- To view, visit http://gerrit.ovirt.org/7535 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: I2b7970a9050ab0279fe03371b9a77692fba30af8 Gerrit-PatchSet: 8 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: ShaoHe Feng shaohef@linux.vnet.ibm.com Gerrit-Reviewer: Adam Litke agl@us.ibm.com Gerrit-Reviewer: Bing Bu Cao mars@linux.vnet.ibm.com Gerrit-Reviewer: Doron Fediuck dfediuck@redhat.com Gerrit-Reviewer: Mark Wu wudxw@linux.vnet.ibm.com Gerrit-Reviewer: Michael Burns mburns@redhat.com Gerrit-Reviewer: Ryan Harper ryanh@us.ibm.com Gerrit-Reviewer: ShaoHe Feng shaohef@linux.vnet.ibm.com Gerrit-Reviewer: Shu Ming shuming@linux.vnet.ibm.com Gerrit-Reviewer: Xu He Jie xuhj@linux.vnet.ibm.com Gerrit-Reviewer: Zhou Zheng Sheng zhshzhou@linux.vnet.ibm.com Gerrit-Reviewer: oVirt Jenkins CI Server
Doron Fediuck has posted comments on this change.
Change subject: Add an option to create a watchdog device. ......................................................................
Patch Set 9: I would prefer that you didn't submit this
(1 inline comment)
ShaoHe,
Thanks for sorting out the path issue, and for submitting this patch.
There are other issues I just noticed we need to verify:
1. Default action should not be reset, as this may be harmful. We should default to none. So unless the user specified he wants to reset, no harm will be caused.
2. Just to make sure I fully understand, by default a VM will not have a Watchdog device, unless given by the engine. Is this correct? We need to ensure users will not get new devices unless they specifically ask for it.
.................................................... File vdsm/libvirtvm.py Line 1174: """ Line 1175: m = self.createXmlElem(self.type, None, ['address']) Line 1176: m.setAttribute('model', self.specParams['model']) Line 1177: if 'action' in self.specParams: Line 1178: m.setAttribute('action', self.specParams['action']) Please set default action to None. We do not want see VMs reseting just because the device was accidentally attached.
I expect the users of the watchdog device to specify it explicitly as well as the desired action, as this has harmful implications. Line 1179: return m Line 1180: Line 1181: Line 1182: class RedirDevice(LibvirtVmDevice):
-- To view, visit http://gerrit.ovirt.org/7535 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: I2b7970a9050ab0279fe03371b9a77692fba30af8 Gerrit-PatchSet: 9 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: ShaoHe Feng shaohef@linux.vnet.ibm.com Gerrit-Reviewer: Adam Litke agl@us.ibm.com Gerrit-Reviewer: Bing Bu Cao mars@linux.vnet.ibm.com Gerrit-Reviewer: Doron Fediuck dfediuck@redhat.com Gerrit-Reviewer: Mark Wu wudxw@linux.vnet.ibm.com Gerrit-Reviewer: Michael Burns mburns@redhat.com Gerrit-Reviewer: Ryan Harper ryanh@us.ibm.com Gerrit-Reviewer: ShaoHe Feng shaohef@linux.vnet.ibm.com Gerrit-Reviewer: Shu Ming shuming@linux.vnet.ibm.com Gerrit-Reviewer: Xu He Jie xuhj@linux.vnet.ibm.com Gerrit-Reviewer: Zhou Zheng Sheng zhshzhou@linux.vnet.ibm.com Gerrit-Reviewer: oVirt Jenkins CI Server
ShaoHe Feng has posted comments on this change.
Change subject: Add an option to create a watchdog device. ......................................................................
Patch Set 9:
Doron
Thank you for your review.
1. Default action will be set 'none' in the next patch.
2. A VM does not have a watchdog device, unless given by the engine. the engine should specify the watchdog device when create a VM.
-- To view, visit http://gerrit.ovirt.org/7535 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: I2b7970a9050ab0279fe03371b9a77692fba30af8 Gerrit-PatchSet: 9 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: ShaoHe Feng shaohef@linux.vnet.ibm.com Gerrit-Reviewer: Adam Litke agl@us.ibm.com Gerrit-Reviewer: Bing Bu Cao mars@linux.vnet.ibm.com Gerrit-Reviewer: Doron Fediuck dfediuck@redhat.com Gerrit-Reviewer: Mark Wu wudxw@linux.vnet.ibm.com Gerrit-Reviewer: Michael Burns mburns@redhat.com Gerrit-Reviewer: Ryan Harper ryanh@us.ibm.com Gerrit-Reviewer: ShaoHe Feng shaohef@linux.vnet.ibm.com Gerrit-Reviewer: Shu Ming shuming@linux.vnet.ibm.com Gerrit-Reviewer: Xu He Jie xuhj@linux.vnet.ibm.com Gerrit-Reviewer: Zhou Zheng Sheng zhshzhou@linux.vnet.ibm.com Gerrit-Reviewer: oVirt Jenkins CI Server
Doron Fediuck has posted comments on this change.
Change subject: Add an option to create a watchdog device. ......................................................................
Patch Set 10: Looks good to me, but someone else must approve
ShaoHe, good job!
-- To view, visit http://gerrit.ovirt.org/7535 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: I2b7970a9050ab0279fe03371b9a77692fba30af8 Gerrit-PatchSet: 10 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: ShaoHe Feng shaohef@linux.vnet.ibm.com Gerrit-Reviewer: Adam Litke agl@us.ibm.com Gerrit-Reviewer: Bing Bu Cao mars@linux.vnet.ibm.com Gerrit-Reviewer: Doron Fediuck dfediuck@redhat.com Gerrit-Reviewer: Mark Wu wudxw@linux.vnet.ibm.com Gerrit-Reviewer: Michael Burns mburns@redhat.com Gerrit-Reviewer: Ryan Harper ryanh@us.ibm.com Gerrit-Reviewer: ShaoHe Feng shaohef@linux.vnet.ibm.com Gerrit-Reviewer: Shu Ming shuming@linux.vnet.ibm.com Gerrit-Reviewer: Xu He Jie xuhj@linux.vnet.ibm.com Gerrit-Reviewer: Zhou Zheng Sheng zhshzhou@linux.vnet.ibm.com Gerrit-Reviewer: oVirt Jenkins CI Server
Adam Litke has posted comments on this change.
Change subject: Add an option to create a watchdog device. ......................................................................
Patch Set 10: (3 inline comments)
Just some minor formatting issues in the schema. Looks good otherwise. Have you verified it?
.................................................... File vdsm_api/vdsmapi-schema.json Line 2220: # Line 2221: # @i6300esb: the recommended device, emulating a PCI Intel 6300ESB Line 2222: # Line 2223: # @IB700: emulating an ISA iBase IB700 as watchdog Line 2224: # Please align the descriptions so they all start at the same column. See the rest of the file for how it's done. Sorry to be pedantic, but the rest of the file looks so nice :) Line 2225: # Since: 4.10.0 Line 2226: ## Line 2227: {'enum': 'VmWatchdogDeviceModel', 'data': ['i6300esb', 'IB700']} Line 2228:
Line 2233: # Line 2234: # @reset: default, forcefully reset the guest Line 2235: # Line 2236: # @shutdown: gracefully shutdown the guest (not recommended) Line 2237: # alignment. Line 2238: # @poweroff: forcefully power off the guest Line 2239: # Line 2240: # @pause: pause the guest Line 2241: #
Line 2277: # Line 2278: # @specParams: #optional Additional device parameters Line 2279: # Line 2280: # @deviceId: A unique ID for this device Line 2281: # These are aligned the way they should be. Line 2282: # Since: 4.10.0 Line 2283: ## Line 2284: {'type': 'VmWatchdogDevice', Line 2285: 'data': {'deviceType': 'VmDeviceType', 'device': 'VmWatchdogDeviceType',
-- To view, visit http://gerrit.ovirt.org/7535 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: I2b7970a9050ab0279fe03371b9a77692fba30af8 Gerrit-PatchSet: 10 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: ShaoHe Feng shaohef@linux.vnet.ibm.com Gerrit-Reviewer: Adam Litke agl@us.ibm.com Gerrit-Reviewer: Bing Bu Cao mars@linux.vnet.ibm.com Gerrit-Reviewer: Doron Fediuck dfediuck@redhat.com Gerrit-Reviewer: Mark Wu wudxw@linux.vnet.ibm.com Gerrit-Reviewer: Michael Burns mburns@redhat.com Gerrit-Reviewer: Ryan Harper ryanh@us.ibm.com Gerrit-Reviewer: ShaoHe Feng shaohef@linux.vnet.ibm.com Gerrit-Reviewer: Shu Ming shuming@linux.vnet.ibm.com Gerrit-Reviewer: Xu He Jie xuhj@linux.vnet.ibm.com Gerrit-Reviewer: Zhou Zheng Sheng zhshzhou@linux.vnet.ibm.com Gerrit-Reviewer: oVirt Jenkins CI Server
Mark Wu has posted comments on this change.
Change subject: Add an option to create a watchdog device. ......................................................................
Patch Set 10: I would prefer that you didn't submit this
(3 inline comments)
.................................................... File vdsm/libvirtvm.py Line 1170: <watchdog model='i6300esb' action='reset'> Line 1171: <address type='pci' domain='0x0000' bus='0x00' slot='0x05' Line 1172: function='0x0'/> Line 1173: </watchdog> Line 1174: """ also add a test case for it to tests/libvirtvmTests.py ? Line 1175: m = self.createXmlElem(self.type, None, ['address']) Line 1176: m.setAttribute('model', self.specParams['model']) Line 1177: m.setAttribute('action', self.specParams['action']) Line 1178: return m
Line 2440: dev.specParams['action'] = action Line 2441: for dev in self.conf['devices']: Line 2442: if ((dev['type'] == vm.WATCHDOG_DEVICES) and Line 2443: not "action" in dev['specParams']): Line 2444: dev['specParams']['action'] = action you have give a default action 'none' to it, so you needn't fetch it from libvirt again. so you should remove lines from 2438 to 2444 Line 2445: Line 2446: def _getUnderlyingVideoDeviceInfo(self): Line 2447: """ Line 2448: Obtain video devices info from libvirt.
.................................................... File vdsm/vdsmd.init.in Line 332: set_if_default $qlconf auto_disk_leases 0 Line 333: set_if_default $qlconf require_lease_for_disks 0 Line 334: Line 335: # Configuring auto dump path Line 336: set_if_default $qconf auto_dump_path "$QEMU_DUMP_PATH" To make the configuration change apply after upgrading vdsm, you also need bump "by_vdsm_vers" Line 337: Line 338: # Write to all conf files the *end* message of vdsm changes Line 339: for arg in "${lconf}" "${qconf}" "${ldconf}" "${qlconf}" Line 340: do
-- To view, visit http://gerrit.ovirt.org/7535 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: I2b7970a9050ab0279fe03371b9a77692fba30af8 Gerrit-PatchSet: 10 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: ShaoHe Feng shaohef@linux.vnet.ibm.com Gerrit-Reviewer: Adam Litke agl@us.ibm.com Gerrit-Reviewer: Bing Bu Cao mars@linux.vnet.ibm.com Gerrit-Reviewer: Doron Fediuck dfediuck@redhat.com Gerrit-Reviewer: Mark Wu wudxw@linux.vnet.ibm.com Gerrit-Reviewer: Michael Burns mburns@redhat.com Gerrit-Reviewer: Ryan Harper ryanh@us.ibm.com Gerrit-Reviewer: ShaoHe Feng shaohef@linux.vnet.ibm.com Gerrit-Reviewer: Shu Ming shuming@linux.vnet.ibm.com Gerrit-Reviewer: Xu He Jie xuhj@linux.vnet.ibm.com Gerrit-Reviewer: Zhou Zheng Sheng zhshzhou@linux.vnet.ibm.com Gerrit-Reviewer: oVirt Jenkins CI Server
ShaoHe Feng has posted comments on this change.
Change subject: Add an option to create a watchdog device. ......................................................................
Patch Set 11: Verified
how to verified this patch.
Maybe there is no a UI in engine to add a watchdog device.
you can start a vm directly by vdsm with a wathdog device parameter. http://wiki.ovirt.org/wiki/Vdsm_Standalone
add a wathdog device parameter dev_list = [{'device': 'watchdog', 'type': 'watchdog', 'specParams': {'model': 'ib700', 'action': "dump"}}
vdsOK( s.create(dict(vmId=vmId, drives=[dict(poolID=spUUID, domainID=sdUUID, imageID=imgUUID, volumeID=volUUID)], memSize=256, display="vnc", vmName="vm1", devices = dev_list, ) ) )
after the vm start up, you can use virsh to watch the watchdog device in xml. # virsh -c qemu:///system sudo virsh -c qemu:///system dumpxml vm1.
you can also log on vm1 # ls /dev/watchdog but some os such as ubuntu will add the watchdog automatically for the udev rule.
-- To view, visit http://gerrit.ovirt.org/7535 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: I2b7970a9050ab0279fe03371b9a77692fba30af8 Gerrit-PatchSet: 11 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: ShaoHe Feng shaohef@linux.vnet.ibm.com Gerrit-Reviewer: Adam Litke agl@us.ibm.com Gerrit-Reviewer: Bing Bu Cao mars@linux.vnet.ibm.com Gerrit-Reviewer: Doron Fediuck dfediuck@redhat.com Gerrit-Reviewer: Mark Wu wudxw@linux.vnet.ibm.com Gerrit-Reviewer: Michael Burns mburns@redhat.com Gerrit-Reviewer: Ryan Harper ryanh@us.ibm.com Gerrit-Reviewer: ShaoHe Feng shaohef@linux.vnet.ibm.com Gerrit-Reviewer: Shu Ming shuming@linux.vnet.ibm.com Gerrit-Reviewer: Xu He Jie xuhj@linux.vnet.ibm.com Gerrit-Reviewer: Zhou Zheng Sheng zhshzhou@linux.vnet.ibm.com Gerrit-Reviewer: oVirt Jenkins CI Server
ShaoHe Feng has posted comments on this change.
Change subject: Add an option to create a watchdog device. ......................................................................
Patch Set 11:
sorry, but some os version such as ubuntu will not add the watchdog automatically.
-- To view, visit http://gerrit.ovirt.org/7535 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: I2b7970a9050ab0279fe03371b9a77692fba30af8 Gerrit-PatchSet: 11 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: ShaoHe Feng shaohef@linux.vnet.ibm.com Gerrit-Reviewer: Adam Litke agl@us.ibm.com Gerrit-Reviewer: Bing Bu Cao mars@linux.vnet.ibm.com Gerrit-Reviewer: Doron Fediuck dfediuck@redhat.com Gerrit-Reviewer: Mark Wu wudxw@linux.vnet.ibm.com Gerrit-Reviewer: Michael Burns mburns@redhat.com Gerrit-Reviewer: Ryan Harper ryanh@us.ibm.com Gerrit-Reviewer: ShaoHe Feng shaohef@linux.vnet.ibm.com Gerrit-Reviewer: Shu Ming shuming@linux.vnet.ibm.com Gerrit-Reviewer: Xu He Jie xuhj@linux.vnet.ibm.com Gerrit-Reviewer: Zhou Zheng Sheng zhshzhou@linux.vnet.ibm.com Gerrit-Reviewer: oVirt Jenkins CI Server
ShaoHe Feng has posted comments on this change.
Change subject: Add an option to create a watchdog device. ......................................................................
Patch Set 11:
some format error with my last Message. after the vm start up, you can use virsh to watch the watchdog device in xml on host.
# virsh -c qemu:///system sudo virsh -c qemu:///system dumpxml vm1.
you can also log on guest to check:
# ls /dev/watchdog*
Some guest OS such as ubuntu will not add the watchdog automatically for the udev rule.
-- To view, visit http://gerrit.ovirt.org/7535 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: I2b7970a9050ab0279fe03371b9a77692fba30af8 Gerrit-PatchSet: 11 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: ShaoHe Feng shaohef@linux.vnet.ibm.com Gerrit-Reviewer: Adam Litke agl@us.ibm.com Gerrit-Reviewer: Bing Bu Cao mars@linux.vnet.ibm.com Gerrit-Reviewer: Doron Fediuck dfediuck@redhat.com Gerrit-Reviewer: Mark Wu wudxw@linux.vnet.ibm.com Gerrit-Reviewer: Michael Burns mburns@redhat.com Gerrit-Reviewer: Ryan Harper ryanh@us.ibm.com Gerrit-Reviewer: ShaoHe Feng shaohef@linux.vnet.ibm.com Gerrit-Reviewer: Shu Ming shuming@linux.vnet.ibm.com Gerrit-Reviewer: Xu He Jie xuhj@linux.vnet.ibm.com Gerrit-Reviewer: Zhou Zheng Sheng zhshzhou@linux.vnet.ibm.com Gerrit-Reviewer: oVirt Jenkins CI Server
Vinzenz Feenstra has posted comments on this change.
Change subject: Add an option to create a watchdog device. ......................................................................
Patch Set 11: I would prefer that you didn't submit this
(3 inline comments)
.................................................... File vdsm/libvirtvm.py Line 2014: # of libvirt source. Line 2015: actionStrings = ("No action, watchdog ignored", Line 2016: "Guest CPUs are paused", Line 2017: "Guest CPUs are reset", Line 2018: "Guest is forcably powered off", forcibly Line 2019: "Guest is requested to gracefully shutdown", Line 2020: "No action, a debug message logged") Line 2021: try: Line 2022: return actionStrings[action]
Line 2423: address = self._getUnderlyingDeviceAddress(x) Line 2424: alias = x.getElementsByTagName('alias')[0].getAttribute('name') Line 2425: Line 2426: for dev in self._devices[vm.WATCHDOG_DEVICES]: Line 2427: if not hasattr(dev, 'address'): I would also check here for 'alias' Line 2428: dev.address = address Line 2429: dev.alias = alias Line 2430: Line 2431: for dev in self.conf['devices']:
Line 2429: dev.alias = alias Line 2430: Line 2431: for dev in self.conf['devices']: Line 2432: if ((dev['type'] == vm.WATCHDOG_DEVICES) and Line 2433: not dev.get('address')): Same as line 2427 Line 2434: dev['address'] = address Line 2435: dev['alias'] = alias Line 2436: Line 2437: def _getUnderlyingVideoDeviceInfo(self):
-- To view, visit http://gerrit.ovirt.org/7535 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: I2b7970a9050ab0279fe03371b9a77692fba30af8 Gerrit-PatchSet: 11 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: ShaoHe Feng shaohef@linux.vnet.ibm.com Gerrit-Reviewer: Adam Litke agl@us.ibm.com Gerrit-Reviewer: Bing Bu Cao mars@linux.vnet.ibm.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Doron Fediuck dfediuck@redhat.com Gerrit-Reviewer: Mark Wu wudxw@linux.vnet.ibm.com Gerrit-Reviewer: Michael Burns mburns@redhat.com Gerrit-Reviewer: Peter V. Saveliev peet@redhat.com Gerrit-Reviewer: Ryan Harper ryanh@us.ibm.com Gerrit-Reviewer: ShaoHe Feng shaohef@linux.vnet.ibm.com Gerrit-Reviewer: Shu Ming shuming@linux.vnet.ibm.com Gerrit-Reviewer: Vinzenz Feenstra vfeenstr@redhat.com Gerrit-Reviewer: Xu He Jie xuhj@linux.vnet.ibm.com Gerrit-Reviewer: Yaniv Bronhaim ybronhei@redhat.com Gerrit-Reviewer: Zhou Zheng Sheng zhshzhou@linux.vnet.ibm.com Gerrit-Reviewer: oVirt Jenkins CI Server
Vinzenz Feenstra has posted comments on this change.
Change subject: Add an option to create a watchdog device. ......................................................................
Patch Set 12: Looks good to me, but someone else must approve
-- To view, visit http://gerrit.ovirt.org/7535 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: I2b7970a9050ab0279fe03371b9a77692fba30af8 Gerrit-PatchSet: 12 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: ShaoHe Feng shaohef@linux.vnet.ibm.com Gerrit-Reviewer: Adam Litke agl@us.ibm.com Gerrit-Reviewer: Bing Bu Cao mars@linux.vnet.ibm.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Doron Fediuck dfediuck@redhat.com Gerrit-Reviewer: Mark Wu wudxw@linux.vnet.ibm.com Gerrit-Reviewer: Michael Burns mburns@redhat.com Gerrit-Reviewer: Peter V. Saveliev peet@redhat.com Gerrit-Reviewer: Ryan Harper ryanh@us.ibm.com Gerrit-Reviewer: ShaoHe Feng shaohef@linux.vnet.ibm.com Gerrit-Reviewer: Shu Ming shuming@linux.vnet.ibm.com Gerrit-Reviewer: Vinzenz Feenstra vfeenstr@redhat.com Gerrit-Reviewer: Xu He Jie xuhj@linux.vnet.ibm.com Gerrit-Reviewer: Yaniv Bronhaim ybronhei@redhat.com Gerrit-Reviewer: Zhou Zheng Sheng zhshzhou@linux.vnet.ibm.com Gerrit-Reviewer: oVirt Jenkins CI Server
Michal Skrivanek has posted comments on this change.
Change subject: Add an option to create a watchdog device. ......................................................................
Patch Set 12:
Are you following up with engine-side patch to get a proper support? Then the hook can be removed, right?
-- To view, visit http://gerrit.ovirt.org/7535 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: I2b7970a9050ab0279fe03371b9a77692fba30af8 Gerrit-PatchSet: 12 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: ShaoHe Feng shaohef@linux.vnet.ibm.com Gerrit-Reviewer: Adam Litke agl@us.ibm.com Gerrit-Reviewer: Bing Bu Cao mars@linux.vnet.ibm.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Doron Fediuck dfediuck@redhat.com Gerrit-Reviewer: Mark Wu wudxw@linux.vnet.ibm.com Gerrit-Reviewer: Michael Burns mburns@redhat.com Gerrit-Reviewer: Michal Skrivanek michal.skrivanek@redhat.com Gerrit-Reviewer: Peter V. Saveliev peet@redhat.com Gerrit-Reviewer: Ryan Harper ryanh@us.ibm.com Gerrit-Reviewer: ShaoHe Feng shaohef@linux.vnet.ibm.com Gerrit-Reviewer: Shu Ming shuming@linux.vnet.ibm.com Gerrit-Reviewer: Vinzenz Feenstra vfeenstr@redhat.com Gerrit-Reviewer: Xu He Jie xuhj@linux.vnet.ibm.com Gerrit-Reviewer: Yaniv Bronhaim ybronhei@redhat.com Gerrit-Reviewer: Zhou Zheng Sheng zhshzhou@linux.vnet.ibm.com Gerrit-Reviewer: oVirt Jenkins CI Server
ShaoHe Feng has posted comments on this change.
Change subject: Add an option to create a watchdog device. ......................................................................
Patch Set 12: Looks good to me, but someone else must approve
the engine can add a watchdog device easily, the same way as other device. there is a wiki about it. http://wiki.ovirt.org/wiki/Add_an_option_to_create_a_watchdog_device
which hook?
-- To view, visit http://gerrit.ovirt.org/7535 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: I2b7970a9050ab0279fe03371b9a77692fba30af8 Gerrit-PatchSet: 12 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: ShaoHe Feng shaohef@linux.vnet.ibm.com Gerrit-Reviewer: Adam Litke agl@us.ibm.com Gerrit-Reviewer: Bing Bu Cao mars@linux.vnet.ibm.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Doron Fediuck dfediuck@redhat.com Gerrit-Reviewer: Mark Wu wudxw@linux.vnet.ibm.com Gerrit-Reviewer: Michael Burns mburns@redhat.com Gerrit-Reviewer: Michal Skrivanek michal.skrivanek@redhat.com Gerrit-Reviewer: Peter V. Saveliev peet@redhat.com Gerrit-Reviewer: Ryan Harper ryanh@us.ibm.com Gerrit-Reviewer: ShaoHe Feng shaohef@linux.vnet.ibm.com Gerrit-Reviewer: Shu Ming shuming@linux.vnet.ibm.com Gerrit-Reviewer: Vinzenz Feenstra vfeenstr@redhat.com Gerrit-Reviewer: Xu He Jie xuhj@linux.vnet.ibm.com Gerrit-Reviewer: Yaniv Bronhaim ybronhei@redhat.com Gerrit-Reviewer: Zhou Zheng Sheng zhshzhou@linux.vnet.ibm.com Gerrit-Reviewer: oVirt Jenkins CI Server
ShaoHe Feng has posted comments on this change.
Change subject: Add an option to create a watchdog device. ......................................................................
Patch Set 12: Verified; No score
-- To view, visit http://gerrit.ovirt.org/7535 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: I2b7970a9050ab0279fe03371b9a77692fba30af8 Gerrit-PatchSet: 12 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: ShaoHe Feng shaohef@linux.vnet.ibm.com Gerrit-Reviewer: Adam Litke agl@us.ibm.com Gerrit-Reviewer: Bing Bu Cao mars@linux.vnet.ibm.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Doron Fediuck dfediuck@redhat.com Gerrit-Reviewer: Mark Wu wudxw@linux.vnet.ibm.com Gerrit-Reviewer: Michael Burns mburns@redhat.com Gerrit-Reviewer: Michal Skrivanek michal.skrivanek@redhat.com Gerrit-Reviewer: Peter V. Saveliev peet@redhat.com Gerrit-Reviewer: Ryan Harper ryanh@us.ibm.com Gerrit-Reviewer: ShaoHe Feng shaohef@linux.vnet.ibm.com Gerrit-Reviewer: Shu Ming shuming@linux.vnet.ibm.com Gerrit-Reviewer: Vinzenz Feenstra vfeenstr@redhat.com Gerrit-Reviewer: Xu He Jie xuhj@linux.vnet.ibm.com Gerrit-Reviewer: Yaniv Bronhaim ybronhei@redhat.com Gerrit-Reviewer: Zhou Zheng Sheng zhshzhou@linux.vnet.ibm.com Gerrit-Reviewer: oVirt Jenkins CI Server
Mark Wu has posted comments on this change.
Change subject: Add an option to create a watchdog device. ......................................................................
Patch Set 12: Looks good to me, but someone else must approve
With this patch, engine can't find a watchdog event is triggered. Perhaps you need add a flag to vm stats to indicate the event happened and what action was taken. Then engine could find it by polling vm's stats. I am fine with that you submit another patch to resolve that.
-- To view, visit http://gerrit.ovirt.org/7535 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: I2b7970a9050ab0279fe03371b9a77692fba30af8 Gerrit-PatchSet: 12 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: ShaoHe Feng shaohef@linux.vnet.ibm.com Gerrit-Reviewer: Adam Litke agl@us.ibm.com Gerrit-Reviewer: Bing Bu Cao mars@linux.vnet.ibm.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Doron Fediuck dfediuck@redhat.com Gerrit-Reviewer: Mark Wu wudxw@linux.vnet.ibm.com Gerrit-Reviewer: Michael Burns mburns@redhat.com Gerrit-Reviewer: Michal Skrivanek michal.skrivanek@redhat.com Gerrit-Reviewer: Peter V. Saveliev peet@redhat.com Gerrit-Reviewer: Ryan Harper ryanh@us.ibm.com Gerrit-Reviewer: ShaoHe Feng shaohef@linux.vnet.ibm.com Gerrit-Reviewer: Shu Ming shuming@linux.vnet.ibm.com Gerrit-Reviewer: Vinzenz Feenstra vfeenstr@redhat.com Gerrit-Reviewer: Xu He Jie xuhj@linux.vnet.ibm.com Gerrit-Reviewer: Yaniv Bronhaim ybronhei@redhat.com Gerrit-Reviewer: Zhou Zheng Sheng zhshzhou@linux.vnet.ibm.com Gerrit-Reviewer: oVirt Jenkins CI Server
Dan Kenigsberg has posted comments on this change.
Change subject: Add an option to create a watchdog device. ......................................................................
Patch Set 12: I would prefer that you didn't submit this
(2 inline comments)
Thanks! Only a minor comment on excessive callback arguments.
.................................................... File vdsm_api/vdsmapi-schema.json Line 2208: # An enumeration of VM watchdog device types. Line 2209: # Line 2210: # @watchdog: Device type watchdog Line 2211: # Line 2212: # Since: 4.10.0 we're 4.10.1 already, not that anyone cares Line 2213: ## Line 2214: {'enum': 'VmWatchdogDeviceType', 'data': ['watchdog']} Line 2215: Line 2216: ##
.................................................... File vdsm/libvirtvm.py Line 2200: self.startDisksStatsCollection() Line 2201: Line 2202: return {'status': doneCode} Line 2203: Line 2204: def _onWatchdogEvent(self, name, vmid, action): why do we need name and vmid as args to this callback? aren't they already in self.conf[vmId] and [vmName]?
ps. vmId is already logged by our SimpleLogAdapter. Line 2205: def actionToString(action): Line 2206: # the following action strings come from the comments of Line 2207: # virDomainEventWatchdogAction in include/libvirt/libvirt.h Line 2208: # of libvirt source.
-- To view, visit http://gerrit.ovirt.org/7535 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: I2b7970a9050ab0279fe03371b9a77692fba30af8 Gerrit-PatchSet: 12 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: ShaoHe Feng shaohef@linux.vnet.ibm.com Gerrit-Reviewer: Adam Litke agl@us.ibm.com Gerrit-Reviewer: Bing Bu Cao mars@linux.vnet.ibm.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Doron Fediuck dfediuck@redhat.com Gerrit-Reviewer: Mark Wu wudxw@linux.vnet.ibm.com Gerrit-Reviewer: Michael Burns mburns@redhat.com Gerrit-Reviewer: Michal Skrivanek michal.skrivanek@redhat.com Gerrit-Reviewer: Peter V. Saveliev peet@redhat.com Gerrit-Reviewer: Ryan Harper ryanh@us.ibm.com Gerrit-Reviewer: ShaoHe Feng shaohef@linux.vnet.ibm.com Gerrit-Reviewer: Shu Ming shuming@linux.vnet.ibm.com Gerrit-Reviewer: Vinzenz Feenstra vfeenstr@redhat.com Gerrit-Reviewer: Xu He Jie xuhj@linux.vnet.ibm.com Gerrit-Reviewer: Yaniv Bronhaim ybronhei@redhat.com Gerrit-Reviewer: Zhou Zheng Sheng zhshzhou@linux.vnet.ibm.com Gerrit-Reviewer: oVirt Jenkins CI Server
ShaoHe Feng has posted comments on this change.
Change subject: Add an option to create a watchdog device. ......................................................................
Patch Set 12: (1 inline comment)
.................................................... File vdsm/libvirtvm.py Line 2200: self.startDisksStatsCollection() Line 2201: Line 2202: return {'status': doneCode} Line 2203: Line 2204: def _onWatchdogEvent(self, name, vmid, action): yes, agree. Line 2205: def actionToString(action): Line 2206: # the following action strings come from the comments of Line 2207: # virDomainEventWatchdogAction in include/libvirt/libvirt.h Line 2208: # of libvirt source.
-- To view, visit http://gerrit.ovirt.org/7535 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: I2b7970a9050ab0279fe03371b9a77692fba30af8 Gerrit-PatchSet: 12 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: ShaoHe Feng shaohef@linux.vnet.ibm.com Gerrit-Reviewer: Adam Litke agl@us.ibm.com Gerrit-Reviewer: Bing Bu Cao mars@linux.vnet.ibm.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Doron Fediuck dfediuck@redhat.com Gerrit-Reviewer: Mark Wu wudxw@linux.vnet.ibm.com Gerrit-Reviewer: Michael Burns mburns@redhat.com Gerrit-Reviewer: Michal Skrivanek michal.skrivanek@redhat.com Gerrit-Reviewer: Peter V. Saveliev peet@redhat.com Gerrit-Reviewer: Ryan Harper ryanh@us.ibm.com Gerrit-Reviewer: ShaoHe Feng shaohef@linux.vnet.ibm.com Gerrit-Reviewer: Shu Ming shuming@linux.vnet.ibm.com Gerrit-Reviewer: Vinzenz Feenstra vfeenstr@redhat.com Gerrit-Reviewer: Xu He Jie xuhj@linux.vnet.ibm.com Gerrit-Reviewer: Yaniv Bronhaim ybronhei@redhat.com Gerrit-Reviewer: Zhou Zheng Sheng zhshzhou@linux.vnet.ibm.com Gerrit-Reviewer: oVirt Jenkins CI Server
ShaoHe Feng has posted comments on this change.
Change subject: Add an option to create a watchdog device. ......................................................................
Patch Set 13: Verified
-- To view, visit http://gerrit.ovirt.org/7535 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: I2b7970a9050ab0279fe03371b9a77692fba30af8 Gerrit-PatchSet: 13 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: ShaoHe Feng shaohef@linux.vnet.ibm.com Gerrit-Reviewer: Adam Litke agl@us.ibm.com Gerrit-Reviewer: Bing Bu Cao mars@linux.vnet.ibm.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Doron Fediuck dfediuck@redhat.com Gerrit-Reviewer: Mark Wu wudxw@linux.vnet.ibm.com Gerrit-Reviewer: Michael Burns mburns@redhat.com Gerrit-Reviewer: Michal Skrivanek michal.skrivanek@redhat.com Gerrit-Reviewer: Peter V. Saveliev peet@redhat.com Gerrit-Reviewer: Ryan Harper ryanh@us.ibm.com Gerrit-Reviewer: ShaoHe Feng shaohef@linux.vnet.ibm.com Gerrit-Reviewer: Shu Ming shuming@linux.vnet.ibm.com Gerrit-Reviewer: Vinzenz Feenstra vfeenstr@redhat.com Gerrit-Reviewer: Xu He Jie xuhj@linux.vnet.ibm.com Gerrit-Reviewer: Yaniv Bronhaim ybronhei@redhat.com Gerrit-Reviewer: Zhou Zheng Sheng zhshzhou@linux.vnet.ibm.com Gerrit-Reviewer: oVirt Jenkins CI Server
Vinzenz Feenstra has posted comments on this change.
Change subject: Add an option to create a watchdog device. ......................................................................
Patch Set 13: Looks good to me, but someone else must approve
-- To view, visit http://gerrit.ovirt.org/7535 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: I2b7970a9050ab0279fe03371b9a77692fba30af8 Gerrit-PatchSet: 13 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: ShaoHe Feng shaohef@linux.vnet.ibm.com Gerrit-Reviewer: Adam Litke agl@us.ibm.com Gerrit-Reviewer: Bing Bu Cao mars@linux.vnet.ibm.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Doron Fediuck dfediuck@redhat.com Gerrit-Reviewer: Mark Wu wudxw@linux.vnet.ibm.com Gerrit-Reviewer: Michael Burns mburns@redhat.com Gerrit-Reviewer: Michal Skrivanek michal.skrivanek@redhat.com Gerrit-Reviewer: Peter V. Saveliev peet@redhat.com Gerrit-Reviewer: Ryan Harper ryanh@us.ibm.com Gerrit-Reviewer: ShaoHe Feng shaohef@linux.vnet.ibm.com Gerrit-Reviewer: Shu Ming shuming@linux.vnet.ibm.com Gerrit-Reviewer: Vinzenz Feenstra vfeenstr@redhat.com Gerrit-Reviewer: Xu He Jie xuhj@linux.vnet.ibm.com Gerrit-Reviewer: Yaniv Bronhaim ybronhei@redhat.com Gerrit-Reviewer: Zhou Zheng Sheng zhshzhou@linux.vnet.ibm.com Gerrit-Reviewer: oVirt Jenkins CI Server
Dan Kenigsberg has posted comments on this change.
Change subject: Add an option to create a watchdog device. ......................................................................
Patch Set 13: Looks good to me, but someone else must approve
(Waiting for Michal's PoV)
-- To view, visit http://gerrit.ovirt.org/7535 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: I2b7970a9050ab0279fe03371b9a77692fba30af8 Gerrit-PatchSet: 13 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: ShaoHe Feng shaohef@linux.vnet.ibm.com Gerrit-Reviewer: Adam Litke agl@us.ibm.com Gerrit-Reviewer: Bing Bu Cao mars@linux.vnet.ibm.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Doron Fediuck dfediuck@redhat.com Gerrit-Reviewer: Mark Wu wudxw@linux.vnet.ibm.com Gerrit-Reviewer: Michael Burns mburns@redhat.com Gerrit-Reviewer: Michal Skrivanek michal.skrivanek@redhat.com Gerrit-Reviewer: Peter V. Saveliev peet@redhat.com Gerrit-Reviewer: Ryan Harper ryanh@us.ibm.com Gerrit-Reviewer: ShaoHe Feng shaohef@linux.vnet.ibm.com Gerrit-Reviewer: Shu Ming shuming@linux.vnet.ibm.com Gerrit-Reviewer: Vinzenz Feenstra vfeenstr@redhat.com Gerrit-Reviewer: Xu He Jie xuhj@linux.vnet.ibm.com Gerrit-Reviewer: Yaniv Bronhaim ybronhei@redhat.com Gerrit-Reviewer: Zhou Zheng Sheng zhshzhou@linux.vnet.ibm.com Gerrit-Reviewer: oVirt Jenkins CI Server
Michal Skrivanek has posted comments on this change.
Change subject: Add an option to create a watchdog device. ......................................................................
Patch Set 13: Looks good to me, but someone else must approve
My only concern/question is about not filling /var partition when dumping the vm. We need some protection for that or at least some kind of alarm/warning. Doron?
-- To view, visit http://gerrit.ovirt.org/7535 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: I2b7970a9050ab0279fe03371b9a77692fba30af8 Gerrit-PatchSet: 13 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: ShaoHe Feng shaohef@linux.vnet.ibm.com Gerrit-Reviewer: Adam Litke agl@us.ibm.com Gerrit-Reviewer: Bing Bu Cao mars@linux.vnet.ibm.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Doron Fediuck dfediuck@redhat.com Gerrit-Reviewer: Mark Wu wudxw@linux.vnet.ibm.com Gerrit-Reviewer: Michael Burns mburns@redhat.com Gerrit-Reviewer: Michal Skrivanek michal.skrivanek@redhat.com Gerrit-Reviewer: Peter V. Saveliev peet@redhat.com Gerrit-Reviewer: Ryan Harper ryanh@us.ibm.com Gerrit-Reviewer: ShaoHe Feng shaohef@linux.vnet.ibm.com Gerrit-Reviewer: Shu Ming shuming@linux.vnet.ibm.com Gerrit-Reviewer: Vinzenz Feenstra vfeenstr@redhat.com Gerrit-Reviewer: Xu He Jie xuhj@linux.vnet.ibm.com Gerrit-Reviewer: Yaniv Bronhaim ybronhei@redhat.com Gerrit-Reviewer: Zhou Zheng Sheng zhshzhou@linux.vnet.ibm.com Gerrit-Reviewer: oVirt Jenkins CI Server
Doron Fediuck has posted comments on this change.
Change subject: Add an option to create a watchdog device. ......................................................................
Patch Set 13:
Generally speaking this would be the standard location for vdsm-related dumps. it's configured accordingly in ovirt-node as well as Fedora/RHEL. IIRC we should get low disk warnings, but this needs verification. Still, even if no such warning we can open a relevant RFE for VDSM to report host low-space.
-- To view, visit http://gerrit.ovirt.org/7535 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: I2b7970a9050ab0279fe03371b9a77692fba30af8 Gerrit-PatchSet: 13 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: ShaoHe Feng shaohef@linux.vnet.ibm.com Gerrit-Reviewer: Adam Litke agl@us.ibm.com Gerrit-Reviewer: Bing Bu Cao mars@linux.vnet.ibm.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Doron Fediuck dfediuck@redhat.com Gerrit-Reviewer: Mark Wu wudxw@linux.vnet.ibm.com Gerrit-Reviewer: Michael Burns mburns@redhat.com Gerrit-Reviewer: Michal Skrivanek michal.skrivanek@redhat.com Gerrit-Reviewer: Peter V. Saveliev peet@redhat.com Gerrit-Reviewer: Ryan Harper ryanh@us.ibm.com Gerrit-Reviewer: ShaoHe Feng shaohef@linux.vnet.ibm.com Gerrit-Reviewer: Shu Ming shuming@linux.vnet.ibm.com Gerrit-Reviewer: Vinzenz Feenstra vfeenstr@redhat.com Gerrit-Reviewer: Xu He Jie xuhj@linux.vnet.ibm.com Gerrit-Reviewer: Yaniv Bronhaim ybronhei@redhat.com Gerrit-Reviewer: Zhou Zheng Sheng zhshzhou@linux.vnet.ibm.com Gerrit-Reviewer: oVirt Jenkins CI Server
Dan Kenigsberg has posted comments on this change.
Change subject: Add an option to create a watchdog device. ......................................................................
Patch Set 13: Looks good to me, approved
Thanks!
-- To view, visit http://gerrit.ovirt.org/7535 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: I2b7970a9050ab0279fe03371b9a77692fba30af8 Gerrit-PatchSet: 13 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: ShaoHe Feng shaohef@linux.vnet.ibm.com Gerrit-Reviewer: Adam Litke agl@us.ibm.com Gerrit-Reviewer: Bing Bu Cao mars@linux.vnet.ibm.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Doron Fediuck dfediuck@redhat.com Gerrit-Reviewer: Mark Wu wudxw@linux.vnet.ibm.com Gerrit-Reviewer: Michael Burns mburns@redhat.com Gerrit-Reviewer: Michal Skrivanek michal.skrivanek@redhat.com Gerrit-Reviewer: Peter V. Saveliev peet@redhat.com Gerrit-Reviewer: Ryan Harper ryanh@us.ibm.com Gerrit-Reviewer: ShaoHe Feng shaohef@linux.vnet.ibm.com Gerrit-Reviewer: Shu Ming shuming@linux.vnet.ibm.com Gerrit-Reviewer: Vinzenz Feenstra vfeenstr@redhat.com Gerrit-Reviewer: Xu He Jie xuhj@linux.vnet.ibm.com Gerrit-Reviewer: Yaniv Bronhaim ybronhei@redhat.com Gerrit-Reviewer: Zhou Zheng Sheng zhshzhou@linux.vnet.ibm.com Gerrit-Reviewer: oVirt Jenkins CI Server
Dan Kenigsberg has submitted this change and it was merged.
Change subject: Add an option to create a watchdog device. ......................................................................
Add an option to create a watchdog device.
A support for a watchdog device was added to the "devices" configuration.
Also add the watchdog event callback to log the watchdog action of VM.
model of watchdog: 'i6300esb' default model, emulating a PCI Intel 6300ESB 'ib700' emulating an ISA iBase IB700 Only one watchdog device is supported for each VM.
action of watchdog timeout: 'reset' forcefully reset the guest 'shutdown' gracefully shutdown the guest (not recommended) 'poweroff' forcefully power off the guest 'pause' pause the guest 'none' default, do nothing 'dump' automatically dump the guest
the parameter of 'watchdog' device as follow: {'device': 'watchdog', 'type': 'watchdog', 'specParams': {'model': 'i6300esb', 'action': 'none'}}
The watchdog device can be used to detect guest crash or hang, and if 'dump' is chosen for the action of watchdog timeout, libvirt will dump guest's memory on timeout automatically.
The directory to save dump files can be configured by auto_dump_path in file /etc/libvirt/qemu.conf.
The watchdog device requires an additional driver and management daemon in the guest. Just enabling the watchdog in the vdsm "devices" configuration does not do anything useful on its own.
Change-Id: I2b7970a9050ab0279fe03371b9a77692fba30af8 Signed-off-by: ShaoHe Feng shaohef@linux.vnet.ibm.com --- M tests/libvirtvmTests.py M vdsm/libvirtconnection.py M vdsm/libvirtvm.py M vdsm/vdsmd.init.in M vdsm/vm.py M vdsm_api/vdsmapi-schema.json 6 files changed, 182 insertions(+), 5 deletions(-)
Approvals: ShaoHe Feng: Verified Vinzenz Feenstra: Looks good to me, but someone else must approve Dan Kenigsberg: Looks good to me, approved Michal Skrivanek: Looks good to me, but someone else must approve
-- To view, visit http://gerrit.ovirt.org/7535 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: merged Gerrit-Change-Id: I2b7970a9050ab0279fe03371b9a77692fba30af8 Gerrit-PatchSet: 13 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: ShaoHe Feng shaohef@linux.vnet.ibm.com Gerrit-Reviewer: Adam Litke agl@us.ibm.com Gerrit-Reviewer: Bing Bu Cao mars@linux.vnet.ibm.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: Doron Fediuck dfediuck@redhat.com Gerrit-Reviewer: Mark Wu wudxw@linux.vnet.ibm.com Gerrit-Reviewer: Michael Burns mburns@redhat.com Gerrit-Reviewer: Michal Skrivanek michal.skrivanek@redhat.com Gerrit-Reviewer: Peter V. Saveliev peet@redhat.com Gerrit-Reviewer: Ryan Harper ryanh@us.ibm.com Gerrit-Reviewer: ShaoHe Feng shaohef@linux.vnet.ibm.com Gerrit-Reviewer: Shu Ming shuming@linux.vnet.ibm.com Gerrit-Reviewer: Vinzenz Feenstra vfeenstr@redhat.com Gerrit-Reviewer: Xu He Jie xuhj@linux.vnet.ibm.com Gerrit-Reviewer: Yaniv Bronhaim ybronhei@redhat.com Gerrit-Reviewer: Zhou Zheng Sheng zhshzhou@linux.vnet.ibm.com Gerrit-Reviewer: oVirt Jenkins CI Server
vdsm-patches@lists.fedorahosted.org