Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions ovs/constants/vpool.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Copyright (C) 2019 iNuron NV
#
# This file is part of Open vStorage Open Source Edition (OSE),
# as available from
#
# http://www.openvstorage.org and
# http://www.openvstorage.com.
#
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU Affero General Public License v3 (GNU AGPLv3)
# as published by the Free Software Foundation, in version 3 as it comes
# in the LICENSE.txt file of the Open vStorage OSE distribution.
#
# Open vStorage is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY of any kind.

import os

VPOOL_UPDATE_KEY = os.path.join(os.path.sep, 'ovs', 'volumedriver', 'update', 'storagerouter')

STORAGEDRIVER_SERVICE_BASE = 'ovs-volumedriver'

PACKAGES_OSE = ['volumedriver-no-dedup-base', 'volumedriver-no-dedup-server']
PACKAGES_EE = ['volumedriver-ee-base', 'volumedriver-ee-server']

VOLUMEDRIVER_BIN_PATH = os.path.join(os.path.sep, 'usr', 'bin', 'volumedriver_fs.sh')
VOLUMEDRIVER_CMD_NAME = 'volumedriver_fs'
13 changes: 11 additions & 2 deletions ovs/dal/hybrids/storagedriver.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"""

import time
from ovs.constants.vpool import VPOOL_UPDATE_KEY
from ovs.dal.dataobject import DataObject
from ovs.dal.structures import Property, Relation, Dynamic
from ovs.dal.hybrids.vdisk import VDisk
Expand Down Expand Up @@ -177,7 +178,7 @@ def _cluster_node_config(self):
"""
Prepares a ClusterNodeConfig dict for the StorageDriver process
"""
from ovs.extensions.generic.configuration import Configuration
from ovs.extensions.generic.configuration import Configuration, NotFoundException
rdma = Configuration.get('/ovs/framework/rdma')
distance_map = {}
primary_domains = []
Expand All @@ -187,10 +188,18 @@ def _cluster_node_config(self):
primary_domains.append(junction.domain_guid)
else:
secondary_domains.append(junction.domain_guid)
# @todo implement more race-conditions guarantees. Current guarantee is the single update invalidating the value
# through cluster_registry_checkup
try:
storagerouters_marked_for_update = list(Configuration.list(VPOOL_UPDATE_KEY))
except NotFoundException:
storagerouters_marked_for_update = []
for sd in self.vpool.storagedrivers:
if sd.guid == self.guid:
continue
if len(primary_domains) == 0:
if sd.storagerouter_guid in storagerouters_marked_for_update:
distance_map[str(sd.storagedriver_id)] = StorageDriver.DISTANCES.FAR
elif len(primary_domains) == 0:
distance_map[str(sd.storagedriver_id)] = StorageDriver.DISTANCES.NEAR
else:
distance = StorageDriver.DISTANCES.INFINITE
Expand Down
15 changes: 15 additions & 0 deletions ovs/lib/helpers/vdisk/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Copyright (C) 2019 iNuron NV
#
# This file is part of Open vStorage Open Source Edition (OSE),
# as available from
#
# http://www.openvstorage.org and
# http://www.openvstorage.com.
#
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU Affero General Public License v3 (GNU AGPLv3)
# as published by the Free Software Foundation, in version 3 as it comes
# in the LICENSE.txt file of the Open vStorage OSE distribution.
#
# Open vStorage is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY of any kind.
574 changes: 574 additions & 0 deletions ovs/lib/helpers/vdisk/rebalancer.py

Large diffs are not rendered by default.

Empty file removed ovs/lib/update/__init__.py
Empty file.
18 changes: 18 additions & 0 deletions ovs/update/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Copyright (C) 2019 iNuron NV
#
# This file is part of Open vStorage Open Source Edition (OSE),
# as available from
#
# http://www.openvstorage.org and
# http://www.openvstorage.com.
#
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU Affero General Public License v3 (GNU AGPLv3)
# as published by the Free Software Foundation, in version 3 as it comes
# in the LICENSE.txt file of the Open vStorage OSE distribution.
#
# Open vStorage is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY of any kind.

from .volumedriver.updater import VolumeDriverUpdater
from .alba.updater import AlbaComponentUpdater
15 changes: 15 additions & 0 deletions ovs/update/alba/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Copyright (C) 2019 iNuron NV
#
# This file is part of Open vStorage Open Source Edition (OSE),
# as available from
#
# http://www.openvstorage.org and
# http://www.openvstorage.com.
#
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU Affero General Public License v3 (GNU AGPLv3)
# as published by the Free Software Foundation, in version 3 as it comes
# in the LICENSE.txt file of the Open vStorage OSE distribution.
#
# Open vStorage is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY of any kind.
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,20 @@
# Open vStorage is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY of any kind.

from abc import abstractmethod
from ovs.extensions.generic.system import System
from ovs.extensions.storage.persistentfactory import PersistentFactory
from ovs_extensions.update.alba_component_update import AlbaComponentUpdater as _AlbacomponentUpdater
from ovs.log.log_handler import LogHandler


class AlbaComponentUpdater(_AlbacomponentUpdater):
"""
Implementation of abstract class to update alba
"""
logger = LogHandler.get('update', 'volumedriver')

@staticmethod
@abstractmethod
def get_persistent_client():
# type: () -> PyrakoonStore
"""
Retrieve a persistent client which needs
Needs to be implemented by the callee
Expand All @@ -37,7 +36,6 @@ def get_persistent_client():

