This topic describes how to use the idc-scanner tool provided by Cloud Migration Hub (CMH) to survey Linux-based resources in your data centers.
Video tutorial
Prerequisites
The idc-scanner tool can survey only resources of servers that run UNIX-like operating systems. For more information, see Supported source types and migration tools.
Prepare a runtime environment
Tool server selection
The idc-scanner tool must be installed and run on a tool server that can communicate with the servers under survey over SSH. The best tool server is a jump server in traditional O&M systems.
Tool server specifications and OS requirements
The tool server requires at least 2 CPU cores and 4 GB of memory and must run a mainstream Linux distribution. We recommend that you use CentOS 7.
Software dependencies
If you have not configured SSH mutual trust between your tool server and servers under survey, you are prompted to enter a password when you log on to the servers under survey. In this case, you must install sshpass before you run the idc-scanner tool.
We recommend that you download the sshpass installation package from Yellowdog Updater, Modified (YUM) repositories or over the Internet.
YUM-based installation
If YUM is configured on your tool server, you can use YUM to install sshpass by running the following command: yum install sshpass
.
Manual installation
If you want to install sshpass by using the source code, you can download the sshpass distribution from the official website. After you download the package, you can run the following commands to manually install sshpass:
tar -zxvf sshpass-1.06.tar.gz
cd sshpass-1.06
./configure
make
make install
Configure logon users
If you use the idc-scanner tool to survey physical servers, you need to only configure a logon user for each server under survey. You do not need to grant the logon users additional permissions on files on the servers under survey.
Download an installation package of the idc-scanner tool
Download an installation package of the idc-scanner tool based on your OS. Then, upload the installation package to the tool server and decompress the installation package.
Operating system | Method to obtain an installation package |
Linux(X86) | Log on to the CMH console. In the left-side navigation pane, choose Assessment > Resource Collection. On the Offline Collection tab of the Resource Collection page, click Download Tool in the IDC section, and then click Download Linux. |
Windows(X86) | Log on to the CMH console. In the left-side navigation pane, choose Assessment > Resource Collection. On the Offline Collection tab of the Resource Collection page, click Download Tool in the IDC section, and then click Download Windows. |
To decompress the installation package, run the tar zxvf idc-scanner.tar.gz command.
Configure a parameter file
Before you run the idc-scanner tool, you must obtain the IP addresses of the servers under survey and the usernames, passwords, and SSH ports that are used to log on to the servers. Write the obtained information in a list text file in the working directory in the following format:
Format:
username1:password1:ip1:ssh_port
username2:password2:ip2:ssh_port
...
Example:
>> cat list
userA:XXXX:39.105.XXX.23:22
userA:XXXX:123.56.XXX.29:22
userA:XXXX:47.94.XXX.252:22
If you have configured SSH mutual trust between your tool server and servers under survey, you do not need to write the passwords that are used to log on to the servers under survey in the parameter file. Example:
>> cat list
userA::39.105.XXX.23:9922
userA::123.56.XXX.29:9922
userA::47.94.XXX.252:9922
Configure a working directory
You must configure the following working directory for the idc-scanner tool. In the working directory, the output directory is used to store the output files, and the export directory is used to store the raw machine information that is exported.
|-idc-scanner/
|-idc-scanner
|-list
|-output/
|-export/
Run the tool
After you prepare the environment, you can run the idc-scanner tool to survey resources in your data centers. The following sample code shows the commands and corresponding output.
You can use the -p parameter to specify the total duration to monitor the performance and network status, and use the -i parameter to specify the resource collection interval measured in seconds.
# Command 1: Run the following command if the tool server connects to the servers to be surveyed by using regular accounts and passwords:
./idc-scanner
# Command 2: Run the following command if you have configured SSH mutual trust between the tool server and the servers to be surveyed:
./idc-scanner --sshkey
# Command 3: Run the following command to specify the total status monitoring duration and resource collection interval:
./idc-scanner -p 3600 -i 30
# Optional parameter description:
# optional arguments:
# -s, --sshkey Use SSHKEY
# -p, --period Monitor period, range [60, 36000], default 600
# -i, --interval Monitor interval, range [30, 60], default 30
# Expected output:
Scanning and exporting ...
thread0 begin to export from39.xx.xx.23
thread1 begin to export from39.xx.xx.23
thread2 begin to export from39.xx.xx.23
...
thread9 begin to export from123.xx.xx.29
thread7 begin to export from123.xx.xx.29
thread8 begin to export from123.xx.xx.29
...
thread7 begin to export from47.xx.xx.252
thread1 begin to export from47.xx.xx.252
...
Scanning finished!
Parser finish machine:39.xx.xx.23
...
Start monitor ... period: 3600s, interval: 30s
monitoring... single round time 8.761 s, 1 / 121
monitoring... single round time 8.824 s, 2 / 121
...
monitoring... single round time 9.306 s, 120 / 121
monitoring... single round time 9.299 s, 121 / 121
Main finish and build output : output.tar.gz
Main finish and build export : export.tar.gz
Analyze data on the tool server
After you run the idc-scanner tool, the following files are generated in the output directory:
topo.html # The file that contains the network topology.
index.html # The homepage of the survey information.
iconfont.css # The style file.
iconfont.ttf # The style file.
10.xx.xx. 106.html # The survey details page.
10.xx.xx. 139.html # The survey details page.
10.xx.xx. 101.html # The survey details page.
10.xx.xx. 108.html # The survey details page.
machines.json # The JSON file to be uploaded.
You can open the HTML files to view and analyze data on the tool server.
Upload resource information
After you verify that the data is correct on the tool server, you can upload the JSON file to CMH.
Log on to the CMH console. In the left-side navigation pane, choose Assessment > Resource Collection. On the Offline Collection tab of the Resource Collection page, click Upload in the IDC section. In the IDC dialog box, upload the JSON file.
After the JSON file is uploaded, you can view the upload task in the Collection Tasks section. Click the task ID to view the uploaded resource information. The surveyed resources are automatically imported to CMH and are displayed in the resource list.