Esempio n. 1
0
    def test_vm_recovery(self):
        service_start('vdsmd')

        # two VMs:
        # #0 dies:
        #    it goes down and then VDSM restarts; the VM stats
        #    must conserve the exit* fields unchanged across VDSM restarts.
        # #1 disappears:
        #    it goes down while VDSM is down: must be reported as down.
        with self.running_vms(2, customize_vm) as vms:
            os.kill(vms[0].pid, signal.SIGTERM)
            self._waitForShutdown(vms[0].id)

            stats_before = vms[0].stats()

            pid = vms[1].pid
            service_stop('vdsmd')

            os.kill(pid, signal.SIGTERM)

            service_start('vdsmd')
            self.ensure_vdsm_started()

            stats_after = vms[0].stats()
            self.assertEqual(stats_after['status'], vmstatus.DOWN)
            for field in ('status', 'exitReason', 'exitMessage'):
                self.assertEqual(stats_before[field], stats_after[field])

            self.assertEqual(vms[1].stats()['status'], vmstatus.DOWN)
Esempio n. 2
0
    def service_up_test(self):
        service_start('vdsmd')
        vdsm_version = run_command(['rpm', '-q', 'vdsm'])
        downgrade_vdsm(el7_ovirt36_repo)
        upgrade_vdsm()

        self.assertEqual(run_command(['rpm', '-q', 'vdsm']), vdsm_version)
        self.assertEqual(service_status('vdsmd'), 0)
Esempio n. 3
0
    def test_service_up(self):
        service_start('vdsmd')
        vdsm_version = commands.run(['rpm', '-q', 'vdsm'])
        downgrade_vdsm(el7_ovirt36_repo)
        upgrade_vdsm()

        assert commands.run(['rpm', '-q', 'vdsm']) == vdsm_version
        assert service_status('vdsmd') == 0
Esempio n. 4
0
def libvirt_configure_services_restart(*args):
    """
    Managing restart of related services
    """
    service.service_stop("supervdsmd")
    service.service_stop("libvirtd")
    service.service_start("libvirtd")
    service.service_start("supervdsmd")
    return 0
Esempio n. 5
0
File: libvirt.py Progetto: nirs/vdsm
def configure():
    # Remove a previous configuration (if present)
    confutils.remove_conf(FILES, CONF_VERSION)

    vdsmConfiguration = {
        'ssl_enabled': config.getboolean('vars', 'ssl'),
        'sanlock_enabled': constants.SANLOCK_ENABLED,
        'libvirt_selinux': constants.LIBVIRT_SELINUX
    }

    # write configuration
    for cfile, content in FILES.items():
        content['configure'](content, CONF_VERSION, vdsmConfiguration)

    # enable and acivate dev-hugepages1G mounth path
    if not _is_hugetlbfs_1g_mounted():
        try:
            service.service_start('dev-hugepages1G.mount')
        except service.ServiceOperationError:
            status = service.service_status('dev-hugepages1G.mount', False)
            if status == 0:
                raise
Esempio n. 6
0
 def tearDown(self):
     run_command(['yum-config-manager', '--disable', '*ovirt-3.6*'])
     run_command(['yum-config-manager', '--enable', 'localsync'])
     # make sure vdsm is installed and running
     run_command(['yum', 'install', '-y', 'vdsm'])
     service_start('vdsmd')
Esempio n. 7
0
 def teardown_method(self, method):
     commands.run(['yum-config-manager', '--disable', '*ovirt-3.6*'])
     commands.run(['yum-config-manager', '--enable', 'localsync'])
     # make sure vdsm is installed and running
     commands.run(['yum', 'install', '-y', 'vdsm'])
     service_start('vdsmd')
Esempio n. 8
0
 def teardown_method(self, method):
     commands.run(['yum-config-manager', '--disable', '*ovirt-3.6*'])
     commands.run(['yum-config-manager', '--enable', 'localsync'])
     # make sure vdsm is installed and running
     commands.run(['yum', 'install', '-y', 'vdsm'])
     service_start('vdsmd')
Esempio n. 9
0
 def tearDown(self):
     run_command(['yum-config-manager', '--disable', '*ovirt-3.6*'])
     run_command(['yum-config-manager', '--enable', 'localsync'])
     # make sure vdsm is installed and running
     run_command(['yum', 'install', '-y', 'vdsm'])
     service_start('vdsmd')