Change in vdsm[master]: hook-fcoe is arch depended
by ybronhei@redhat.com
Yaniv Bronhaim has uploaded a new change for review.
Change subject: hook-fcoe is arch depended
......................................................................
hook-fcoe is arch depended
Using %post script in sub-package of arch depended package requires to
declare the package as arch depended.
Change-Id: Ic59d7e29a75b13e1fc39b58a8d1252d6d2971058
Signed-off-by: Yaniv Bronhaim <ybronhei(a)redhat.com>
---
M vdsm.spec.in
1 file changed, 0 insertions(+), 1 deletion(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/54/62454/1
diff --git a/vdsm.spec.in b/vdsm.spec.in
index edd8e82..728a534 100644
--- a/vdsm.spec.in
+++ b/vdsm.spec.in
@@ -681,7 +681,6 @@
%package hook-fcoe
Summary: Hook to enable FCoE support
-BuildArch: noarch
Requires: %{name} = %{version}-%{release}
Requires: fcoe-utils
--
To view, visit https://gerrit.ovirt.org/62454
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic59d7e29a75b13e1fc39b58a8d1252d6d2971058
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Yaniv Bronhaim <ybronhei(a)redhat.com>
7 years, 5 months
Change in vdsm[master]: Revert "Remove __init__.py file from lib64 vdsm python direc...
by ybronhei@redhat.com
Yaniv Bronhaim has uploaded a new change for review.
Change subject: Revert "Remove __init__.py file from lib64 vdsm python directory"
......................................................................
Revert "Remove __init__.py file from lib64 vdsm python directory"
This reverts commit 9f9e8b37c6fb120f1bb40514c9d22c9d5602dded. Which is
not needed anymore (we stop supporting upgrade from vdsm <=17). Without
the %post script we can declare vdsm-python as noarch.
Change-Id: Id06b502c714074a62c8ac6b5d5cb9d350472137b
Signed-off-by: Yaniv Bronhaim <ybronhei(a)redhat.com>
---
M vdsm.spec.in
1 file changed, 0 insertions(+), 13 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/53/62453/1
diff --git a/vdsm.spec.in b/vdsm.spec.in
index edd8e82..8aaa866 100644
--- a/vdsm.spec.in
+++ b/vdsm.spec.in
@@ -347,19 +347,6 @@
%description python
Shared libraries between the various VDSM packages.
-%post python
-# REQUIRED_FOR: Upgrade from 4.14 to 4.17
-# HACK: Remove vdsm python lib __init__ file if installed on old location
-# https://bugzilla.redhat.com/show_bug.cgi?id=1279167
-if [ "$1" -ge 2 ]; then
- if [ -d "%{python2_sitearch}/%{vdsm_name}" ]; then
- logger -t '%{vdsm_name}' \
- 'Disabling old vdsm package in %{python2_sitearch}/%{vdsm_name}.' \
- 'Removing %{python2_sitearch}/%{vdsm_name}/init.py*'
- rm -f %{python2_sitearch}/%{vdsm_name}/__init__.py*
- fi
-fi
-
%package tests
Summary: VDSM Test Suite
BuildArch: noarch
--
To view, visit https://gerrit.ovirt.org/62453
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Id06b502c714074a62c8ac6b5d5cb9d350472137b
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Yaniv Bronhaim <ybronhei(a)redhat.com>
7 years, 5 months
Change in vdsm[master]: virt: Always execute after_hibernation event
by Vinzenz Feenstra
Vinzenz Feenstra has uploaded a new change for review.
Change subject: virt: Always execute after_hibernation event
......................................................................
virt: Always execute after_hibernation event
Previously we had no way that the after_hibernation event got executed.
The enableGuestEvents value was never set to true and we're now also
dropping it on the migration destination.
Since there is also no parameter for enabling guest events on the suspend
call it, we decided that it is much more beneficial to let the VM always
know that it is going to be hibernated and/or has been resumed from
hibernation.
Since purely from theory this information can be also determined without
the notifications there's no security issue that the Virtual Machine would
know too much about it's environment. However it's beneficial for a range of
applications which need to resynchronize, adjust the time or re-accquire an
IP address via DHCP etc.
Change-Id: Ic52b8c22d57028fb6459c7faa2bcfebd8f32d6c4
Bug-Url: https://bugzilla.redhat.com/1349907
Signed-off-by: Vinzenz Feenstra <vfeenstr(a)redhat.com>
---
M vdsm/virt/vm.py
1 file changed, 12 insertions(+), 7 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/14/59914/1
diff --git a/vdsm/virt/vm.py b/vdsm/virt/vm.py
index c2b1b93..d8e4239 100644
--- a/vdsm/virt/vm.py
+++ b/vdsm/virt/vm.py
@@ -1866,14 +1866,19 @@
except Exception:
self.log.exception("Failed to connect to guest agent channel")
- try:
- if self.conf.get('enableGuestEvents', False):
- if self.lastStatus == vmstatus.MIGRATION_DESTINATION:
+ if self.lastStatus == vmstatus.RESTORING_STATE:
+ try:
+ self.guestAgent.events.after_hibernation()
+ except Exception:
+ self.log.exception("Unexpected error on guest after "
+ "hibernation notification")
+ elif self.conf.get('enableGuestEvents', False):
+ if self.lastStatus == vmstatus.MIGRATION_DESTINATION:
+ try:
self.guestAgent.events.after_migration()
- elif self.lastStatus == vmstatus.RESTORING_STATE:
- self.guestAgent.events.after_hibernation()
- except Exception:
- self.log.exception("Unexpected error on guest event notification")
+ except Exception:
+ self.log.exception("Unexpected error on guest after "
+ "migration notification")
# Drop enableGuestEvents from conf - Not required from here anymore
self.conf.pop('enableGuestEvents', None)
--
To view, visit https://gerrit.ovirt.org/59914
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic52b8c22d57028fb6459c7faa2bcfebd8f32d6c4
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Vinzenz Feenstra <vfeenstr(a)redhat.com>
7 years, 5 months
Change in vdsm[master]: vm: legacy rng devices fix not needed anymore
by fromani@redhat.com
Francesco Romani has uploaded a new change for review.
Change subject: vm: legacy rng devices fix not needed anymore
......................................................................
vm: legacy rng devices fix not needed anymore
We introduced this fix to deal with upgrades from Vdsm
4.16.z, and we don't need this anymore.
Change-Id: I34eef559ef3d789fd502490acc9691df15c684b9
Signed-off-by: Francesco Romani <fromani(a)redhat.com>
---
M vdsm/virt/vm.py
1 file changed, 0 insertions(+), 26 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/43/61243/1
diff --git a/vdsm/virt/vm.py b/vdsm/virt/vm.py
index 61a59ca..df32da0 100644
--- a/vdsm/virt/vm.py
+++ b/vdsm/virt/vm.py
@@ -1647,13 +1647,6 @@
self._updateDomainDescriptor()
- # REQUIRED_FOR migrate from vdsm-4.16
- #
- # We need to clean out unknown devices that are created for
- # RNG devices by VDSM 3.5 and are left in the configuration
- # after upgrade to 3.6.
- self._fixLegacyRngConf()
-
self._getUnderlyingVmDevicesInfo()
self._updateAgentChannels()
@@ -4604,25 +4597,6 @@
newChain = [x for x in device['volumeChain']
if x['volumeID'] in volumes]
device['volumeChain'] = drive.volumeChain = newChain
-
- def _fixLegacyRngConf(self):
- def _is_legacy_rng_device_conf(dev):
- """
- Returns True if dev is a legacy (3.5) RNG device conf,
- False otherwise.
- """
- return dev['type'] == hwclass.RNG and (
- 'specParams' not in dev or
- 'source' not in dev['specParams']
- )
-
- with self._confLock:
- self._devices[hwclass.RNG] = [dev for dev
- in self._devices[hwclass.RNG]
- if 'source' in dev.specParams]
- self.conf['devices'] = [dev for dev
- in self.conf['devices']
- if not _is_legacy_rng_device_conf(dev)]
def getDiskDevices(self):
return self._devices[hwclass.DISK]
--
To view, visit https://gerrit.ovirt.org/61243
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I34eef559ef3d789fd502490acc9691df15c684b9
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Francesco Romani <fromani(a)redhat.com>
7 years, 5 months
Change in vdsm[master]: [wip] infra tests: added functional test for upgrading vdsm
by igoihman@redhat.com
Irit Goihman has uploaded a new change for review.
Change subject: [wip] infra tests: added functional test for upgrading vdsm
......................................................................
[wip] infra tests: added functional test for upgrading vdsm
Change-Id: I589a73fa5285983f7d1adcdae49fc7bffb05bec4
Signed-off-by: Irit Goihman <igoihman(a)redhat.com>
---
M automation/check-merged.sh
A tests/functional/upgrade_vdsm_test.py
2 files changed, 52 insertions(+), 1 deletion(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/86/61186/1
diff --git a/automation/check-merged.sh b/automation/check-merged.sh
index 6869d49..b39ec99 100755
--- a/automation/check-merged.sh
+++ b/automation/check-merged.sh
@@ -4,7 +4,8 @@
EXPORTS="$PWD"/exported-artifacts
TEST_PATH="functional"
FUNCTIONAL_TESTS_LIST=" \
- $TEST_PATH/supervdsmFuncTests.py"
+ $TEST_PATH/supervdsmFuncTests.py \
+ $TEST_PATH/upgrade_vdsm_test.py"
DISABLE_TESTS_LIST=" \
$TEST_PATH/sosPluginTests.py \
diff --git a/tests/functional/upgrade_vdsm_test.py b/tests/functional/upgrade_vdsm_test.py
new file mode 100644
index 0000000..7da860a
--- /dev/null
+++ b/tests/functional/upgrade_vdsm_test.py
@@ -0,0 +1,50 @@
+import yum
+
+from vdsm.tool.service import service_start, service_status
+
+from testlib import VdsmTestCase
+from testValidation import ValidateRunningAsRoot
+
+_url = 'http://plain.resources.ovirt.org/pub/yum-repo/ovirt-release35.rpm'
+
+
+def _install(yb, package):
+ yb.install(name=package)
+ yb.processTransaction()
+
+
+def _remove(yb, package):
+ yb.remove(name=package)
+ yb.processTransaction()
+
+
+def _update(yb, package):
+ yb.update(name=package)
+ yb.processTransaction()
+
+
+def _installLocal(yb, pkg):
+ yb.installLocal(pkg=pkg)
+ yb.processTransaction()
+
+
+class UpgradeTest(VdsmTestCase):
+ def __init__(self):
+ self.yum_base = yum.YumBase()
+ self.yum_base.setCacheDir()
+
+ @ValidateRunningAsRoot
+ def setUp(self):
+ _remove(self.yum_base, 'vdsm')
+ self.yum_base.repos.disableRepo('ovirt-snapshot')
+ _installLocal(self.yum_base, _url)
+ _install(self.yum_base, 'vdsm')
+ service_start('vdsmd')
+
+ def tearDown(self):
+ service_start('vdsmd')
+
+ def upgrade_test(self):
+ self.yum_base.repos.enableRepo('ovirt-snapshot')
+ _update(self.yum_base, 'vdsm')
+ self.assertEqual(service_status('vdsmd'), 0)
--
To view, visit https://gerrit.ovirt.org/61186
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I589a73fa5285983f7d1adcdae49fc7bffb05bec4
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Irit Goihman <igoihman(a)redhat.com>
7 years, 5 months
Change in vdsm[master]: migration: coalesce join() into stop()
by fromani@redhat.com
Francesco Romani has uploaded a new change for review.
Change subject: migration: coalesce join() into stop()
......................................................................
migration: coalesce join() into stop()
we always call join() after stop(), so coalesce the two
method in stop().
Doing so, we can also get rid of most of the remnants of the thread
interface that pollutes DowntimeThread, MonitorThread and SourceThread.
Change-Id: Ib6def55d50a61ac983b45e826c05e09887fe5ee0
Signed-off-by: Francesco Romani <fromani(a)redhat.com>
---
M vdsm/virt/migration.py
1 file changed, 5 insertions(+), 22 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/87/62587/1
diff --git a/vdsm/virt/migration.py b/vdsm/virt/migration.py
index 28963bf..e66fab2 100644
--- a/vdsm/virt/migration.py
+++ b/vdsm/virt/migration.py
@@ -495,13 +495,10 @@
with utils.running(self._monitorThread):
self._perform_migration(duri, muri)
- self._monitorThread.join()
-
def _perform_with_conv_schedule(self, duri, muri):
self._vm.log.debug('performing migration with conv schedule')
with utils.running(self._monitorThread):
self._perform_migration(duri, muri)
- self._monitorThread.join()
def set_max_bandwidth(self, bandwidth):
self._vm.log.debug('setting migration max bandwidth to %d', bandwidth)
@@ -556,12 +553,6 @@
def start(self):
self._thread.start()
- def join(self):
- return self._thread.join()
-
- def is_alive(self):
- return self._thread.is_alive()
-
@utils.traceback()
def run(self):
self._vm.log.debug('migration downtime thread started (%i steps)',
@@ -583,6 +574,10 @@
def stop(self):
self._vm.log.debug('stopping migration downtime thread')
self._stop.set()
+ if self._thread.is_alive():
+ # on very short migrations, the downtime thread
+ # may not be started at all.
+ self._thread.join()
def _set_downtime(self, downtime):
self._vm.log.debug('setting migration downtime to %d', downtime)
@@ -598,12 +593,6 @@
def stop(self):
pass
-
- def join(self):
- pass
-
- def is_alive(self):
- return False
def set_initial_downtime(self):
pass
@@ -628,9 +617,6 @@
def start(self):
self._thread.start()
- def join(self):
- self._thread.join()
-
@property
def enabled(self):
return MonitorThread._MIGRATION_MONITOR_INTERVAL > 0
@@ -643,10 +629,6 @@
self.monitor_migration()
finally:
self.downtime_thread.stop()
- if self.downtime_thread.is_alive():
- # on very short migrations, the downtime thread
- # may not be started at all.
- self.downtime_thread.join()
self._vm.log.debug('stopped migration monitor thread')
else:
self._vm.log.info('migration monitor thread disabled'
@@ -735,6 +717,7 @@
def stop(self):
self._vm.log.debug('stopping migration monitor thread')
self._stop.set()
+ self._thread.join()
def _next_action(self, stalling):
head = self._conv_schedule['stalling'][0]
--
To view, visit https://gerrit.ovirt.org/62587
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib6def55d50a61ac983b45e826c05e09887fe5ee0
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Francesco Romani <fromani(a)redhat.com>
7 years, 5 months
Change in vdsm[master]: tests: bootstrap the livemerge tests
by fromani@redhat.com
Francesco Romani has uploaded a new change for review.
Change subject: tests: bootstrap the livemerge tests
......................................................................
tests: bootstrap the livemerge tests
Bootstrap the livemerge tests.
We start with a simple test for LiveMergeCleanupThread, used
to verify change I149315a1934a5650222212870c87a67f5a0185b9.
Change-Id: Ie1e3efd06a3d807d46e582ef1ba6548ab1c7e30f
Signed-off-by: Francesco Romani <fromani(a)redhat.com>
---
M tests/Makefile.am
A tests/livemerge_test.py
2 files changed, 90 insertions(+), 0 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/53/62253/1
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 467f2d4..4270f29 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -77,6 +77,7 @@
iscsiTests.py \
jobsTests.py \
libvirtconnectionTests.py \
+ livemerge_test.py \
logutils_test.py \
lvmTests.py \
miscTests.py \
diff --git a/tests/livemerge_test.py b/tests/livemerge_test.py
new file mode 100644
index 0000000..5ad2a41
--- /dev/null
+++ b/tests/livemerge_test.py
@@ -0,0 +1,89 @@
+#
+# Copyright 2016 Red Hat, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+#
+# Refer to the README and COPYING files for full details of the license
+#
+from __future__ import absolute_import
+
+import logging
+import threading
+import uuid
+
+from virt import vm
+from testlib import VdsmTestCase as TestCaseBase
+
+from monkeypatch import MonkeyPatch, MonkeyPatchScope
+
+
+class TestLiveMergeThread(TestCaseBase):
+
+ def setUp(self):
+ self.vm = FakeVm()
+ self.job = fake_job()
+ self.drive = FakeDrive()
+
+ def test_run(self):
+ t = vm.LiveMergeCleanupThread(self.vm, self.job, self.drive, False)
+ t.start()
+ self.vm.got_volume_info.wait()
+
+ self.assertTrue(t.isAlive())
+ self.assertFalse(t.isSuccessful())
+
+ self.vm.sync_done.set()
+
+ t.join()
+ self.assertTrue(t.isSuccessful())
+
+
+def fake_job(jobID=None):
+ return {
+ 'jobID': str(uuid.uuid4()) if jobID is None else jobID,
+ 'topVolume': str(uuid.uuid4()),
+ 'baseVolume': str(uuid.uuid4()),
+ }
+
+
+class FakeVm(object):
+
+ def __init__(self, vmid=None):
+ self.id = str(uuid.uuid4()) if vmid is None else vmid
+ self.sync_done = threading.Event()
+ self.got_volume_info = threading.Event()
+ self.log = logging.getLogger('test.livemerge.Vm')
+
+ def _getVolumeInfo(self, domainID, poolID, imageID, topVolUUID):
+ self.got_volume_info.set()
+ return {
+ 'capacity': 0,
+ }
+
+ def _setVolumeSize(self, domainID, poolID, imageID, baseVolUUID, capacity):
+ pass
+
+ def _syncVolumeChain(self, drive):
+ self.sync_done.wait()
+
+ def enableDriveMonitor(self):
+ pass
+
+
+class FakeDrive(object):
+ def __init__(self):
+ self.domainID = str(uuid.uuid4())
+ self.poolID = str(uuid.uuid4())
+ self.imageID = str(uuid.uuid4())
--
To view, visit https://gerrit.ovirt.org/62253
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie1e3efd06a3d807d46e582ef1ba6548ab1c7e30f
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Francesco Romani <fromani(a)redhat.com>
7 years, 5 months
Change in vdsm[master]: virt: enable libgfapi
by ahino@redhat.com
Ala Hino has uploaded a new change for review.
Change subject: virt: enable libgfapi
......................................................................
virt: enable libgfapi
This change is based on Federico's changes:
https://gerrit.ovirt.org/33768/
Change-Id: I54b81e87b959b0b49c0f06810f88410e7c75de1d
Signed-off-by: Federico Simoncelli <fsimonce(a)redhat.com>
Signed-off-by: Ala Hino <ahino(a)redhat.com>
---
M vdsm/storage/glusterVolume.py
M vdsm/storage/hsm.py
M vdsm/virt/vm.py
3 files changed, 22 insertions(+), 5 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/61/44061/1
diff --git a/vdsm/storage/glusterVolume.py b/vdsm/storage/glusterVolume.py
index 8f701ba..109d1c9 100644
--- a/vdsm/storage/glusterVolume.py
+++ b/vdsm/storage/glusterVolume.py
@@ -54,4 +54,5 @@
return {'volType': VmVolumeInfo.TYPE_NETWORK, 'path': glusterPath,
'protocol': 'gluster', 'volPort': volPort,
'volTransport': volTrans,
- 'volfileServer': volfileServer}
+ 'volfileServer': volfileServer,
+ 'bricks': volInfo[volname]['bricks']}
diff --git a/vdsm/storage/hsm.py b/vdsm/storage/hsm.py
index f68d3bb..109cdfa 100644
--- a/vdsm/storage/hsm.py
+++ b/vdsm/storage/hsm.py
@@ -3209,8 +3209,7 @@
path = os.path.join(dom.domaindir, sd.DOMAIN_IMAGES, imgUUID,
volUUID)
volInfo = {'domainID': sdUUID, 'imageID': imgUUID,
- 'volumeID': volUUID, 'path': path,
- 'volType': "path"}
+ 'volumeID': volUUID, 'path': path}
leasePath, leaseOffset = dom.getVolumeLease(imgUUID, volUUID)
@@ -3221,8 +3220,8 @@
})
imgVolumesInfo.append(volInfo)
- if volUUID == leafUUID:
- leafInfo = volInfo
+
+ leafInfo = dom.produceVolume(imgUUID, leafUUID).getVmVolumeInfo()
return {'path': leafPath, 'info': leafInfo,
'imgVolumesInfo': imgVolumesInfo}
diff --git a/vdsm/virt/vm.py b/vdsm/virt/vm.py
index 71a74b3..2976f3b 100644
--- a/vdsm/virt/vm.py
+++ b/vdsm/virt/vm.py
@@ -805,6 +805,23 @@
# A destroy request has been issued, exit early
break
drive['path'] = self.cif.prepareVolumePath(drive, self.id)
+ if drive.get('diskType') == DISK_TYPE.NETWORK:
+ volinfo = drive.get('volumeInfo')
+ drive['path'] = volinfo['path']
+ drive['protocol'] = volinfo['protocol']
+ if drive.get('hosts') is None:
+ """
+ THIS CODE COMMENTED OUT DUE TO A BUG IN LIBVIRT,
+ CANNOT WORK WITH MULTIPLE HOSTS
+ """
+ """
+ hosts = [dict(name=brick.split(":")[0],
+ port='0', transport='tcp')
+ for brick in volinfo['bricks']]
+ """
+ hosts = [dict(name=volinfo['bricks'][0].split(":")[0],
+ port='0', transport='tcp')]
+ drive['hosts'] = hosts
else:
# Now we got all the resources we needed
--
To view, visit https://gerrit.ovirt.org/44061
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I54b81e87b959b0b49c0f06810f88410e7c75de1d
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Ala Hino <ahino(a)redhat.com>
7 years, 6 months
Change in vdsm[master]: after_vm_start: changed vdscli to jsonrpcvdsli
by igoihman@redhat.com
Irit Goihman has uploaded a new change for review.
Change subject: after_vm_start: changed vdscli to jsonrpcvdsli
......................................................................
after_vm_start: changed vdscli to jsonrpcvdsli
vdscli is deprecated and was replaced by jsonrpcvdsli
Change-Id: I66bd62164594c83167e8e72081325ff60d1c0cb0
Signed-off-by: Irit Goihman <igoihman(a)redhat.com>
---
M vdsm_hooks/openstacknet/after_vm_start.py
1 file changed, 11 insertions(+), 2 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/13/62713/1
diff --git a/vdsm_hooks/openstacknet/after_vm_start.py b/vdsm_hooks/openstacknet/after_vm_start.py
index 6f5c1e5..aa9b509 100644
--- a/vdsm_hooks/openstacknet/after_vm_start.py
+++ b/vdsm_hooks/openstacknet/after_vm_start.py
@@ -10,6 +10,7 @@
Where:
VM_ID should be replaced with the vm id.'''
+from contextlib import closing
import libvirt
import os
import time
@@ -17,16 +18,24 @@
import hooking
from openstacknet_utils import MARK_FOR_UNPAUSE_PATH
from openstacknet_utils import VM_ID_KEY
-from vdsm import vdscli
+from vdsm import config
+from vdsm import jsonrpcvdscli
OPENSTACK_NIC_WAIT_TIME = 15
+def connect_to_vdsm():
+ request_queues = config.get("addresses", "request_queues")
+ request_queue = request_queues.split(",")[0]
+ return jsonrpcvdscli.connect(requestQueue=request_queue)
+
+
def resume_paused_vm(vm_id):
unpause_file = MARK_FOR_UNPAUSE_PATH % vm_id
if os.path.isfile(unpause_file):
- vdscli.connect().cont(vm_id)
+ with closing(connect_to_vdsm()) as server:
+ server.cont(vm_id)
os.remove(unpause_file)
--
To view, visit https://gerrit.ovirt.org/62713
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I66bd62164594c83167e8e72081325ff60d1c0cb0
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Irit Goihman <igoihman(a)redhat.com>
7 years, 6 months
Change in vdsm[master]: **WIP** tool: reconfigure containers networks
by fromani@redhat.com
Francesco Romani has uploaded a new change for review.
Change subject: **WIP** tool: reconfigure containers networks
......................................................................
**WIP** tool: reconfigure containers networks
TODO: properly integrate into vdsm-tool
Added as PoC/placeholder
Change-Id: I6053e283c004cd61ba7727cea22ba73a631180ba
Signed-off-by: Francesco Romani <fromani(a)redhat.com>
---
A contrib/cont-setup-net
1 file changed, 53 insertions(+), 0 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/18/60918/1
diff --git a/contrib/cont-setup-net b/contrib/cont-setup-net
new file mode 100755
index 0000000..7bc7c07
--- /dev/null
+++ b/contrib/cont-setup-net
@@ -0,0 +1,53 @@
+#!/usr/bin/env python
+
+# TODO: integrate into vdsm-tool
+
+import argparse
+import logging
+import sys
+
+from vdsm.virt.containers import config
+from vdsm.virt.containers import runtime
+
+
+_DEFAULT_OVIRT_NET = 'ovirtmgmt'
+_DEFAULT_SUBNET = '10.1.0.0'
+_DEFAULT_MASK = 24
+
+
+def _main():
+ parser = argparse.ArgumentParser()
+ parser.add_argument('--name', type=str, nargs='?',
+ default=_DEFAULT_OVIRT_NET,
+ help='network name to use')
+ parser.add_argument('--bridge', type=str, nargs='?',
+ default=_DEFAULT_OVIRT_NET,
+ help='bridge to use')
+ parser.add_argument('--subnet', type=str, nargs='?',
+ default=_DEFAULT_SUBNET,
+ help='subnet to use')
+ parser.add_argument('--mask', type=int, nargs='?',
+ default=_DEFAULT_MASK,
+ help='netmask to use')
+ args = parser.parse_args()
+
+ runtimes = convirt.runtime.supported()
+ if not runtimes:
+ logging.warning('no runtimes detected, nothing to do')
+ return
+
+ logging.info('configuring runtimes: %s', runtimes)
+
+ config.network.update(
+ name=args.name,
+ bridge=args.bridge,
+ subnet=args.subnet,
+ mask=args.mask,
+ )
+
+ runtime.configure()
+
+
+if __name__ == "__main__":
+ logging.basicConfig(level=logging.DEBUG)
+ _main()
--
To view, visit https://gerrit.ovirt.org/60918
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I6053e283c004cd61ba7727cea22ba73a631180ba
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Francesco Romani <fromani(a)redhat.com>
7 years, 6 months