Package: tccbsmig
TccbsmigTccbsmig is designed to batch transfer all the data on an unencrypted CBS mounted on a CVM to an encrypted CBS for Tencent Cloud. To use it, you need to prepare a JSON file as an input, which includes your account SecrectID, SecrectKey, and all related CVM Instances and storages information.For each disk needs to be encrypted, tccbsmig automatically calls CBS APIs to create a new encrypted CBS disk and mount it on the instance where unencrypted disk is attached, and then copies the data from unencrypted disk to the encrypted, and detaches the unencrypted disk after data transfer has been completed, and the new encrypted disk will be mounted at the same file path as the unencrypted disk in the end.How to use tccbsmigusage: tccbsmig [-h] -f FILE [-V]How to install tccbsmig on LinuxInstall the package usepip. On a Linux system, usepip3to install:.pip3 install tccbsmig.On Linuxpip install ...put scripts into~/.local/binand this is not on the default Debian or Ubuntu$PATH. To fix, you need to add~/.local/binto your $PATH:.export PATH="$HOME/.local/bin:$PATH"How to prepare the JSON fileAttributes' value share the same rules of the APIs that used in this program if applicable.API used in this program:CreateDisks:https://intl.cloud.tencent.com/document/api/362/16312AttachDisks:https://intl.cloud.tencent.com/document/api/362/16313DetachDisks:https://intl.cloud.tencent.com/document/api/362/16316An example of qualified JSON file is on the end of this doc.JSON file structure explaination:Credentials- this attribute is used to store credentialsSecrectID- your account SecrectIDSecrectKey- your account SecrectKeyCBS_Cases- stores all instances and block storages detailsCase_Name- the name of each case. You can modify case's name to whatever you want.InstanceDetail- instance DetailInstanceId(String)- instance ID of your instanceInstancePublicIP(String)- public IP address of your instanceInstanceName(String)- your instance's nameRegion(String)- the region your instance is inZone(String)- the availability zone your instance is inProjectId(Int)- the project ID of your instanceUsername(String)- username that used to log in your instanceSSHKeyPath(String)- SSH Key file locationCBSDetail- CBS detailDiskId(String)- the disk ID of your CBSDiskType(String)- the disk type of your CBSDiskSize(Int)- the size of your diskCBSPathOnCVM(String)- mount point of your diskFileSystem(String)- the file system your disk usesDiskName(String)- your disk nameTags(String)- tag of your disk.If you don't want to set this value, leave an empty string here.JSON file example{  
  "Credentials":{  
    "SecrectID":"AKID****************",  
    "SecrectKey":"1nKc*****************"  
  },  
  "CBS_Cases":{  
    "CBS_1":  
    {  
      "InstanceDetail":{  
        "InstanceId": "ins-3u***yg1",  
        "InstancePublicIP": "175.***.***.101",  
        "InstanceName":"ebs-en-test",  
        "Region": "ap-shanghai",  
        "Zone": "ap-shanghai-3",  
        "ProjectId": 111***1,  
        "Username": "ubuntu",  
        "SSHKeyPath": "/Path-to-SSHKey/SSHKey.dms"  
      },  
      "CBSDetail":{  
        "DiskId": "disk-q9***f8n",  
        "DiskType": "CLOUD_PREMIUM",  
        "DiskSize": 50,  
        "CBSPathOnCVM": "/data",  
        "FileSystem":"ext4",  
        "DiskName": "diskname",  
        "Tags": ""  
      }  
    },  
    "CBS_2":  
    {  
      "InstanceDetail":{  
        "InstanceId": "ins-3b***6e8",  
        "InstancePublicIP": "106.***.***.136",  
        "InstanceName":"un-en-test",  
        "Region": "ap-guangzhou",  
        "Zone": "ap-guangzhou-3",  
        "ProjectId": 111***1,  
        "Username": "ubuntu",  
        "SSHKeyPath": "/Path-to-SSHKey/SSHKey.dms"  
      },  
      "CBSDetail":{  
        "DiskId": "disk-ef***3pe",  
        "DiskType": "CLOUD_PREMIUM",  
        "DiskSize": 30,  
        "CBSPathOnCVM": "/data",  
        "FileSystem":"ext4",  
        "DiskName": "un-test",  
        "Tags": "[{\"Key\":\"TagKey\",\"Value\":\"TagValue\"}]"  
      }  
    }  
  }  
}For more information about Tencent Cloud, please visit:https://intl.cloud.tencent.comCloud Virtual Machine:https://intl.cloud.tencent.com/product/cvmCloud Block Storage:https://intl.cloud.tencent.com/product/cbs