Change in vdsm[master]: devices: add is_hostdevice attribute
by Martin Polednik
Martin Polednik has uploaded a new change for review.
Change subject: devices: add is_hostdevice attribute
......................................................................
devices: add is_hostdevice attribute
is_hostdevice attribute is currently used to determine whether given
device is so called host device, or in other words if it refers to
physical device.
At the moment, only devices HOSTDEV and NETWORK may be host devices,
but moving the attribute to interface level allows us to greatly
simplify host NUMA scheduling.
Change-Id: Icd5c42b371d9bf0eafd99e8ad880f3f97b444e75
Signed-off-by: Martin Polednik <mpolednik(a)redhat.com>
---
M vdsm/virt/vmdevices/core.py
1 file changed, 3 insertions(+), 1 deletion(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/63/62063/1
diff --git a/vdsm/virt/vmdevices/core.py b/vdsm/virt/vmdevices/core.py
index 1508b9d..90b8cd8 100644
--- a/vdsm/virt/vmdevices/core.py
+++ b/vdsm/virt/vmdevices/core.py
@@ -36,7 +36,8 @@
class Base(vmxml.Device):
__slots__ = ('deviceType', 'device', 'alias', 'specParams', 'deviceId',
- 'conf', 'log', '_deviceXML', 'type', 'custom')
+ 'conf', 'log', '_deviceXML', 'type', 'custom',
+ 'is_hostdevice')
def __init__(self, conf, log, **kwargs):
self.conf = conf
@@ -50,6 +51,7 @@
self.log.debug('Ignoring param (%s, %s) in %s', attr, value,
self.__class__.__name__)
self._deviceXML = None
+ self.is_hostdevice = False
def __str__(self):
attrs = [':'.join((a, str(getattr(self, a, None)))) for a in dir(self)
--
To view, visit https://gerrit.ovirt.org/62063
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Icd5c42b371d9bf0eafd99e8ad880f3f97b444e75
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Martin Polednik <mpolednik(a)redhat.com>
7 years, 7 months
Change in vdsm[master]: core: Introduce new Volume.getWatermarks verb
by ahino@redhat.com
Ala Hino has uploaded a new change for review.
Change subject: core: Introduce new Volume.getWatermarks verb
......................................................................
core: Introduce new Volume.getWatermarks verb
This verb returns the volume watermarks and will be used in two cases:
1. Before merge in order to extend the base volume size to minimal
required size
2. After merge in order to reduce volume size to optimal
Change-Id: I9f1feeb1540b2cb887b431b8075c26da09b62ea8
Signed-off-by: Ala Hino <ahino(a)redhat.com>
---
M lib/api/vdsm-api.yml
M vdsm/API.py
M vdsm/storage/hsm.py
3 files changed, 32 insertions(+), 0 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/51/64451/1
diff --git a/lib/api/vdsm-api.yml b/lib/api/vdsm-api.yml
index 0ef9f22..c27b6fa 100644
--- a/lib/api/vdsm-api.yml
+++ b/lib/api/vdsm-api.yml
@@ -9675,6 +9675,29 @@
description: A task UUID
type: *UUID
+Volume.getWatermarks:
+ added: '4.1'
+ description: Returns the volume watermarks.
+ params:
+ - description: The Storage Pool associated with the Volume
+ name: storagepoolID
+ type: *UUID
+
+ - description: The Storage Domain associated with the Volume
+ name: storagedomainID
+ type: *UUID
+
+ - description: The Image associated with the Volume
+ name: imageID
+ type: *UUID
+
+ - description: The UUID of the Volume
+ name: volumeID
+ type: *UUID
+ return:
+ description: The volume size info
+ type: *VolumeSizeInfo
+
Volume.getInfo:
added: '3.1'
description: Get information about a Volume.
diff --git a/vdsm/API.py b/vdsm/API.py
index 7922c76..e46a3fc 100644
--- a/vdsm/API.py
+++ b/vdsm/API.py
@@ -871,6 +871,10 @@
return self._irs.reduceVolumeSize(
self._spUUID, self._sdUUID, self._imgUUID, self._UUID, newSize)
+ def getWatermarks(self):
+ return self._irs.getVolumeWatermarks(
+ self._spUUID, self._sdUUID, self._imgUUID, self._UUID)
+
def updateSize(self, newSize):
return self._irs.updateVolumeSize(
self._spUUID, self._sdUUID, self._imgUUID, self._UUID, newSize)
diff --git a/vdsm/storage/hsm.py b/vdsm/storage/hsm.py
index 881165f..67bea22 100644
--- a/vdsm/storage/hsm.py
+++ b/vdsm/storage/hsm.py
@@ -667,6 +667,11 @@
raise NotImplementedError
@public
+ def getVolumeWatermarks(self, spUUID, sdUUID, imgUUID, volUUID,
+ options=None):
+ raise NotImplementedError
+
+ @public
def updateVolumeSize(self, spUUID, sdUUID, imgUUID, volUUID, newSize):
"""
Update the volume size with the given newSize (in bytes).
--
To view, visit https://gerrit.ovirt.org/64451
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I9f1feeb1540b2cb887b431b8075c26da09b62ea8
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Ala Hino <ahino(a)redhat.com>
7 years, 7 months
Change in vdsm[master]: core: Introduce new Volume.reduceSize verb
by ahino@redhat.com
Ala Hino has uploaded a new change for review.
Change subject: core: Introduce new Volume.reduceSize verb
......................................................................
core: Introduce new Volume.reduceSize verb
This new verb will be used after merge to reduce volume size to optimal.
Change-Id: If4e1fadda1aa34274e568bcaae7ba1f8b350a48f
Signed-off-by: Ala Hino <ahino(a)redhat.com>
---
M lib/api/vdsm-api.yml
M vdsm/API.py
M vdsm/storage/hsm.py
3 files changed, 35 insertions(+), 0 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/50/64450/1
diff --git a/lib/api/vdsm-api.yml b/lib/api/vdsm-api.yml
index 0745093..0ef9f22 100644
--- a/lib/api/vdsm-api.yml
+++ b/lib/api/vdsm-api.yml
@@ -9648,6 +9648,33 @@
description: A task UUID
type: *UUID
+Volume.reduceSize:
+ added: '4.1'
+ description: Reduces the virtual size of a volume.
+ params:
+ - description: The Storage Pool associated with the Volume
+ name: storagepoolID
+ type: *UUID
+
+ - description: The Storage Domain associated with the Volume
+ name: storagedomainID
+ type: *UUID
+
+ - description: The Image associated with the Volume
+ name: imageID
+ type: *UUID
+
+ - description: The UUID of the Volume
+ name: volumeID
+ type: *UUID
+
+ - description: The new desired size (in bytes)
+ name: newSize
+ type: string
+ return:
+ description: A task UUID
+ type: *UUID
+
Volume.getInfo:
added: '3.1'
description: Get information about a Volume.
diff --git a/vdsm/API.py b/vdsm/API.py
index 267aad7..7922c76 100644
--- a/vdsm/API.py
+++ b/vdsm/API.py
@@ -867,6 +867,10 @@
return self._irs.extendVolumeSize(
self._spUUID, self._sdUUID, self._imgUUID, self._UUID, newSize)
+ def reduceSize(self, newSize):
+ return self._irs.reduceVolumeSize(
+ self._spUUID, self._sdUUID, self._imgUUID, self._UUID, newSize)
+
def updateSize(self, newSize):
return self._irs.updateVolumeSize(
self._spUUID, self._sdUUID, self._imgUUID, self._UUID, newSize)
diff --git a/vdsm/storage/hsm.py b/vdsm/storage/hsm.py
index faf3dfb..881165f 100644
--- a/vdsm/storage/hsm.py
+++ b/vdsm/storage/hsm.py
@@ -663,6 +663,10 @@
imgUUID, volUUID, newSizeSectors)
@public
+ def reduceVolumeSize(self, spUUID, sdUUID, imgUUID, volUUID, newSize):
+ raise NotImplementedError
+
+ @public
def updateVolumeSize(self, spUUID, sdUUID, imgUUID, volUUID, newSize):
"""
Update the volume size with the given newSize (in bytes).
--
To view, visit https://gerrit.ovirt.org/64450
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: If4e1fadda1aa34274e568bcaae7ba1f8b350a48f
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Ala Hino <ahino(a)redhat.com>
7 years, 7 months
Change in vdsm[master]: sdm: Introduce new SDM.merge verb
by ahino@redhat.com
Ala Hino has uploaded a new change for review.
Change subject: sdm: Introduce new SDM.merge verb
......................................................................
sdm: Introduce new SDM.merge verb
This API is another data operation separate from SPM. It merges data
from top volume to base volume and it replaces the existing
'mergeSnapshots' verb.
This verb will be used in the new cold merge flow:
1. Extend base volume (runs on the SPM)
2. Merge (runs on any host)
3. Shrink base volume to optimal size (runs on the SPM)
Change-Id: I96d57a5b9f21153ce1de2cd5619c7f9f78bbe75b
Signed-off-by: Ala Hino <ahino(a)redhat.com>
---
M lib/api/vdsm-api.yml
M vdsm/API.py
M vdsm/storage/hsm.py
3 files changed, 23 insertions(+), 0 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/96/64196/1
diff --git a/lib/api/vdsm-api.yml b/lib/api/vdsm-api.yml
index c7ab7f5..0745093 100644
--- a/lib/api/vdsm-api.yml
+++ b/lib/api/vdsm-api.yml
@@ -9905,3 +9905,19 @@
- description: The destination endpoint
name: destination
type: *CopyDataEndpoint
+
+SDM.merge:
+ added: '4.1'
+ description: Merge data from top volume to base volume.
+ params:
+ - description: A UUID to be used for tracking the job progress
+ name: job_id
+ type: *UUID
+
+ - description: The base volume
+ name: base
+ type: *CopyDataDivEndpoint
+
+ - description: The top volume
+ name: top
+ type: *CopyDataDivEndpoint
diff --git a/vdsm/API.py b/vdsm/API.py
index f000297..267aad7 100644
--- a/vdsm/API.py
+++ b/vdsm/API.py
@@ -1636,3 +1636,6 @@
def copy_data(self, job_id, source, destination):
return self._irs.sdm_copy_data(job_id, source, destination)
+
+ def merge(self, job_id, base, top):
+ return self._irs.sdm_merge(job_id, base, top)
diff --git a/vdsm/storage/hsm.py b/vdsm/storage/hsm.py
index d1b50d2..faf3dfb 100644
--- a/vdsm/storage/hsm.py
+++ b/vdsm/storage/hsm.py
@@ -3530,3 +3530,7 @@
job = sdm.api.copy_data.Job(job_id, self._get_hostid(),
source, destination)
self.sdm_schedule(job)
+
+ @public
+ def sdm_merge(self, job_id, base, top):
+ raise NotImplementedError
--
To view, visit https://gerrit.ovirt.org/64196
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I96d57a5b9f21153ce1de2cd5619c7f9f78bbe75b
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Ala Hino <ahino(a)redhat.com>
7 years, 7 months
Change in vdsm[master]: virt: Make boolean values from boolean migration options
by mzamazal@redhat.com
Milan Zamazal has uploaded a new change for review.
Change subject: virt: Make boolean values from boolean migration options
......................................................................
virt: Make boolean values from boolean migration options
`compressed' and `autoConverge' migration options have boolean values in
the string form. They must be converted to actual booleans before they
are checked.
Change-Id: I642eb607785a1b6f877092e187c91b7a065b38e1
Bug-Url: https://bugzilla.redhat.com/1380822
Backport-To: 4.0
Signed-off-by: Milan Zamazal <mzamazal(a)redhat.com>
---
M vdsm/virt/migration.py
1 file changed, 2 insertions(+), 2 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/07/65007/1
diff --git a/vdsm/virt/migration.py b/vdsm/virt/migration.py
index bed481e..3f51c89 100644
--- a/vdsm/virt/migration.py
+++ b/vdsm/virt/migration.py
@@ -111,8 +111,8 @@
kwargs.get('maxBandwidth') or
config.getint('vars', 'migration_max_bandwidth')
)
- self._autoConverge = autoConverge
- self._compressed = compressed
+ self._autoConverge = utils.tobool(autoConverge)
+ self._compressed = utils.tobool(compressed)
self._incomingLimit = kwargs.get('incomingLimit')
self._outgoingLimit = kwargs.get('outgoingLimit')
self.status = {
--
To view, visit https://gerrit.ovirt.org/65007
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I642eb607785a1b6f877092e187c91b7a065b38e1
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Milan Zamazal <mzamazal(a)redhat.com>
7 years, 7 months
Change in vdsm[master]: acceptor: stop to double close acceptor
by Piotr Kliczewski
Piotr Kliczewski has uploaded a new change for review.
Change subject: acceptor: stop to double close acceptor
......................................................................
acceptor: stop to double close acceptor
When reactor is stopped it closes all dispatchers so there is no need to
close acceptor one more time.
Change-Id: I9a14cfa84c34241dbb511c0348109073b6865087
Signed-off-by: Piotr Kliczewski <piotr.kliczewski(a)gmail.com>
---
M lib/vdsm/protocoldetector.py
1 file changed, 0 insertions(+), 1 deletion(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/85/63685/1
diff --git a/lib/vdsm/protocoldetector.py b/lib/vdsm/protocoldetector.py
index 196a2ab..40f3c0d 100644
--- a/lib/vdsm/protocoldetector.py
+++ b/lib/vdsm/protocoldetector.py
@@ -208,7 +208,6 @@
def stop(self):
self.log.debug("Stopping Acceptor")
self._reactor.stop()
- self._acceptor.close()
class _CannotDetectProtocol(Exception):
--
To view, visit https://gerrit.ovirt.org/63685
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I9a14cfa84c34241dbb511c0348109073b6865087
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Piotr Kliczewski <piotr.kliczewski(a)gmail.com>
7 years, 7 months
Change in vdsm[master]: Correct API schema to align with runtime schema
by akrejcir@redhat.com
Andrej Krejcir has uploaded a new change for review.
Change subject: Correct API schema to align with runtime schema
......................................................................
Correct API schema to align with runtime schema
Change-Id: Ia1b5e90831fd0e4d9e897baaae4afb68f22e3877
Bug-Url: https://bugzilla.redhat.com/1348255
Signed-off-by: Andrej Krejcir <akrejcir(a)redhat.com>
---
M lib/api/vdsm-api.yml
M lib/vdsm/jsonrpcvdscli.py
M lib/vdsm/rpc/Bridge.py
3 files changed, 33 insertions(+), 37 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/77/64477/1
diff --git a/lib/api/vdsm-api.yml b/lib/api/vdsm-api.yml
index c7ab7f5..1f1d569 100644
--- a/lib/api/vdsm-api.yml
+++ b/lib/api/vdsm-api.yml
@@ -2120,35 +2120,35 @@
description: I/O tune parameters for the VM disk device.
name: VmDiskDeviceIoTuneParams
properties:
- - defaultvalue: needs updating
- description: Write throughput limit in bytes per
- second.
- name: write_bytes_sec
- type: uint
-
- - defaultvalue: needs updating
- description: Read I/O operations limit per second.
- name: read_iops_sec
- type: uint
-
- - defaultvalue: needs updating
- description: Read throughput limit in bytes per
- second.
- name: read_bytes_sec
- type: uint
-
- - defaultvalue: needs updating
+ - defaultvalue: 0 - means unlimited
description: Total throughput limit in bytes per
second.
name: total_bytes_sec
type: uint
- - defaultvalue: needs updating
+ - defaultvalue: 0 - means unlimited
+ description: Read throughput limit in bytes per
+ second.
+ name: read_bytes_sec
+ type: uint
+
+ - defaultvalue: 0 - means unlimited
+ description: Write throughput limit in bytes per
+ second.
+ name: write_bytes_sec
+ type: uint
+
+ - defaultvalue: 0 - means unlimited
description: Total I/O operations limit per second.
name: total_iops_sec
type: uint
- - defaultvalue: needs updating
+ - defaultvalue: 0 - means unlimited
+ description: Read I/O operations limit per second.
+ name: read_iops_sec
+ type: uint
+
+ - defaultvalue: 0 - means unlimited
description: Write I/O operations limit per second.
name: write_iops_sec
type: uint
@@ -2577,20 +2577,6 @@
type: *VmDeviceAddress
type: object
- HotplugMemoryParams: &HotplugMemoryParams
- added: '3.6'
- description: Parameters for VM.hotplugMemory.
- name: HotplugMemoryParams
- properties:
- - description: The UUID of the VM to modify
- name: vmId
- type: *UUID
-
- - description: The memory device specification
- name: memory
- type: *VmMemoryDevice
- type: object
-
VmInterfaceDeviceSpecParams: &VmInterfaceDeviceSpecParams
added: '3.1'
description: Additional VM interface device parameters.
@@ -2841,6 +2827,10 @@
- description: The amount of pages to scan during one cycle.
name: pages_to_scan
+ type: int
+
+ - description:
+ name: merge_across_nodes
type: int
type: object
@@ -9771,9 +9761,10 @@
name: vmID
type: *UUID
- - description: The VM UUID and memory device information
- name: params
- type: *HotplugMemoryParams
+ - description: The memory device specification
+ name: memory
+ type: *VmMemoryDevice
+
return:
description: The VM definition, as updated
type: *VmDefinition
diff --git a/lib/vdsm/jsonrpcvdscli.py b/lib/vdsm/jsonrpcvdscli.py
index e276f86..c228e77 100644
--- a/lib/vdsm/jsonrpcvdscli.py
+++ b/lib/vdsm/jsonrpcvdscli.py
@@ -89,6 +89,7 @@
'hotplugNic': 'VM.hotplugNic',
'hotunplugDisk': 'VM.hotunplugDisk',
'hotunplugNic': 'VM.hotunplugNic',
+ 'hotplugMemory': 'VM.hotplugMemory',
'list': 'Host.getVMList',
'migrate': 'VM.migrate',
'migrateStatus': 'VM.getMigrationStatus',
@@ -99,7 +100,9 @@
'setBalloonTarget': 'VM.setBalloonTarget',
'setCpuTunePeriod': 'VM.setCpuTunePeriod',
'setCpuTuneQuota': 'VM.setCpuTuneQuota',
+ 'setNumberOfCpus': 'VM.setNumberOfCpus',
'setKsmTune': 'Host.setKsmTune',
+ 'setHaMaintenanceMode': 'Host.setHaMaintenanceMode',
'setMOMPolicy': 'Host.setMOMPolicy',
'setSafeNetworkConfig': 'Host.setSafeNetworkConfig',
'setupNetworks': 'Host.setupNetworks',
diff --git a/lib/vdsm/rpc/Bridge.py b/lib/vdsm/rpc/Bridge.py
index 5dedcc0..ceed1f9 100644
--- a/lib/vdsm/rpc/Bridge.py
+++ b/lib/vdsm/rpc/Bridge.py
@@ -356,6 +356,7 @@
'Host_getAllVmStats': {'ret': 'statsList'},
'Host_setupNetworks': {'ret': 'status'},
'Host_setKsmTune': {'ret': 'status'},
+ 'Host_setHaMaintenanceMode': {'ret': 'status'},
'Image_cloneStructure': {'ret': 'uuid'},
'Image_delete': {'ret': 'uuid'},
'Image_deleteVolumes': {'ret': 'uuid'},
@@ -415,6 +416,7 @@
'VM_setIoTune': {'ret': 'status'},
'VM_setBalloonTarget': {'ret': 'status'},
'VM_updateDevice': {'ret': 'vmList'},
+ 'VM_updateVmPolicy': {'ret': 'status'},
'Volume_copy': {'ret': 'uuid'},
'Volume_create': {'ret': 'uuid'},
'Volume_delete': {'ret': 'uuid'},
--
To view, visit https://gerrit.ovirt.org/64477
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia1b5e90831fd0e4d9e897baaae4afb68f22e3877
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Andrej Krejcir <akrejcir(a)redhat.com>
7 years, 7 months
Change in vdsm[master]: draft: migration plugin proposal - draft 102
by mmirecki@redhat.com
Marcin Mirecki has uploaded a new change for review.
Change subject: draft: migration plugin proposal - draft 102
......................................................................
draft: migration plugin proposal - draft 102
Just a draft to show the idea, not verified
Change-Id: Ia0fb056c4b4732505d567385546e78048c37d140
Signed-off-by: mirecki <mmirecki(a)redhat.com>
---
M vdsm/virt/vm_migrate_hook.py
A vdsm/virt/vm_migrate_plugins/__init__.py
A vdsm/virt/vm_migrate_plugins/external_network_plugin.py
A vdsm/virt/vm_migrate_plugins/openstack_network_plugin.py
A vdsm/virt/vm_migrate_plugins/vm_fex_plugin.py
5 files changed, 161 insertions(+), 11 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/86/64186/1
diff --git a/vdsm/virt/vm_migrate_hook.py b/vdsm/virt/vm_migrate_hook.py
index 633e4f0..dd276f5 100755
--- a/vdsm/virt/vm_migrate_hook.py
+++ b/vdsm/virt/vm_migrate_hook.py
@@ -28,6 +28,8 @@
from vdsm.config import config
from vdsm.network import api as net_api
+import vm_migrate_plugins
+
_DEBUG_MODE = False
LOG_FILE = '/tmp/libvirthook_ovs_migrate.log'
@@ -82,24 +84,28 @@
def _set_bridge_interfaces(devices, target_vm_conf):
- target_vm_nets_by_vnic_mac = {dev['macAddr']: dev['network']
- for dev in target_vm_conf['devices']
- if dev.get('type') == 'interface'}
+ target_vm_conf_by_mac = {dev['macAddr']: dev
+ for dev in target_vm_conf['devices']
+ if dev.get('type') == 'interface'}
+
for interface in devices.findall('interface'):
if interface.get('type') == 'bridge':
- _bind_iface_to_bridge(interface, target_vm_nets_by_vnic_mac)
+ _bind_iface_to_bridge(interface, target_vm_conf_by_mac)
-def _bind_iface_to_bridge(interface, target_vm_nets_by_vnic_mac):
+def _bind_iface_to_bridge(interface, target_vm_conf_by_mac):
elem_macaddr = interface.find('mac')
mac_addr = elem_macaddr.get('address')
- target_vm_net = target_vm_nets_by_vnic_mac[mac_addr]
- target_ovs_bridge = net_api.ovs_bridge(target_vm_net)
- if target_ovs_bridge:
- _bind_iface_to_ovs_bridge(interface, target_ovs_bridge, target_vm_net)
- else:
- _bind_iface_to_linux_bridge(interface, target_vm_net)
+ interface_conf = target_vm_conf_by_mac[mac_addr]
+ target_vm_net = interface_conf['network']
+ if not vm_migrate_plugins.skip_processing(interface, interface_conf):
+ target_ovs_bridge = net_api.ovs_bridge(target_vm_net)
+ if target_ovs_bridge:
+ _bind_iface_to_ovs_bridge(interface, target_ovs_bridge,
+ target_vm_net)
+ else:
+ _bind_iface_to_linux_bridge(interface, target_vm_net)
def _bind_iface_to_ovs_bridge(interface, target_ovs_bridge, target_vm_net):
diff --git a/vdsm/virt/vm_migrate_plugins/__init__.py b/vdsm/virt/vm_migrate_plugins/__init__.py
new file mode 100644
index 0000000..6c81eee
--- /dev/null
+++ b/vdsm/virt/vm_migrate_plugins/__init__.py
@@ -0,0 +1,43 @@
+# 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
+#
+
+import abc
+from importlib import import_module
+from pkgutil import iter_modules
+
+import six
+
+
+_DRIVERS = []
+
+
+def skip_processing(domxml, device_conf):
+ for driver in _DRIVERS:
+ driver.create().skip_processing(domxml, device_conf)
+
+
+class VmMigratePlugin():
+
+ @abc.abstractmethod
+ def skip_processing(self, domxml, device_conf):
+ return False
+
+
+for _, module, _ in iter_modules([__path__[0]]):
+ _DRIVERS.append(import_module('{}.{}'.format(__name__, module)))
diff --git a/vdsm/virt/vm_migrate_plugins/external_network_plugin.py b/vdsm/virt/vm_migrate_plugins/external_network_plugin.py
new file mode 100644
index 0000000..6beb0b2
--- /dev/null
+++ b/vdsm/virt/vm_migrate_plugins/external_network_plugin.py
@@ -0,0 +1,35 @@
+#!/usr/bin/env python
+# 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 . import VmMigratePlugin
+
+
+class ExternalNetworkPlugin(VmMigratePlugin):
+
+ EXTERNAL_NETWORK = 'EXTERNAL_NETWORK'
+
+ def skip_processing(self, domxml, conf):
+ custom = conf.get('custom')
+ return custom.get('provider_type') == self.EXTERNAL_NETWORK \
+ if custom else False
+
+
+def create():
+ return ExternalNetworkPlugin()
diff --git a/vdsm/virt/vm_migrate_plugins/openstack_network_plugin.py b/vdsm/virt/vm_migrate_plugins/openstack_network_plugin.py
new file mode 100644
index 0000000..50bd3d2
--- /dev/null
+++ b/vdsm/virt/vm_migrate_plugins/openstack_network_plugin.py
@@ -0,0 +1,35 @@
+#!/usr/bin/env python
+# 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 . import VmMigratePlugin
+
+
+class OpenstackNetworkPlugin(VmMigratePlugin):
+
+ OPENSTACK_NETWORK = 'OPENSTACK_NETWORK'
+
+ def skip_processing(self, domxml, conf):
+ custom = conf.get('custom')
+ return custom.get('provider_type') == self.OPENSTACK_NETWORK \
+ if custom else False
+
+
+def create():
+ return OpenstackNetworkPlugin()
diff --git a/vdsm/virt/vm_migrate_plugins/vm_fex_plugin.py b/vdsm/virt/vm_migrate_plugins/vm_fex_plugin.py
new file mode 100644
index 0000000..3661290
--- /dev/null
+++ b/vdsm/virt/vm_migrate_plugins/vm_fex_plugin.py
@@ -0,0 +1,31 @@
+#!/usr/bin/env python
+# 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 . import VmMigratePlugin
+
+
+class VmFexPlugin(VmMigratePlugin):
+
+ def skip_processing(self, domxml, conf):
+ return conf.get('vmfex') is not None
+
+
+def create():
+ return VmFexPlugin()
--
To view, visit https://gerrit.ovirt.org/64186
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia0fb056c4b4732505d567385546e78048c37d140
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Marcin Mirecki <mmirecki(a)redhat.com>
7 years, 7 months
Change in vdsm[master]: draft: vm_migration_libvirt_hook_plugins
by mmirecki@redhat.com
Marcin Mirecki has uploaded a new change for review.
Change subject: draft: vm_migration_libvirt_hook_plugins
......................................................................
draft: vm_migration_libvirt_hook_plugins
Quick draft for vm migration libvirt hook plugins
Change-Id: I7e13a94fa28968e37cd2d4d99fe540c8b762f7cc
Signed-off-by: mirecki <mmirecki(a)redhat.com>
---
M vdsm/virt/vm_migrate_hook.py
A vdsm/virt/vm_migrate_plugins/__init__.py
2 files changed, 72 insertions(+), 11 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/01/64001/1
diff --git a/vdsm/virt/vm_migrate_hook.py b/vdsm/virt/vm_migrate_hook.py
index 633e4f0..063fdd0 100755
--- a/vdsm/virt/vm_migrate_hook.py
+++ b/vdsm/virt/vm_migrate_hook.py
@@ -28,6 +28,8 @@
from vdsm.config import config
from vdsm.network import api as net_api
+import vm_migrate_plugins
+
_DEBUG_MODE = False
LOG_FILE = '/tmp/libvirthook_ovs_migrate.log'
@@ -82,24 +84,29 @@
def _set_bridge_interfaces(devices, target_vm_conf):
- target_vm_nets_by_vnic_mac = {dev['macAddr']: dev['network']
- for dev in target_vm_conf['devices']
- if dev.get('type') == 'interface'}
+ target_vm_conf_by_mac = {dev['macAddr']: dev
+ for dev in target_vm_conf['devices']
+ if dev.get('type') == 'interface'}
+
for interface in devices.findall('interface'):
if interface.get('type') == 'bridge':
- _bind_iface_to_bridge(interface, target_vm_nets_by_vnic_mac)
+ _bind_iface_to_bridge(interface, target_vm_conf_by_mac)
-def _bind_iface_to_bridge(interface, target_vm_nets_by_vnic_mac):
+def _bind_iface_to_bridge(interface, target_vm_conf_by_mac):
elem_macaddr = interface.find('mac')
mac_addr = elem_macaddr.get('address')
- target_vm_net = target_vm_nets_by_vnic_mac[mac_addr]
- target_ovs_bridge = net_api.ovs_bridge(target_vm_net)
- if target_ovs_bridge:
- _bind_iface_to_ovs_bridge(interface, target_ovs_bridge, target_vm_net)
- else:
- _bind_iface_to_linux_bridge(interface, target_vm_net)
+ interface_conf = target_vm_conf_by_mac[mac_addr]
+ target_vm_net = interface_conf['network']
+ if vm_migrate_plugins.do_default_processing(interface, interface_conf):
+ target_ovs_bridge = net_api.ovs_bridge(target_vm_net)
+ if target_ovs_bridge:
+ _bind_iface_to_ovs_bridge(interface, target_ovs_bridge,
+ target_vm_net)
+ else:
+ _bind_iface_to_linux_bridge(interface, target_vm_net)
+ vm_migrate_plugins.process(interface, interface_conf)
def _bind_iface_to_ovs_bridge(interface, target_ovs_bridge, target_vm_net):
diff --git a/vdsm/virt/vm_migrate_plugins/__init__.py b/vdsm/virt/vm_migrate_plugins/__init__.py
new file mode 100644
index 0000000..3e4b090
--- /dev/null
+++ b/vdsm/virt/vm_migrate_plugins/__init__.py
@@ -0,0 +1,54 @@
+# 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
+#
+
+import abc
+from importlib import import_module
+from pkgutil import iter_modules
+
+import six
+
+
+_DRIVERS = []
+
+
+def do_default_processing(domxml, device_conf):
+ result = True
+ for driver in _DRIVERS:
+ result = result and driver.create().do_default_processing(domxml,
+ device_conf)
+ return result
+
+
+def process(domxml, device_conf):
+ for driver in _DRIVERS:
+ driver.create().process(domxml, device_conf)
+
+
+class VmMigrateDriver():
+
+ @abc.abstractmethod
+ def do_default_processing(self, domxml, device_conf):
+ pass
+
+ @abc.abstractmethod
+ def process(self, domxml, device_conf):
+ pass
+
+for _, module, _ in iter_modules([__path__[0]]):
+ _DRIVERS.append(import_module('{}.{}'.format(__name__, module)))
--
To view, visit https://gerrit.ovirt.org/64001
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I7e13a94fa28968e37cd2d4d99fe540c8b762f7cc
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Marcin Mirecki <mmirecki(a)redhat.com>
7 years, 7 months
Change in vdsm[master]: service: Add vdsm-tool-update service
by Douglas Schilling Landgraf
Hello Fabian Deutsch,
I'd like you to do a code review. Please visit
https://gerrit.ovirt.org/64904
to review the following change.
Change subject: service: Add vdsm-tool-update service
......................................................................
service: Add vdsm-tool-update service
oVirt-Node Next provides updates via squashfs images and
between major/minor updates based on EL7 might occur changes
of selinux policy/booleans affecting previous vdsm settings.
This patch creates a new service 'vdsm-tool-update' that handle
such image updates scenarios.
Change-Id: Ib9c4fffb09d2a5c49b0462693fb2beca47fb58ea
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1373389
Signed-off-by: Fabian Deutsch <fabiand(a)fedoraproject.org>
Signed-off-by: Douglas Schilling Landgraf <dougsland(a)redhat.com>
---
M init/systemd/85-vdsmd.preset
M static/Makefile.am
A static/usr/lib/systemd/system/vdsm-tool-update.service
M vdsm.spec.in
4 files changed, 19 insertions(+), 0 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/04/64904/1
diff --git a/init/systemd/85-vdsmd.preset b/init/systemd/85-vdsmd.preset
index 6da4332c..632235f 100644
--- a/init/systemd/85-vdsmd.preset
+++ b/init/systemd/85-vdsmd.preset
@@ -5,6 +5,7 @@
enable supervdsmd.service
enable vdsm-network.service
enable vdsm-network-init.service
+enable vdsm-tool-update.service
enable mom-vdsm.service
disable ksmtuned.service
diff --git a/static/Makefile.am b/static/Makefile.am
index 040d6ec..68a98c0 100644
--- a/static/Makefile.am
+++ b/static/Makefile.am
@@ -86,6 +86,7 @@
./usr/lib/systemd/system/supervdsmd.service \
./usr/lib/systemd/system/vdsm-network.service \
./usr/lib/systemd/system/vdsm-network-init.service \
+ ./usr/lib/systemd/system/vdsm-tool-update.service \
./usr/lib/systemd/system/vdsmd.service \
$(NULL)
@@ -111,5 +112,6 @@
./usr/lib/systemd/system/supervdsmd.service.in \
./usr/lib/systemd/system/vdsm-network.service.in \
./usr/lib/systemd/system/vdsm-network-init.service.in \
+ ./usr/lib/systemd/system/vdsm-tool-update.service \
./usr/lib/systemd/system/vdsmd.service.in \
$(NULL)
diff --git a/static/usr/lib/systemd/system/vdsm-tool-update.service b/static/usr/lib/systemd/system/vdsm-tool-update.service
new file mode 100644
index 0000000..ad39290
--- /dev/null
+++ b/static/usr/lib/systemd/system/vdsm-tool-update.service
@@ -0,0 +1,13 @@
+[Unit]
+Description=Reconfigure vdsmd
+Conflicts=shutdown.target
+Before=supervdsmd.service vdsmd.service shutdown.target systemd-update-done.service
+ConditionNeedsUpdate=/usr
+
+[Service]
+Type=oneshot
+RemainAfterExit=yes
+ExecStart=/bin/vdsm-tool configure --force
+
+[Install]
+WantedBy=multi-user.target
diff --git a/vdsm.spec.in b/vdsm.spec.in
index 80360d0..23e079e 100644
--- a/vdsm.spec.in
+++ b/vdsm.spec.in
@@ -849,6 +849,7 @@
%systemd_post supervdsmd.service
%systemd_post vdsm-network.service
%systemd_post vdsm-network-init.service
+%systemd_post vdsm-tool-update.service
%systemd_post mom-vdsm.service
%systemd_post ksmtuned.service
@@ -863,6 +864,7 @@
%systemd_preun vdsmd.service
%systemd_preun vdsm-network.service
%systemd_preun vdsm-network-init.service
+%systemd_preun vdsm-tool-update.service
%systemd_preun supervdsmd.service
%systemd_preun mom-vdsm.service
%systemd_preun ksmtuned.service
@@ -907,6 +909,7 @@
%{_unitdir}/vdsmd.service
%{_unitdir}/vdsm-network.service
%{_unitdir}/vdsm-network-init.service
+%{_unitdir}/vdsm-tool-update.service
%{_unitdir}/supervdsmd.service
%{_unitdir}/mom-vdsm.service
%{_sysconfdir}/systemd/system/libvirtd.service.d/unlimited-core.conf
--
To view, visit https://gerrit.ovirt.org/64904
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib9c4fffb09d2a5c49b0462693fb2beca47fb58ea
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Douglas Schilling Landgraf <dougsland(a)redhat.com>
Gerrit-Reviewer: Fabian Deutsch <fabiand(a)redhat.com>
7 years, 7 months