@classmethod
def get_node_id(cls):
# type: () -> str
"""
use a factory to provide the machine id
:return:
Expand Down
22 changes: 20 additions & 2 deletions ovs/lib/update/single_update.md → ovs/update/single_update.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,25 @@
The Framework now supports updating certain components on a single host at the time.
It provides simple CLI commands (`ovs local_update <component>`) to update Arakoon, Alba and the volumedriver

## Alba update
## Volumedriver update
The Volumedriver update can be started by running `ovs local_update volumedriver`.
The local update will:
- Update the volumedriver binaries
- Update the node distance map to avoid HA-ing to the node being upgraded
- Move away all volumes from the node to other nodes
- Migrate away all MDS master instances running on the node
- Restart the volumedriver services
- Update the node distance map to accept HA back onto the node

### Exceptions
Certain exception can be thrown during the update.

| Exit code | Exception name | What happened |
| --------- | ---------------| ------------- |
| 21 | FailedToMigrateException | Not all volumes can be migrated away to different nodes. No moves have started yet |
| 22 | FailureDuringMigrateException | Some volumes could not be moved away during the migration process |

## Alba update
The Volumedriver update can be started by running `ovs local_update alba`.
The local update will:
- Update the volumedriver binaries. Currently, only andes-updates-3 towards andes-updates-4 is supported. Further updates towards bighorn will need further testing, as alba will bump from 1.5.x towards 1.6.x.
Expand All @@ -14,7 +32,7 @@ The local update will:
`/opt/alba<version>/bin/arakoon`
Note that given the nature of arakoon and its polling, stacktraces of nomaster exceptions may occure. These errors can be negated. This logging could not be suppressed, as essential other output could be suppressed with it.

### Exceptions
### Exceptions
Certain exception can be thrown during the update.

| Exit code | Exception name | What happened |
Expand Down
15 changes: 15 additions & 0 deletions ovs/update/volumedriver/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Copyright (C) 2019 iNuron NV
#
# This file is part of Open vStorage Open Source Edition (OSE),
# as available from
#
# http://www.openvstorage.org and
# http://www.openvstorage.com.
#
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU Affero General Public License v3 (GNU AGPLv3)
# as published by the Free Software Foundation, in version 3 as it comes
# in the LICENSE.txt file of the Open vStorage OSE distribution.
#
# Open vStorage is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY of any kind.
Loading