cloudstack icon indicating copy to clipboard operation
cloudstack copied to clipboard

Parametrize data source table for virtual routetrs to support migration

Open synergiator opened this issue 3 years ago • 1 comments

In a enterprise migration scenario, you could face a situation to restart hundreds of routers which may cause issues with operation of enterprise service like plannable downtime window, even if you split restart by zones.

The included scripted tool setup/bindir/cloud-sysvmadm sources routers list from the table cloud.vm_instance.

Possibly, there are many possible approaches how to establish partial batches if there are many routers.

For example:

  • Source alternatively from an external text file instead of direct DB connection
  • Parametrize table name allowing cloning subsets to temporary data tables in the DB
  • Provide a short list of router ID/names to restart individually

Here are some code lines how we implemented a parameter for an alternate table name, and it worked for us.

table="vm_instance"
..
while getopts 'sarhnvd:m:u:p:t:T:l:z:' OPTION
  T)	table="$OPTARG"
  		;;
  l)	LOGFILE="$OPTARG"
 ..

stop_start_system() {
secondary=(`mysql -h $db --user=$user --password=$password --skip-column-names -U cloud -e "select id from $table ...

synergiator avatar Apr 06 '22 13:04 synergiator

@synergiator can you please check the PR https://github.com/apache/cloudstack/pull/6574 and if possible test the script

shwstppr avatar Jul 29 '22 12:07 shwstppr