Change in vdsm[master]: NetReload: netmodels for addNetwork
by gvallare@redhat.com
Giuseppe Vallarelli has posted comments on this change.
Change subject: NetReload: netmodels for addNetwork
......................................................................
Patch Set 4: (1 inline comment)
....................................................
File vdsm/netconf/ifcfg.py
Line 63: if self.configWriter:
Line 64: self.configWriter = None
Line 65: self._libvirtAdded = set()
Line 66:
Line 67: def configureBridge(self, bridge, network=None, **opts):
I saw that you did this design choice, by having an external object which does the configuration (Ifcfg), I don't feel like it's really needed, but probably there are some reasons for that.
Line 68: try:
Line 69: ipaddr = bridge.ip.inet.address
Line 70: netmask = bridge.ip.inet.netmask
Line 71: gateway = bridge.ip.inet.gateway
--
To view, visit http://gerrit.ovirt.org/14303
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: Iba5c5b84760e27245cbe34c3b290c54e51278e72
Gerrit-PatchSet: 4
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Antoni Segura Puimedon <asegurap(a)redhat.com>
Gerrit-Reviewer: Antoni Segura Puimedon <asegurap(a)redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: Giuseppe Vallarelli <gvallare(a)redhat.com>
Gerrit-Reviewer: Mark Wu <wudxw(a)linux.vnet.ibm.com>
Gerrit-Reviewer: oVirt Jenkins CI Server
10 years, 1 month
Change in vdsm[master]: NetReload: netmodels for addNetwork
by gvallare@redhat.com
Giuseppe Vallarelli has posted comments on this change.
Change subject: NetReload: netmodels for addNetwork
......................................................................
Patch Set 4: (1 inline comment)
....................................................
File vdsm/netconf/ifcfg.py
Line 63: if self.configWriter:
Line 64: self.configWriter = None
Line 65: self._libvirtAdded = set()
Line 66:
Line 67: def configureBridge(self, bridge, network=None, **opts):
All the different configureX use internal attributes of the object they're trying to configure, what if all the entities have a proper configure method, what do you think?
Line 68: try:
Line 69: ipaddr = bridge.ip.inet.address
Line 70: netmask = bridge.ip.inet.netmask
Line 71: gateway = bridge.ip.inet.gateway
--
To view, visit http://gerrit.ovirt.org/14303
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: Iba5c5b84760e27245cbe34c3b290c54e51278e72
Gerrit-PatchSet: 4
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Antoni Segura Puimedon <asegurap(a)redhat.com>
Gerrit-Reviewer: Antoni Segura Puimedon <asegurap(a)redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: Giuseppe Vallarelli <gvallare(a)redhat.com>
Gerrit-Reviewer: Mark Wu <wudxw(a)linux.vnet.ibm.com>
Gerrit-Reviewer: oVirt Jenkins CI Server
10 years, 1 month
Change in vdsm[master]: NetReload: netmodels for addNetwork
by gvallare@redhat.com
Giuseppe Vallarelli has posted comments on this change.
Change subject: NetReload: netmodels for addNetwork
......................................................................
Patch Set 4: (1 inline comment)
....................................................
File vdsm/configNetwork.py
Line 47: MAX_BRIDGE_NAME_LEN = 15
Line 48: ILLEGAL_BRIDGE_CHARS = frozenset(':. \t')
Line 49:
Line 50:
Line 51: def objectivizeNetwork(net, bridged=None, vlan=None, bonding=None,
A docstring may help to explain the meaning of topObj (I would look for a better name) and how it is composed.
Line 52: bondingOptions=None, nics=None, mtu=None, ipaddr=None,
Line 53: netmask=None, gateway=None, bootproto=None,
Line 54: _netinfo=None, configurator=None, **opts):
Line 55: if configurator is None:
--
To view, visit http://gerrit.ovirt.org/14303
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: Iba5c5b84760e27245cbe34c3b290c54e51278e72
Gerrit-PatchSet: 4
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Antoni Segura Puimedon <asegurap(a)redhat.com>
Gerrit-Reviewer: Antoni Segura Puimedon <asegurap(a)redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: Giuseppe Vallarelli <gvallare(a)redhat.com>
Gerrit-Reviewer: Mark Wu <wudxw(a)linux.vnet.ibm.com>
Gerrit-Reviewer: oVirt Jenkins CI Server
10 years, 1 month
Change in vdsm[master]: NetReload: netmodels for addNetwork
by gvallare@redhat.com
Giuseppe Vallarelli has posted comments on this change.
Change subject: NetReload: netmodels for addNetwork
......................................................................
Patch Set 4: (1 inline comment)
....................................................
File vdsm/configNetwork.py
Line 50:
Line 51: def objectivizeNetwork(net, bridged=None, vlan=None, bonding=None,
Line 52: bondingOptions=None, nics=None, mtu=None, ipaddr=None,
Line 53: netmask=None, gateway=None, bootproto=None,
Line 54: _netinfo=None, configurator=None, **opts):
What about having Ifcfg() as default parameter to configurator, same for netinfo.NetInfo() ? So you can remove these 2 ifs.
Line 55: if configurator is None:
Line 56: configurator = Ifcfg()
Line 57: if _netinfo is None:
Line 58: _netinfo = netinfo.NetInfo()
--
To view, visit http://gerrit.ovirt.org/14303
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: Iba5c5b84760e27245cbe34c3b290c54e51278e72
Gerrit-PatchSet: 4
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Antoni Segura Puimedon <asegurap(a)redhat.com>
Gerrit-Reviewer: Antoni Segura Puimedon <asegurap(a)redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: Giuseppe Vallarelli <gvallare(a)redhat.com>
Gerrit-Reviewer: Mark Wu <wudxw(a)linux.vnet.ibm.com>
Gerrit-Reviewer: oVirt Jenkins CI Server
10 years, 1 month
Change in vdsm[master]: NetReload: netmodels for addNetwork
by gvallare@redhat.com
Giuseppe Vallarelli has posted comments on this change.
Change subject: NetReload: netmodels for addNetwork
......................................................................
Patch Set 4: (1 inline comment)
....................................................
File vdsm/configNetwork.py
Line 76: bootproto=bootproto)
Line 77: return topObj
Line 78:
Line 79:
Line 80: def objectivizeBond(bonding, bondingOptions, nics, mtu, _netinfo,
I feel that this logic should belong to the Bond class, the same applies for objectivizeNic and respective Nic class. What do you think?
Line 81: configurator):
Line 82: if bonding and nics:
Line 83: slaves = []
Line 84: bondMtu = netinfo.getMaxMtu(nics, mtu)
--
To view, visit http://gerrit.ovirt.org/14303
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: Iba5c5b84760e27245cbe34c3b290c54e51278e72
Gerrit-PatchSet: 4
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Antoni Segura Puimedon <asegurap(a)redhat.com>
Gerrit-Reviewer: Antoni Segura Puimedon <asegurap(a)redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: Giuseppe Vallarelli <gvallare(a)redhat.com>
Gerrit-Reviewer: Mark Wu <wudxw(a)linux.vnet.ibm.com>
Gerrit-Reviewer: oVirt Jenkins CI Server
10 years, 1 month
Change in vdsm[master]: vm: update volume apparentsize after snapshot
by Federico Simoncelli
Federico Simoncelli has uploaded a new change for review.
Change subject: vm: update volume apparentsize after snapshot
......................................................................
vm: update volume apparentsize after snapshot
After a live snapshot succeeded we need to force the update of the
volume apparentsize to avoid races in the extension requests.
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=923964
Change-Id: I472c2931551643914e6a09b54d3d96f371f34864
Signed-off-by: Federico Simoncelli <fsimonce(a)redhat.com>
---
M vdsm/libvirtvm.py
1 file changed, 41 insertions(+), 25 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/46/13346/1
diff --git a/vdsm/libvirtvm.py b/vdsm/libvirtvm.py
index cb792b5..8e4f5ce 100644
--- a/vdsm/libvirtvm.py
+++ b/vdsm/libvirtvm.py
@@ -146,16 +146,7 @@
return
for vmDrive in self._vm._devices[vm.DISK_DEVICES]:
- if vmDrive.device == 'disk' and vmDrive.isVdsmImage():
- volSize = self._vm.cif.irs.getVolumeSize(
- vmDrive.domainID, vmDrive.poolID, vmDrive.imageID,
- vmDrive.volumeID)
-
- if volSize['status']['code'] != 0:
- continue
-
- vmDrive.truesize = int(volSize['truesize'])
- vmDrive.apparentsize = int(volSize['apparentsize'])
+ self._vm.updateDriveVolume(vmDrive)
def _sampleCpu(self):
cpuStats = self._vm._dom.getCPUStats(True, 0)
@@ -1929,28 +1920,47 @@
raise LookupError("No such drive: '%s'" % drive)
- def _updateDrive(self, drive):
+ def updateDriveVolume(self, vmDrive):
+ if not vmDrive.device == 'disk' or not vmDrive.isVdsmImage():
+ return
+
+ volSize = self.cif.irs.getVolumeSize(
+ vmDrive.domainID, vmDrive.poolID, vmDrive.imageID,
+ vmDrive.volumeID)
+
+ if volSize['status']['code'] != 0:
+ self.log.error(
+ "Unable to update the volume %s (domain: %s image: %s) "
+ "for the drive %s" % (vmDrive.volumeID, vmDrive.domainID,
+ vmDrive.imageID, vmDrive.name))
+ return
+
+ vmDrive.truesize = int(volSize['truesize'])
+ vmDrive.apparentsize = int(volSize['apparentsize'])
+
+ def updateDriveParameters(self, driveParams):
"""Update the drive with the new volume information"""
- # Updating the drive object
- for device in self._devices[vm.DISK_DEVICES][:]:
- if device.name == drive["name"]:
- for k, v in drive.iteritems():
- setattr(device, k, v)
+ # Updating the vmDrive object
+ for vmDrive in self._devices[vm.DISK_DEVICES][:]:
+ if vmDrive.name == driveParams["name"]:
+ for k, v in driveParams.iteritems():
+ setattr(vmDrive, k, v)
+ self.updateDriveVolume(vmDrive)
break
else:
self.log.error("Unable to update the drive object for: %s",
- drive["name"])
+ driveParams["name"])
# Updating the VM configuration
- for device in self.conf["devices"][:]:
- if (device['type'] == vm.DISK_DEVICES and
- device.get("name") == drive["name"]):
- device.update(drive)
+ for vmDriveConfig in self.conf["devices"][:]:
+ if (vmDriveConfig['type'] == vm.DISK_DEVICES and
+ vmDriveConfig.get("name") == driveParams["name"]):
+ vmDriveConfig.update(driveParams)
break
else:
self.log.error("Unable to update the device configuration ",
- "for: %s", drive["name"])
+ "for: %s", driveParams["name"])
self.saveState()
@@ -2055,6 +2065,12 @@
snapxml = snap.toprettyxml()
self.log.debug(snapxml)
+
+ # We need to stop the collection of the stats for two reasons, one
+ # is to prevent spurious libvirt errors about missing drive paths
+ # (since we're changing them), and also to prevent to trigger a drive
+ # extension for the new volume with the apparent size of the old one
+ # (the apparentsize is updated as last step in updateDriveParameters)
self.stopDisksStatsCollection()
snapFlags = (libvirt.VIR_DOMAIN_SNAPSHOT_CREATE_DISK_ONLY |
@@ -2089,7 +2105,7 @@
else:
# Update the drive information
for drive in newDrives.values():
- self._updateDrive(drive)
+ self.updateDriveParameters(drive)
finally:
self.startDisksStatsCollection()
@@ -2315,7 +2331,7 @@
# Updating the destination disk device and name, the device is used by
# prepareVolumePath (required to fill the new information as the path)
- # and the name is used by _updateDrive.
+ # and the name is used by updateDriveParameters.
dstDiskCopy.update({'device': srcDrive.device, 'name': srcDrive.name})
dstDiskCopy['path'] = self.cif.prepareVolumePath(dstDiskCopy)
@@ -2356,7 +2372,7 @@
# There is nothing we can do at this point other than logging
self.log.error("Unable to teardown the previous chain: %s",
diskToTeardown, exc_info=True)
- self._updateDrive(dstDiskCopy) # Updating the drive structure
+ self.updateDriveParameters(dstDiskCopy)
finally:
self._delDiskReplica(srcDrive)
self.startDisksStatsCollection()
--
To view, visit http://gerrit.ovirt.org/13346
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I472c2931551643914e6a09b54d3d96f371f34864
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Federico Simoncelli <fsimonce(a)redhat.com>
10 years, 1 month
Change in vdsm[master]: iscsi: Move iscsi constatnts to the appropriate module
by ykaplan@redhat.com
Yeela Kaplan has uploaded a new change for review.
Change subject: iscsi: Move iscsi constatnts to the appropriate module
......................................................................
iscsi: Move iscsi constatnts to the appropriate module
Change-Id: I75e383cfc26cbe0c6fcb124b6639f7664ad31e91
Signed-off-by: Yeela Kaplan <ykaplan(a)redhat.com>
---
M lib/vdsm/constants.py.in
M vdsm/storage/iscsi.py
2 files changed, 7 insertions(+), 11 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/25/14225/1
diff --git a/lib/vdsm/constants.py.in b/lib/vdsm/constants.py.in
index e7e2f83..94f4d92 100644
--- a/lib/vdsm/constants.py.in
+++ b/lib/vdsm/constants.py.in
@@ -147,10 +147,3 @@
EXT_WGET = '@WGET_PATH@'
EXT_WRITE_NET_CONFIG = '@VDSMDIR@/write-net-config'
-
-#
-# Storage constants
-#
-STRG_ISCSI_HOST = "iscsi_host/"
-STRG_SCSI_HOST = "scsi_host/"
-STRG_ISCSI_SESSION = "iscsi_session/"
diff --git a/vdsm/storage/iscsi.py b/vdsm/storage/iscsi.py
index f2ff0db..1f8c9ab 100644
--- a/vdsm/storage/iscsi.py
+++ b/vdsm/storage/iscsi.py
@@ -45,6 +45,10 @@
ISCSI_DEFAULT_PORT = 3260
SCAN_PATTERN = "/sys/class/scsi_host/host*/scan"
+STRG_ISCSI_HOST = "iscsi_host/"
+STRG_SCSI_HOST = "scsi_host/"
+STRG_ISCSI_SESSION = "iscsi_session/"
+
IscsiSession = namedtuple("IscsiSession", "id, iface, target, credentials")
_iscsiadmTransactionLock = RLock()
@@ -428,8 +432,8 @@
hostdir = os.path.realpath(os.path.join("/sys/block", dev,
"device/../../.."))
host = os.path.basename(hostdir)
- iscsi_host = os.path.join(hostdir, constants.STRG_ISCSI_HOST, host)
- scsi_host = os.path.join(hostdir, constants.STRG_SCSI_HOST, host)
+ iscsi_host = os.path.join(hostdir, STRG_ISCSI_HOST, host)
+ scsi_host = os.path.join(hostdir, STRG_SCSI_HOST, host)
proc_name = os.path.join(scsi_host, "proc_name")
return (os.path.exists(iscsi_host) and os.path.exists(proc_name))
@@ -439,8 +443,7 @@
device = os.path.realpath(os.path.join("/sys/block", dev, "device"))
sessiondir = os.path.realpath(os.path.join(device, "../.."))
session = os.path.basename(sessiondir)
- iscsi_session = os.path.join(sessiondir,
- constants.STRG_ISCSI_SESSION + session)
+ iscsi_session = os.path.join(sessiondir, STRG_ISCSI_SESSION + session)
with open(os.path.join(iscsi_session, "targetname")) as f:
return f.readline().strip()
--
To view, visit http://gerrit.ovirt.org/14225
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I75e383cfc26cbe0c6fcb124b6639f7664ad31e91
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Yeela Kaplan <ykaplan(a)redhat.com>
10 years, 1 month