Merge "config options: conductor live migrate options"
This commit is contained in:
@@ -10,13 +10,13 @@
|
|||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
from oslo_config import cfg
|
|
||||||
from oslo_log import log as logging
|
from oslo_log import log as logging
|
||||||
import oslo_messaging as messaging
|
import oslo_messaging as messaging
|
||||||
import six
|
import six
|
||||||
|
|
||||||
from nova.compute import power_state
|
from nova.compute import power_state
|
||||||
from nova.conductor.tasks import base
|
from nova.conductor.tasks import base
|
||||||
|
import nova.conf
|
||||||
from nova import exception
|
from nova import exception
|
||||||
from nova.i18n import _
|
from nova.i18n import _
|
||||||
from nova import objects
|
from nova import objects
|
||||||
@@ -24,15 +24,7 @@ from nova.scheduler import utils as scheduler_utils
|
|||||||
from nova import utils
|
from nova import utils
|
||||||
|
|
||||||
LOG = logging.getLogger(__name__)
|
LOG = logging.getLogger(__name__)
|
||||||
|
CONF = nova.conf.CONF
|
||||||
migrate_opt = cfg.IntOpt('migrate_max_retries',
|
|
||||||
default=-1,
|
|
||||||
help='Number of times to retry live-migration before failing. '
|
|
||||||
'If == -1, try until out of hosts. '
|
|
||||||
'If == 0, only try once, no retries.')
|
|
||||||
|
|
||||||
CONF = cfg.CONF
|
|
||||||
CONF.register_opt(migrate_opt)
|
|
||||||
|
|
||||||
|
|
||||||
class LiveMigrationTask(base.TaskBase):
|
class LiveMigrationTask(base.TaskBase):
|
||||||
|
@@ -46,6 +46,13 @@ workers = cfg.IntOpt(
|
|||||||
help='Number of workers for OpenStack Conductor service. '
|
help='Number of workers for OpenStack Conductor service. '
|
||||||
'The default will be the number of CPUs available.')
|
'The default will be the number of CPUs available.')
|
||||||
|
|
||||||
|
migrate_opt = cfg.IntOpt(
|
||||||
|
'migrate_max_retries',
|
||||||
|
default=-1,
|
||||||
|
help='Number of times to retry live-migration before failing. '
|
||||||
|
'If == -1, try until out of hosts. '
|
||||||
|
'If == 0, only try once, no retries.')
|
||||||
|
|
||||||
ALL_OPTS = [
|
ALL_OPTS = [
|
||||||
use_local,
|
use_local,
|
||||||
topic,
|
topic,
|
||||||
@@ -56,7 +63,9 @@ ALL_OPTS = [
|
|||||||
def register_opts(conf):
|
def register_opts(conf):
|
||||||
conf.register_group(conductor_group)
|
conf.register_group(conductor_group)
|
||||||
conf.register_opts(ALL_OPTS, group=conductor_group)
|
conf.register_opts(ALL_OPTS, group=conductor_group)
|
||||||
|
conf.register_opts([migrate_opt])
|
||||||
|
|
||||||
|
|
||||||
def list_opts():
|
def list_opts():
|
||||||
return {conductor_group: ALL_OPTS}
|
return {"DEFAULT": [migrate_opt],
|
||||||
|
conductor_group: ALL_OPTS}
|
||||||
|
@@ -17,7 +17,6 @@ import nova.cloudpipe.pipelib
|
|||||||
import nova.cmd.serialproxy
|
import nova.cmd.serialproxy
|
||||||
import nova.cmd.spicehtml5proxy
|
import nova.cmd.spicehtml5proxy
|
||||||
import nova.conductor.rpcapi
|
import nova.conductor.rpcapi
|
||||||
import nova.conductor.tasks.live_migrate
|
|
||||||
import nova.conf
|
import nova.conf
|
||||||
import nova.console.rpcapi
|
import nova.console.rpcapi
|
||||||
import nova.console.serial
|
import nova.console.serial
|
||||||
@@ -37,7 +36,6 @@ def list_opts():
|
|||||||
return [
|
return [
|
||||||
('DEFAULT',
|
('DEFAULT',
|
||||||
itertools.chain(
|
itertools.chain(
|
||||||
[nova.conductor.tasks.live_migrate.migrate_opt],
|
|
||||||
[nova.db.base.db_driver_opt],
|
[nova.db.base.db_driver_opt],
|
||||||
[nova.servicegroup.api.servicegroup_driver_opt],
|
[nova.servicegroup.api.servicegroup_driver_opt],
|
||||||
nova.db.api.db_opts,
|
nova.db.api.db_opts,
|
||||||
|
Reference in New Issue
Block a user