Change in vdsm[master]: [WIP] api: Define the VmJobs API
by alitke@redhat.com
Adam Litke has uploaded a new change for review.
Change subject: [WIP] api: Define the VmJobs API
......................................................................
[WIP] api: Define the VmJobs API
As part of the work being done to enable live merge usecases (deleting
snapshots while a VM is running), we need an API for ovirt-engine to
monitor the state of ongoing libvirt Block Jobs. In the future we would
also like to extend this API to support other use cases (eg. migration).
The libvirt API only reports about block jobs while they are active.
Once finished (whether successfully or in error) the job ceases to
exist. We will mirror the same behavior in vdsm to avoid issues related
to persisting information and needing to clean it later.
Here is an example of how this API would be used by ovirt-engine:
1. The user initiates the removal of a VM snapshot.
2. ovirt-engine starts a blockCommit operation using an as yet
unimplemented vdsm API.
3. ovirt-engine monitors the VmStats that are already being collected
to gather progress information on the running live merge.
4. At some point the job will stop appearing in VmStats.
5. ovirt-engine will call an as yet unimplemented API to list the volume
chain for the affected VM Disk. This information will tell
ovirt-engine whether the operation succeeded or failed.
What's missing? This API does not provide a reliable way to report
detailed error messages about the operation. This is because block jobs
disappear as soon as they succeed or fail. To solve this problem on a
best errort basis, vdsm can subscribe to libvirt events to receive block
job error messages which can be relayed to engine in the same way that
other errors are relayed. This would not be fool proof because if
libvirt or vdsm is restarted, some events may be missed. In any case,
the detailed error reporting is a separate issue that can be implemented
by another patch.
Change-Id: I92d8afc2526ba0d2fe930a4227adc2b91f87ba8a
Signed-off-by: Adam Litke <alitke(a)redhat.com>
---
M vdsm/vm.py
M vdsm_api/vdsmapi-schema.json
2 files changed, 102 insertions(+), 1 deletion(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/33/24133/1
diff --git a/vdsm/vm.py b/vdsm/vm.py
index 77f9683..c4220fd 100644
--- a/vdsm/vm.py
+++ b/vdsm/vm.py
@@ -2734,6 +2734,9 @@
stats["watchdogEvent"] = self._watchdogEvent
return stats
+ def _getVmJobs(self):
+ return []
+
def _getStatsInternal(self):
# used by API.Vm.getStats
@@ -2818,6 +2821,7 @@
stats['clientIp'] = self.conf.get('clientIp', '')
if 'pauseCode' in self.conf:
stats['pauseCode'] = self.conf['pauseCode']
+ stats['jobs'] = self._getVmJobs()
try:
stats.update(self.guestAgent.getGuestInfo())
except Exception:
diff --git a/vdsm_api/vdsmapi-schema.json b/vdsm_api/vdsmapi-schema.json
index 6d8c333..037b8be 100644
--- a/vdsm_api/vdsmapi-schema.json
+++ b/vdsm_api/vdsmapi-schema.json
@@ -5589,6 +5589,100 @@
'data': {'time': 'float', 'action': 'WatchdogEventAction'}}
##
+# @VmJobState:
+#
+# An enumeration of VmJob states.
+#
+# @unknown: The state is not known
+#
+# @normal: The job is running normally
+#
+# Since: 4.14.2
+##
+{'enum': 'VmJobState', 'data': ['unknown', 'normal']}
+
+##
+# @VmJobType:
+#
+# An enumeration of VmJob Types.
+#
+# @unknown: The job type is not known
+#
+# @block: A job related to a Vm block device
+#
+# Since: 4.14.2
+##
+{'enum': 'VmJobType', 'data': ['unknown', 'block']}
+
+##
+# @BlockJobType:
+#
+# An enumeration of VM Block Job Types.
+#
+# @copy: A block rebase operation in copy mode
+#
+# @rebase: A block rebase operation
+#
+# @commit: A block commit operation
+#
+# Since: 4.14.2
+##
+{'enum': 'BlockJobType', 'data': ['copy', 'rebase', 'commit']}
+
+##
+# @VmJobInfoBlock:
+#
+# Detailed information about a block job.
+#
+# @jobType: The VmJobType (always @block)
+#
+# @opType: The specific type of operation being performed
+#
+# @bandwidth: Indicates a bandwidth limit in MB/s
+#
+# @cur: A cursor value indicating the job's current position
+#
+# @end: A cursor value indicating the the end of the job
+#
+# @imgUUID: The UUID of the image that this job is working with
+#
+# Since: 4.14.2
+##
+{'type': 'VmJobInfoBlock',
+ 'data': {'jobType': 'VmJobType', 'opType': 'BlockJobType',
+ 'bandwidth': 'uint', 'cur': 'uint', 'end': 'uint',
+ 'imgUUID': 'UUID'}}
+
+##
+# @VmJobInfo:
+#
+# A discriminated record of job type-specific metadata.
+#
+# @jobType: The type of VmJob this metadata describes
+#
+# Since: 4.14.2
+##
+{'type': 'VmJobInfo',
+ 'data': {'jobType': 'VmJobType'},
+ 'union': ['VmJobInfoBlock']}
+
+##
+# @VmJob:
+#
+# Information about an ongoing operation related to a VM.
+#
+# @state: The current state of the job. Note that as soon as jobs finish they
+# will no longer be reported. This field is designed to report any
+# conditions which may require further intervention.
+#
+# @info: Type-specific such as progress information
+#
+# Since: 4.14.2
+##
+{'type': 'VmJob',
+ 'data': {'state': 'VmJobState', 'info': 'VmJobInfo'}}
+
+##
# @RunningVmStats:
#
# Statistics for a running virtual machine.
@@ -5656,6 +5750,8 @@
# @guestFQDN: Fully qualified domain name of the guest OS. (Reported
# by the guest agent)
#
+# @jobs: #optional A list of active Vm Jobs
+#
# Since: 4.10.0
##
{'type': 'RunningVmStats',
@@ -5674,7 +5770,8 @@
'memoryStats': 'GuestMemoryStats', 'balloonInfo': 'BalloonInfo',
'disksUsage': ['GuestMountInfo'],
'netIfaces': ['GuestNetworkDeviceInfo'],
- '*watchdogEvent': 'WatchdogEvent', 'guestFQDN': 'str'}}
+ '*watchdogEvent': 'WatchdogEvent', 'guestFQDN': 'str',
+ '*jobs': ['VmJob']}}
##
# @VmStats:
--
To view, visit http://gerrit.ovirt.org/24133
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I92d8afc2526ba0d2fe930a4227adc2b91f87ba8a
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Adam Litke <alitke(a)redhat.com>
9 years, 12 months
Change in vdsm[master]: vm: spice support to clipboard copypaste disable
by fromani@redhat.com
Francesco Romani has uploaded a new change for review.
Change subject: vm: spice support to clipboard copypaste disable
......................................................................
vm: spice support to clipboard copypaste disable
since version 0.9.3, libvirt allows to optionally disable copy and paste
in the spice protocolol:
http://libvirt.org/formatdomain.html#elementsGraphics
this patch expose this capability in VDSM, in the VM definition.
The new parameter is optional and enabled by default for backward
compatibility.
No XML changes are produced at all unless the new parameter is
specified.
Change-Id: I1f8195da0c3ba2663027b77ea8a858e5ba17c48e
Signed-off-by: Francesco Romani <fromani(a)redhat.com>
---
M tests/vmTests.py
M vdsm/vm.py
M vdsm_api/vdsmapi-schema.json
3 files changed, 38 insertions(+), 5 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/46/22646/1
diff --git a/tests/vmTests.py b/tests/vmTests.py
index f9f2785..be1c6c1 100644
--- a/tests/vmTests.py
+++ b/tests/vmTests.py
@@ -229,6 +229,20 @@
<channel mode="secure" name="playback"/>
<channel mode="secure" name="record"/>
<channel mode="secure" name="display"/>
+ </graphics>""",
+
+ """
+ <graphics autoport="yes" listen="0" passwd="*****"
+ passwdValidTo="1970-01-01T00:00:01" port="-1"
+ tlsPort="-1" type="spice">
+ <clipboard copypaste="no"/>
+ </graphics>""",
+
+ """
+ <graphics autoport="yes" listen="0" passwd="*****"
+ passwdValidTo="1970-01-01T00:00:01" port="-1"
+ tlsPort="-1" type="spice">
+ <channel mode="secure" name="main"/>
</graphics>"""]
spiceChannelXML = """
@@ -242,7 +256,13 @@
{'display': 'qxl', 'displayPort': '-1', 'displaySecurePort': '-1',
'spiceSecureChannels':
- "smain,sinputs,scursor,splayback,srecord,sdisplay"}]
+ "smain,sinputs,scursor,splayback,srecord,sdisplay"},
+
+ {'display': 'qxl', 'displayPort': '-1', 'displaySecurePort': '-1',
+ 'copyPasteEnable': 'false'},
+
+ {'display': 'qxl', 'displayPort': '-1', 'displaySecurePort': '-1',
+ 'copyPasteEnable': 'true', 'spiceSecureChannels': "smain"}]
for vmConf, xml in zip(vmConfs, expectedXMLs):
vmConf.update(self.conf)
diff --git a/vdsm/vm.py b/vdsm/vm.py
index 0a602cb..306ceb3 100644
--- a/vdsm/vm.py
+++ b/vdsm/vm.py
@@ -1108,6 +1108,12 @@
<channel type='spicevmc'>
<target type='virtio' name='com.redhat.spice.0'/>
</channel>
+
+ or
+
+ <graphics autoport="yes" port="5910" tlsPort="5890" type="spice">
+ <clipboard copypaste='no'/>
+ </graphics>
"""
graphicsAttrs = {'port': self.conf['displayPort'], 'autoport': 'yes'}
if self.conf['display'] == 'vnc':
@@ -1129,6 +1135,9 @@
for channel in self.conf['spiceSecureChannels'].split(','):
graphics.appendChildWithArgs('channel', name=channel[1:],
mode='secure')
+ if not utils.tobool(self.conf.get('copyPasteEnable', True)):
+ clipboard = XMLElement('clipboard', copypaste='no')
+ graphics.appendChild(clipboard)
vmc = XMLElement('channel', type='spicevmc')
vmc.appendChildWithArgs('target', type='virtio',
diff --git a/vdsm_api/vdsmapi-schema.json b/vdsm_api/vdsmapi-schema.json
index ce9204f..f813e77 100644
--- a/vdsm_api/vdsmapi-schema.json
+++ b/vdsm_api/vdsmapi-schema.json
@@ -2781,6 +2781,10 @@
#
# @clientIp: The IP address of the client connected to the display
#
+# @copyPasteEnable: #optional Specify if copy and paste is enabled.
+# Currently relevant for @qxl devices only.
+# (new in version 4.13.0)
+#
# @cpuShares: #optional The host scheduling priority (relative to
# other VMs). In case both cpuShares and nice are
# present, cpuShares will be used.
@@ -2847,10 +2851,10 @@
# Since: 4.10.0
##
{'type': 'VmDefinition',
- 'data': {'acpiEnable': 'bool', 'clientIp': 'str', 'cpuShares': 'str',
- '*cpuType': 'str', '*custom': 'StringMap', '*devices': ['VmDevice'],
- 'display': 'VmDisplayType', 'displayIp': 'str',
- 'displayPort': 'int', 'displaySecurePort': 'int',
+ 'data': {'acpiEnable': 'bool', 'clientIp': 'str', '*copyPasteEnable': 'bool',
+ 'cpuShares': 'str', '*cpuType': 'str', '*custom': 'StringMap',
+ '*devices': ['VmDevice'], 'display': 'VmDisplayType',
+ 'displayIp': 'str', 'displayPort': 'int', 'displaySecurePort': 'int',
'*emulatedMachine': 'str', '*keyboardLayout': 'str',
'kvmEnable': 'bool', 'memSize': 'uint', 'memGuaranteedSize': 'uint',
'nicModel': 'str', 'nice': 'int', '*pauseCode': 'str',
--
To view, visit http://gerrit.ovirt.org/22646
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I1f8195da0c3ba2663027b77ea8a858e5ba17c48e
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Francesco Romani <fromani(a)redhat.com>
9 years, 12 months
Change in vdsm[ovirt-3.3]: profiling: Add an application wide profile
by Nir Soffer
Nir Soffer has uploaded a new change for review.
Change subject: profiling: Add an application wide profile
......................................................................
profiling: Add an application wide profile
The built in Python profilers are good for single thread profile but
given the excessive multi-threaded nature of vdsm, they are useless for
understing where we spend our time.
This patch uses yappi <http://code.google.com/p/yappi> to create an
application wide profile. A new profile_enable configuration was added
to enable profiling.
Change-Id: I523f52c981f7bb34f3168d3117f00ed5eb6962f8
Relates-to: https://bugzilla.redhat.com/1074097
Signed-off-by: Nir Soffer <nsoffer(a)redhat.com>
---
M lib/vdsm/config.py.in
M vdsm/vdsm
2 files changed, 15 insertions(+), 0 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/58/26158/1
diff --git a/lib/vdsm/config.py.in b/lib/vdsm/config.py.in
index a229998..db01568 100644
--- a/lib/vdsm/config.py.in
+++ b/lib/vdsm/config.py.in
@@ -29,6 +29,9 @@
('core_dump_enable', 'true',
'Enable core dump.'),
+ ('profile_enable', 'false',
+ 'Enable whole process profiling (requires yappi profiler).'),
+
('host_mem_reserve', '256',
'Reserves memory for the host to prevent VMs from using all the '
'physical pages. The values are in Mbytes.'),
diff --git a/vdsm/vdsm b/vdsm/vdsm
index aa1bb87..59223ed 100755
--- a/vdsm/vdsm
+++ b/vdsm/vdsm
@@ -20,6 +20,7 @@
import syslog
from logging import config as lconfig
+from vdsm.config import config
from vdsm import constants
import zombieReaper
import dsaversion
@@ -55,12 +56,23 @@
signal.signal(signal.SIGUSR1, sigusr1Handler)
zombieReaper.registerSignalHandler()
+ if config.getboolean('vars', 'profile_enable'):
+ logging.debug("Starting profiling")
+ import yappi
+ yappi.start()
+
from clientIF import clientIF # must import after config is read
cif = clientIF.getInstance(log)
cif.start()
try:
while running[0]:
signal.pause()
+
+ if config.getboolean('vars', 'profile_enable'):
+ logging.debug("Stopping profiling")
+ yappi.stop()
+ stats = yappi.get_func_stats()
+ stats.save(constants.P_VDSM_RUN + 'vdsmd.prof', 'pstat')
finally:
cif.prepareForShutdown()
--
To view, visit http://gerrit.ovirt.org/26158
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I523f52c981f7bb34f3168d3117f00ed5eb6962f8
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-3.3
Gerrit-Owner: Nir Soffer <nsoffer(a)redhat.com>
10 years
Change in vdsm[ovirt-3.3]: clientIF: Clean up shutdown process
by Nir Soffer
Nir Soffer has uploaded a new change for review.
Change subject: clientIF: Clean up shutdown process
......................................................................
clientIF: Clean up shutdown process
clientIF.serve used to check if shutdown process has started once every
3 seconds, leading to unwanted delay, that may cause vdsm to be killed
before a profile was written.
This patch changes clientIF.serve to start the bindings and return,
allowing the upper layer to wait for a shutdown signal in a more
efficiant way. This allows stopping a profile when shutdown signal is
received, before starting the shutdown process, ensuring that a profile
is written even if shutdown process got stuck and vdsm is killed.
This way is also more safe, as prepareForShutdown is called from the
main thread, instead of the signal handler context, where it is not safe
to call any code. In particular, setting a threading.Event in this
context cause a deadlock.
Change-Id: If7bfa9f7da81ffdfb581299cd14ec4edb50be5fb
Signed-off-by: Nir Soffer <nsoffer(a)redhat.com>
---
M vdsm/clientIF.py
M vdsm/vdsm
2 files changed, 10 insertions(+), 7 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/57/26157/1
diff --git a/vdsm/clientIF.py b/vdsm/clientIF.py
index 47851b1..664011f 100644
--- a/vdsm/clientIF.py
+++ b/vdsm/clientIF.py
@@ -245,11 +245,9 @@
finally:
self._shutdownSemaphore.release()
- def serve(self):
+ def start(self):
for binding in self.bindings.values():
binding.start()
- while self._enabled:
- time.sleep(3)
def _initIRS(self):
self.irs = None
diff --git a/vdsm/vdsm b/vdsm/vdsm
index 4fc11c7..aa1bb87 100755
--- a/vdsm/vdsm
+++ b/vdsm/vdsm
@@ -39,11 +39,11 @@
def serve_clients(log):
cif = None
+ running = [True]
def sigtermHandler(signum, frame):
- if cif:
- log.debug("Received signal %s" % signum)
- cif.prepareForShutdown()
+ log.debug("Received signal %s" % signum)
+ running[0] = False
def sigusr1Handler(signum, frame):
if cif and cif.irs:
@@ -57,7 +57,12 @@
from clientIF import clientIF # must import after config is read
cif = clientIF.getInstance(log)
- cif.serve()
+ cif.start()
+ try:
+ while running[0]:
+ signal.pause()
+ finally:
+ cif.prepareForShutdown()
def run(pidfile=None):
--
To view, visit http://gerrit.ovirt.org/26157
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: If7bfa9f7da81ffdfb581299cd14ec4edb50be5fb
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-3.3
Gerrit-Owner: Nir Soffer <nsoffer(a)redhat.com>
10 years
Change in vdsm[ovirt-3.3]: sysvinit: Give vdsm enough time to write profile
by Nir Soffer
Nir Soffer has uploaded a new change for review.
Change subject: sysvinit: Give vdsm enough time to write profile
......................................................................
sysvinit: Give vdsm enough time to write profile
Previously vdsm was killed brutally if it did exit 2 seconds after
receiving a SIGTERM. Currently clientIF check if shutdown is started
only once every 3 seconds. This make it impossible to write profile data
when vdsm is terminated.
This patch enlarge the shutdown delay to 10 seconds. This works fine for
profiling of serveral minutes of idle vdsm.
Change-Id: I5434caff5bc95e2a76345191dec9ce4e33070a57
Signed-off-by: Nir Soffer <nsoffer(a)redhat.com>
---
M init/sysvinit/vdsmd.init.in
1 file changed, 2 insertions(+), 1 deletion(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/56/26156/1
diff --git a/init/sysvinit/vdsmd.init.in b/init/sysvinit/vdsmd.init.in
index dc7847e..32a0279 100755
--- a/init/sysvinit/vdsmd.init.in
+++ b/init/sysvinit/vdsmd.init.in
@@ -148,7 +148,8 @@
log_failure_msg "$prog: not running"
RETVAL=0
else
- killproc -p "$PIDFILE" -d 2
+ # Give process enough time for saving profiling data
+ killproc -p "$PIDFILE" -d 10
RETVAL=$?
[ "$RETVAL" = 0 ] && "@RM_PATH@" -f "$LOCK_FILE" > /dev/null 2>&1
fi
--
To view, visit http://gerrit.ovirt.org/26156
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I5434caff5bc95e2a76345191dec9ce4e33070a57
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-3.3
Gerrit-Owner: Nir Soffer <nsoffer(a)redhat.com>
10 years
Change in vdsm[master]: virt: migration: always run migration monitor
by fromani@redhat.com
Francesco Romani has uploaded a new change for review.
Change subject: virt: migration: always run migration monitor
......................................................................
virt: migration: always run migration monitor
The migration monitor thread was run conditionally
if the migration monitor was specified.
This patch let the migration monitor always run.
If the migration monitor interval is disabled (= set to zero)
then the monitor thread will just sit idle.
This patch is a necessary step toward the unification
of MigrationMonitor and MigrationDowntime threads.
Change-Id: Ib4953ddda5a5c6c0ecd7ea0f95377309e18f771a
Signed-off-by: Francesco Romani <fromani(a)redhat.com>
---
M vdsm/migration.py
1 file changed, 17 insertions(+), 6 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/75/25975/1
diff --git a/vdsm/migration.py b/vdsm/migration.py
index a684499..3699ca5 100644
--- a/vdsm/migration.py
+++ b/vdsm/migration.py
@@ -295,10 +295,9 @@
t = MigrationDowntimeThread(self._vm, int(self._downtime))
- if MigrationMonitorThread._MIGRATION_MONITOR_INTERVAL:
- self._monitorThread = MigrationMonitorThread(self._vm,
- startTime)
- self._monitorThread.start()
+ self._monitorThread = MigrationMonitorThread(self._vm,
+ startTime)
+ self._monitorThread.start()
try:
if ('qxl' in self._vm.conf['display'] and
@@ -327,8 +326,7 @@
finally:
t.cancel()
- if MigrationMonitorThread._MIGRATION_MONITOR_INTERVAL:
- self._monitorThread.stop()
+ self._monitorThread.stop()
def stop(self):
# if its locks we are before the migrateToURI2()
@@ -389,7 +387,17 @@
self.daemon = True
self.progress = 0
+ @property
+ def enabled(self):
+ return MigrationMonitorThread._MIGRATION_MONITOR_INTERVAL > 0
+
def run(self):
+ if self.enabled:
+ self.monitor_migration()
+ else:
+ self.idle()
+
+ def monitor_migration(self):
def calculateProgress(remaining, total):
if remaining == 0:
return 100
@@ -455,6 +463,9 @@
' data processed' %
(timeElapsed / 1000, self.progress))
+ def idle(self):
+ self._stop.wait(1.0)
+
def stop(self):
self._vm.log.debug('stopping migration monitor thread')
self._stop.set()
--
To view, visit http://gerrit.ovirt.org/25975
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib4953ddda5a5c6c0ecd7ea0f95377309e18f771a
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Francesco Romani <fromani(a)redhat.com>
10 years
Change in vdsm[master]: Rename *Volume.extend method to *Volume.enlarge
by ewarszaw@redhat.com
Eduardo has uploaded a new change for review.
Change subject: Rename *Volume.extend method to *Volume.enlarge
......................................................................
Rename *Volume.extend method to *Volume.enlarge
Change-Id: Id7b88067fa3fe2c19faab31d0c882b4494f0bc12
Signed-off-by: Eduardo <ewarszaw(a)redhat.com>
---
M vdsm/storage/blockVolume.py
M vdsm/storage/image.py
M vdsm/storage/sp.py
M vdsm/storage/volume.py
4 files changed, 8 insertions(+), 8 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/02/17802/1
diff --git a/vdsm/storage/blockVolume.py b/vdsm/storage/blockVolume.py
index effd3a5..5a99333 100644
--- a/vdsm/storage/blockVolume.py
+++ b/vdsm/storage/blockVolume.py
@@ -284,7 +284,7 @@
raise eFound
- def extend(self, newSize):
+ def enlarge(self, newSize):
"""Extend a logical volume
'newSize' - new size in blocks
"""
diff --git a/vdsm/storage/image.py b/vdsm/storage/image.py
index e3414b4..eb37f09 100644
--- a/vdsm/storage/image.py
+++ b/vdsm/storage/image.py
@@ -394,7 +394,7 @@
volUUID=srcVol.volUUID)
# Extend volume (for LV only) size to the actual size
- dstVol.extend((volParams['apparentsize'] + 511) / 512)
+ dstVol.enlarge((volParams['apparentsize'] + 511) / 512)
# Change destination volume metadata back to the original
# type.
@@ -742,7 +742,7 @@
newsize = volParams['size']
else:
newsize = volParams['apparentsize']
- dstVol.extend(newsize)
+ dstVol.enlarge(newsize)
dstPath = dstVol.getVolumePath()
# Change destination volume metadata back to the original size.
dstVol.setSize(volParams['size'])
@@ -882,7 +882,7 @@
srcVol = sdDom.produceVolume(imgUUID=srcVolParams['imgUUID'],
volUUID=srcVolParams['volUUID'])
# Extend successor volume to new accumulated subchain size
- srcVol.extend(newSize)
+ srcVol.enlarge(newSize)
srcVol.prepare(rw=True, chainrw=True, setrw=True)
try:
@@ -918,7 +918,7 @@
srcVol = sdDom.produceVolume(imgUUID=srcVolParams['imgUUID'],
volUUID=srcVolParams['volUUID'])
# Extend successor volume to new accumulated subchain size
- srcVol.extend(newSize)
+ srcVol.enlarge(newSize)
# Step 1: Create temporary volume with destination volume's parent
# parameters
newUUID = str(uuid.uuid4())
@@ -1178,7 +1178,7 @@
vol = self._activateVolumeForImportExport(domain, imgUUID, volUUID)
try:
# Extend the volume (if relevant) to the image size
- vol.extend(imageSharing.getSize(methodArgs) / volume.BLOCK_SIZE)
+ vol.enlarge(imageSharing.getSize(methodArgs) / volume.BLOCK_SIZE)
imageSharing.download(vol.getVolumePath(), methodArgs)
finally:
domain.deactivateVolumes(imgUUID, volUUIDs=[vol.volUUID])
diff --git a/vdsm/storage/sp.py b/vdsm/storage/sp.py
index 3f3c1bf..348c02a 100644
--- a/vdsm/storage/sp.py
+++ b/vdsm/storage/sp.py
@@ -2071,7 +2071,7 @@
raise se.NonLeafVolumeNotWritable(vol)
targetPath = vol.getVolumePath()
if vol.isSparse():
- vol.extend(int(size))
+ vol.enlarge(int(size))
vol.prepare(rw=True, setrw=False)
try:
diff --git a/vdsm/storage/volume.py b/vdsm/storage/volume.py
index 10b3363..6a028e4 100644
--- a/vdsm/storage/volume.py
+++ b/vdsm/storage/volume.py
@@ -540,7 +540,7 @@
self.log.warn("Volume %s metadata error (%s)",
self.volUUID, str(e))
- def extend(self, newsize):
+ def enlarge(self, newsize):
"""
Extend the apparent size of logical volume (thin provisioning)
"""
--
To view, visit http://gerrit.ovirt.org/17802
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Id7b88067fa3fe2c19faab31d0c882b4494f0bc12
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Eduardo <ewarszaw(a)redhat.com>
10 years
Change in vdsm[master]: [WIP] Small objects repository file implementation
by Federico Simoncelli
Federico Simoncelli has uploaded a new change for review.
Change subject: [WIP] Small objects repository file implementation
......................................................................
[WIP] Small objects repository file implementation
Change-Id: I3003f8652a58c68a966bc37e591c1d1d2308c164
---
M vdsm/storage/fileSD.py
M vdsm/storage/hsm.py
M vdsm/storage/outOfProcess.py
M vdsm/storage/sd.py
M vdsm/storage/sp.py
M vdsm_cli/vdsClient.py
6 files changed, 83 insertions(+), 2 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/42/242/1
--
To view, visit http://gerrit.ovirt.org/242
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I3003f8652a58c68a966bc37e591c1d1d2308c164
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Federico Simoncelli <fsimonce(a)redhat.com>
10 years
Change in vdsm[master]: Add a chown implementation that looks up uid and gid
by Federico Simoncelli
Federico Simoncelli has uploaded a new change for review.
Change subject: Add a chown implementation that looks up uid and gid
......................................................................
Add a chown implementation that looks up uid and gid
We already have a case in vdsm (configNetwork) where we need to use
a chown function that is capable to convert the owner and group names
to uid and gid. Going forward this can be reused for the deployment
utilities and to prepare the paths needed by vdsm (eg: /rhev and
/var/run/vdsm).
Change-Id: Iab6f67ba93a0d9cbac775992623f3bb2ab996555
---
M vdsm/configNetwork.py
M vdsm/utils.py
2 files changed, 21 insertions(+), 5 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/87/387/1
--
To view, visit http://gerrit.ovirt.org/387
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Iab6f67ba93a0d9cbac775992623f3bb2ab996555
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Federico Simoncelli <fsimonce(a)redhat.com>
10 years
Change in vdsm[master]: constants: unify the BLANK_UUID definition
by Federico Simoncelli
Federico Simoncelli has uploaded a new change for review.
Change subject: constants: unify the BLANK_UUID definition
......................................................................
constants: unify the BLANK_UUID definition
Change-Id: Ib9260d74ae1da1382394a375843b2edff112e6f7
Signed-off-by: Federico Simoncelli <fsimonce(a)redhat.com>
---
M client/vdsClient.py
M lib/vdsm/constants.py.in
M vdsm/API.py
M vdsm/storage/misc.py
M vdsm/storage/sd.py
M vdsm/storage/volume.py
6 files changed, 11 insertions(+), 9 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/42/15442/1
diff --git a/client/vdsClient.py b/client/vdsClient.py
index 332b438..0aabd5b 100644
--- a/client/vdsClient.py
+++ b/client/vdsClient.py
@@ -26,13 +26,13 @@
import pprint as pp
from vdsm import vdscli
+from vdsm.constants import BLANK_UUID
+
try:
import vdsClientGluster as ge
_glusterEnabled = True
except ImportError:
_glusterEnabled = False
-
-BLANK_UUID = '00000000-0000-0000-0000-000000000000'
STATUS_ERROR = {'status': {'code': 100, 'message': "ERROR"}}
diff --git a/lib/vdsm/constants.py.in b/lib/vdsm/constants.py.in
index 63771f6..c750462 100644
--- a/lib/vdsm/constants.py.in
+++ b/lib/vdsm/constants.py.in
@@ -53,6 +53,7 @@
SUPPORTED_DOMAIN_VERSIONS = DOMAIN_VERSIONS
UUID_GLOB_PATTERN = '*-*-*-*-*'
+BLANK_UUID = '00000000-0000-0000-0000-000000000000'
MEGAB = 2 ** 20 # = 1024 ** 2 = 1 MiB
diff --git a/vdsm/API.py b/vdsm/API.py
index e04e894..0eb23b4 100644
--- a/vdsm/API.py
+++ b/vdsm/API.py
@@ -104,6 +104,8 @@
class VM(APIBase):
ctorArgs = ['vmID']
+ BLANK_UUID = constants.BLANK_UUID
+
def __init__(self, UUID):
APIBase.__init__(self)
self._UUID = UUID
@@ -676,7 +678,7 @@
SHARED = storage.volume.SHARED_VOL
LEAF = storage.volume.LEAF_VOL
- BLANK_UUID = storage.volume.BLANK_UUID
+ BLANK_UUID = constants.BLANK_UUID
def __init__(self, UUID, spUUID, sdUUID, imgUUID):
APIBase.__init__(self)
@@ -747,7 +749,7 @@
class Image(APIBase):
ctorArgs = ['imageID', 'storagepoolID', 'storagedomainID']
- BLANK_UUID = storage.volume.BLANK_UUID
+ BLANK_UUID = constants.BLANK_UUID
class DiskTypes:
UNKNOWN = storage.image.UNKNOWN_DISK_TYPE
@@ -855,7 +857,7 @@
ISO = storage.sd.ISO_DOMAIN
BACKUP = storage.sd.BACKUP_DOMAIN
- BLANK_UUID = storage.sd.BLANK_UUID
+ BLANK_UUID = constants.BLANK_UUID
def __init__(self, UUID):
APIBase.__init__(self)
diff --git a/vdsm/storage/misc.py b/vdsm/storage/misc.py
index e5ba760..a107fb6 100644
--- a/vdsm/storage/misc.py
+++ b/vdsm/storage/misc.py
@@ -433,7 +433,6 @@
UUID_REGEX = re.compile("^[a-f0-9]{8}-(?:[a-f0-9]{4}-){3}[a-f0-9]{12}$")
-UUID_BLANK = "00000000-0000-0000-0000-000000000000"
def validateUUID(uuid, name="uuid", blank=True):
@@ -455,7 +454,7 @@
if m is None:
raise se.InvalidParameterException(name, uuid)
- if not blank and uuid == UUID_BLANK:
+ if not blank and uuid == constants.BLANK_UUID:
raise se.InvalidParameterException(name, uuid)
diff --git a/vdsm/storage/sd.py b/vdsm/storage/sd.py
index 8c55c09..0f71b3d 100644
--- a/vdsm/storage/sd.py
+++ b/vdsm/storage/sd.py
@@ -133,7 +133,7 @@
ImgsPar = namedtuple("ImgsPar", "imgs,parent")
ISO_IMAGE_UUID = '11111111-1111-1111-1111-111111111111'
-BLANK_UUID = '00000000-0000-0000-0000-000000000000'
+BLANK_UUID = constants.BLANK_UUID
REMOVED_IMAGE_PREFIX = "_remove_me_"
ZEROED_IMAGE_PREFIX = REMOVED_IMAGE_PREFIX + "ZERO_"
diff --git a/vdsm/storage/volume.py b/vdsm/storage/volume.py
index 36e8d30..737f24e 100644
--- a/vdsm/storage/volume.py
+++ b/vdsm/storage/volume.py
@@ -68,7 +68,7 @@
SHARED_VOL: 'SHARED', INTERNAL_VOL: 'INTERNAL',
LEAF_VOL: 'LEAF'}
-BLANK_UUID = misc.UUID_BLANK
+BLANK_UUID = constants.BLANK_UUID
# Volume meta data fields
SIZE = "SIZE"
--
To view, visit http://gerrit.ovirt.org/15442
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib9260d74ae1da1382394a375843b2edff112e6f7
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Federico Simoncelli <fsimonce(a)redhat.com>
10 years