Exemple #1
0
#
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an AS IS BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
# implied.
# See the License for the specific language governing permissions and#
# limitations under the License.


from cinderclient.v1 import client as cinder_client

from cloudferrylib.base import storage
from cloudferrylib.utils import utils as utl

LOG = utl.get_log(__name__)

AVAILABLE = 'available'
IN_USE = "in-use"


class CinderStorage(storage.Storage):

    """
    The main class for working with Openstack cinder client
    """

    def __init__(self, config, cloud):
        self.config = config
        self.host = config.cloud.host
        self.mysql_host = config.mysql.db_host \
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an AS IS BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
# implied.
# See the License for the specific language governing permissions and#
# limitations under the License.


from cloudferrylib.base.action import action
from cloudferrylib.utils import utils


LOG = utils.get_log(__name__)

NAMESPACE = 'IMAGE_SNAPSHOT'


class ImageSnapshotBasic(action.Action):

    """Base class that contains common to image_snapshot methods"""

    def get_image_resource(self):
        """returns cloudferry image resource"""
        return self.cloud.resources[utils.IMAGE_RESOURCE]

    def get_images_id_list(self):
        """returns array of images id"""
        return self.get_image_resource().read_info()['images'].keys()
from cloud import cloud_ferry
from cloud import grouping

from condensation import process
from condensation import utils as condense_utils
from condensation.action import get_freed_nodes
from condensation.scripts import nova_collector

import data_storage
from dry_run import chain
from evacuation import evacuation_chain
from make_filters import make_filters

env.forward_agent = True
env.user = '******'
LOG = utils.get_log(__name__)

DEFAULT_FILTERS_FILES = 'configs/filters'


@task
def migrate(name_config=None, name_instance=None, debug=False):
    """
        :name_config - name of config yaml-file, example 'config.yaml'
    """
    if debug:
        utils.configure_logging("DEBUG")
    cfglib.collector_configs_plugins()
    cfglib.init_config(name_config)
    utils.init_singletones(cfglib.CONF)
    env.key_filename = cfglib.CONF.migrate.key_filename
Exemple #4
0
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
# implied.
# See the License for the specific language governing permissions and#
# limitations under the License.

from fabric.api import task, env
from cloudferrylib.scheduler.namespace import Namespace
from cloudferrylib.scheduler.scheduler import Scheduler
import cfglib
from cloudferrylib.utils import utils as utl
from cloudferrylib.utils import utils
from cloud import cloud_ferry

env.forward_agent = True
env.user = '******'
LOG = utl.get_log(__name__)


@task
def migrate(name_config=None, name_instance=None):
    """
        :name_config - name of config yaml-file, example 'config.yaml'
    """
    cfglib.collector_configs_plugins()
    cfglib.init_config(name_config)
    utils.init_singletones(cfglib.CONF)
    env.key_filename = cfglib.CONF.migrate.key_filename
    cloud = cloud_ferry.CloudFerry(cfglib.CONF)
    cloud.migrate()