Script move_instance
[hide private]
[frames] | no frames]

Script move_instance

Tool to move instances from one cluster to another.

Classes [hide private]
  Error
Generic error.
  Abort
Special exception for aborting import/export.
  RapiClientFactory
Factory class for creating RAPI clients.
  MoveJobPollReportCb
  InstanceMove
Status class for instance moves.
  MoveRuntime
Class to keep track of instance move.
  MoveDestExecutor
  MoveSourceExecutor
  MoveSourceWorker
Functions [hide private]
 
CheckRapiSetup(rapi_factory)
Checks the RAPI setup by retrieving the version.
 
ParseOptions()
Parses options passed to program.
 
CheckOptions(parser, options, args)
Checks options and arguments for validity.
 
DestClusterHasDefaultIAllocator(rapi_factory)
Determines if a given cluster has a default iallocator.
 
ExitWithError(message)
Exits after an error and shows a message.
 
main()
Main routine.
Variables [hide private]
  SRC_RAPI_PORT_OPT = cli.cli_option("--src-rapi-port", action= ...
  SRC_CA_FILE_OPT = cli.cli_option("--src-ca-file", action= "sto...
  SRC_USERNAME_OPT = cli.cli_option("--src-username", action= "s...
  SRC_PASSWORD_FILE_OPT = cli.cli_option("--src-password-file", ...
  DEST_RAPI_PORT_OPT = cli.cli_option("--dest-rapi-port", action...
  DEST_CA_FILE_OPT = cli.cli_option("--dest-ca-file", action= "s...
  DEST_USERNAME_OPT = cli.cli_option("--dest-username", action= ...
  DEST_PASSWORD_FILE_OPT = cli.cli_option("--dest-password-file"...
  DEST_INSTANCE_NAME_OPT = cli.cli_option("--dest-instance-name"...
  DEST_PRIMARY_NODE_OPT = cli.cli_option("--dest-primary-node", ...
  DEST_SECONDARY_NODE_OPT = cli.cli_option("--dest-secondary-nod...
  DEST_DISK_TEMPLATE_OPT = cli.cli_option("--dest-disk-template"...
  COMPRESS_OPT = cli.cli_option("--compress", action= "store", t...
  PARALLEL_OPT = cli.cli_option("-p", "--parallel", action= "sto...

Imports: os, sys, time, logging, optparse, threading, cli, constants, utils, workerpool, objects, compat, rapi, ganeti, UsesRapiClient


Function Details [hide private]

CheckRapiSetup(rapi_factory)

 

Checks the RAPI setup by retrieving the version.

Parameters:

main()

 

Main routine.

Decorators:
  • @UsesRapiClient

Variables Details [hide private]

SRC_RAPI_PORT_OPT

Value:
cli.cli_option("--src-rapi-port", action= "store", type= "int", dest= \
"src_rapi_port", default= constants.DEFAULT_RAPI_PORT, help= ("Source \
cluster RAPI port (defaults to %s)" % constants.DEFAULT_RAPI_PORT))

SRC_CA_FILE_OPT

Value:
cli.cli_option("--src-ca-file", action= "store", type= "string", dest=\
 "src_ca_file", help= ("File containing source cluster Certificate" " \
Authority (CA) in PEM format"))

SRC_USERNAME_OPT

Value:
cli.cli_option("--src-username", action= "store", type= "string", dest\
= "src_username", default= None, help= "Source cluster username")

SRC_PASSWORD_FILE_OPT

Value:
cli.cli_option("--src-password-file", action= "store", type= "string",\
 dest= "src_password_file", help= "File containing source cluster pass\
word")

DEST_RAPI_PORT_OPT

Value:
cli.cli_option("--dest-rapi-port", action= "store", type= "int", dest=\
 "dest_rapi_port", default= constants.DEFAULT_RAPI_PORT, help= ("Desti\
nation cluster RAPI port (defaults to source" " cluster RAPI port)"))

DEST_CA_FILE_OPT

Value:
cli.cli_option("--dest-ca-file", action= "store", type= "string", dest\
= "dest_ca_file", help= ("File containing destination cluster Certific\
ate" " Authority (CA) in PEM format (defaults to source" " cluster CA)\
"))

DEST_USERNAME_OPT

Value:
cli.cli_option("--dest-username", action= "store", type= "string", des\
t= "dest_username", default= None, help= ("Destination cluster usernam\
e (defaults to" " source cluster username)"))

DEST_PASSWORD_FILE_OPT

Value:
cli.cli_option("--dest-password-file", action= "store", type= "string"\
, dest= "dest_password_file", help= ("File containing destination clus\
ter password" " (defaults to source cluster password)"))

DEST_INSTANCE_NAME_OPT

Value:
cli.cli_option("--dest-instance-name", action= "store", type= "string"\
, dest= "dest_instance_name", help= ("Instance name on destination clu\
ster (only" " when moving exactly one instance)"))

DEST_PRIMARY_NODE_OPT

Value:
cli.cli_option("--dest-primary-node", action= "store", type= "string",\
 dest= "dest_primary_node", help= ("Primary node on destination cluste\
r (only" " when moving exactly one instance)"))

DEST_SECONDARY_NODE_OPT

Value:
cli.cli_option("--dest-secondary-node", action= "store", type= "string\
", dest= "dest_secondary_node", help= ("Secondary node on destination \
cluster (only" " when moving exactly one instance)"))

DEST_DISK_TEMPLATE_OPT

Value:
cli.cli_option("--dest-disk-template", action= "store", type= "string"\
, dest= "dest_disk_template", default= None, help= "Disk template to u\
se on destination cluster")

COMPRESS_OPT

Value:
cli.cli_option("--compress", action= "store", type= "string", dest= "c\
ompress", default= "none", help= "Compression mode to use during the m\
ove (this mode has" " to be supported by both clusters)")

PARALLEL_OPT

Value:
cli.cli_option("-p", "--parallel", action= "store", type= "int", defau\
lt= 1, dest= "parallel", metavar= "<number>", help= "Number of instanc\
es to be moved simultaneously")