Configuring a VM
After installing a VM, you need to configure the VM.
Prerequisites
- A VM has been installed.
- LUNs have been added to the corresponding LUN group.
Context
- The MAC address of a VM is generated at random. If the operating system of a VM is reinstalled, or a network adapter is re-added for a VM, the VM's MAC address changes, causing the license file unavailable.
- Command outputs in this document are for reference only. They may vary with device versions and models.
Procedure
- Log in to the storage system through the CLI.
- Add a VM service port.
VMs use service ports to transfer data to peripheral devices.
- System maintenance ports cannot be added to VMs to function as service ports.
- A new VM has a default management port. This port cannot be used as a service port.
- Run the show port general logic_type=Host_port command or use DeviceManager to query information about ports.
- Service ports can only be added to VMs on the controller that houses the service ports. For example, ports on controller A can only be added to VMs on controller A.
- To prevent the system from managing VMs through service ports, configure the service ports and harden them for security.
- Do not use bond ports within VMs.
- Only an idle service port can be added for a VM. This service port must not be added for another VM anymore.
Run the add virtual_machine port command to add a VM service port and use parameters vm_id, and port_type to specify the ID of the VM, and the type of port. Set other parameters as follows:
- If you need to assign a MAC address to the internal network port of a VM (The MAC address is lost due to network adapter faults and the service software license is bound with the MAC address when VM services are running), use parameters port_id and mac_address to specify the ID of the port, and the MAC address of the internal network port. You must manually generate and specify the MAC address and ensure that it is not the same as other MAC addresses in the same LAN to avoid the conflict.
- If you do not need to assign a MAC address to the internal network port of a VM (adding new network ports), use parameter port_id_list to specify the location of one or more physical network ports to be added. After the command is successfully executed, you can run the show virtual_machine port command to view MAC addresses assigned to VMs' network ports.
To obtain the port ID list, run the show port general physical_type=ETH command without parameters.
Example:
admin:/>show port general physical_type=ETH --------------- Host Port:---------------- ID Health Status Running Status Type IPv4 Address IPv6 Address MAC Role Working Rate(Mbps) Enabled Max Speed(Mbps) Number Of Initiators -------------- ------------- -------------- --------- ------------ ------------ ----------------- ----------- ------------------ ------- --------------- -------------------- CTE0.A.H0 Normal Link Down Host Port -- -- 50:5a:bb:cc:dd:01 INI and TGT -- Yes 10000 0 CTE0.A.H1 Normal Link Down Host Port -- -- 50:5a:bb:cc:dd:03 INI and TGT -- Yes 10000 0 CTE0.A.H2 Normal Link Down Host Port -- -- 50:5a:bb:cc:dd:00 INI and TGT -- Yes 10000 0 CTE0.A.H3 Normal Link Down Host Port -- -- 50:5a:bb:cc:dd:02 INI and TGT -- Yes 10000 0 CTE0.A.IOM0.P0 Normal Link Up Host Port -- -- 10:51:72:4c:74:97 INI and TGT 1000 Yes 1000 0 CTE0.A.IOM0.P1 Normal Link Up Host Port -- -- 10:51:72:4c:74:96 INI and TGT 1000 Yes 1000 0 CTE0.A.IOM0.P2 Normal Link Up Host Port -- -- 10:51:72:4c:74:95 INI and TGT 1000 Yes 1000 0 CTE0.A.IOM0.P3 Normal Link Up Host Port -- -- 10:51:72:4c:74:94 INI and TGT 1000 Yes 1000 0 CTE0.B.IOM0.P0 Normal Link Up Host Port -- -- 34:00:a3:06:e7:21 INI and TGT 1000 Yes 1000 0 CTE0.B.IOM0.P1 Normal Link Up Host Port -- -- 34:00:a3:06:e7:20 INI and TGT 1000 Yes 1000 0 CTE0.B.IOM0.P2 Normal Link Up Host Port -- -- 34:00:a3:06:e7:1f INI and TGT 1000 Yes 1000 0 CTE0.B.IOM0.P3 Normal Link Up Host Port -- -- 34:00:a3:06:e7:1e INI and TGT 1000 Yes 1000 0 ------------ Management Port:------------- ID Health Status Running Status Type IPv4 Address IPv6 Address MAC Role Working Rate(Mbps) Enabled Max Speed(Mbps) ----------- ------------- -------------- --------------- ------------ -------------------- ----------------- ---- ------------------ ------- --------------- CTE0.A.MGMT Normal Link Up Management Port X.XX.X.XX abcd::6597 02:08:80:86:15:4b -- 1000 Yes 1000 CTE0.B.MGMT Normal Link Up Management Port X.XX.X.XX 2016:8:46:0:a02::123 bc:3f:8f:8a:28:08 -- 1000 Yes 1000 ------------ Maintenance Port:------------ ID Health Status Running Status Type IPv4 Address IPv6 Address MAC Role Working Rate(Mbps) Enabled Max Speed(Mbps) ------------------ ------------- -------------- ---------------- -------------- ------------ ----------------- ---- ------------------ ------- --------------- CTE0.A.MAINTENANCE Normal Link Down Maintenance Port 192.168.50.16 -- 02:08:80:86:15:4c -- -- Yes 1000 CTE0.B.MAINTENANCE Normal Link Down Maintenance Port 192.168.50.16 -- bc:3f:8f:8a:28:09 -- -- Yes 1000 admin:/>
For example, add physical network adapter P0 on controller A to VM test.
admin:/>add virtual_machine port vm_id=1 port_type=eth port_id=CTE0.A.IOM0.P0 mac_address=10:51:72:4c:74:97 WARNING: You are about to add the network port to the VM and specify the MAC address for the port. This operation may cause the MAC address of the port to conflict with that of another network device in the Local Area Network (LAN), interrupting VM network services. Suggestion: Before performing this operation, ensure that the MAC address of the network port does not conflict with that of any other network device in the LAN. Have you read warning message carefully?(y/n)y Are you sure you really want to perform the operation?(y/n)y Command executed successfully. admin:/>show virtual_machine port vm_id=1 ID VM ID Health Status Running Status Mapping Mode Use Type MAC Bond Name Port Type Port ID List ------ ----- ------------- -------------- ------------ ------------ ----------------- --------- --------- -------------- 131328 1 Normal Link Up Bridge Link Primary Port e0:97:96:c1:33:aa -- ETH CTE0.A.IOM0.P0
- Add a block device to the VM to store VM data.
Run the add virtual_machine block command to add a block device to a VM and use parameters vm_id, and block_id_list to specify the ID of the VM, and the ID of the block.
- Run the show virtual_machine block command to identify the block ID.
- One block device can be added to only one VM. For this reason, VMs do not support cluster services.
After a block device is added to a VM, the last 16 bits of the block device's WWN can be viewed on the operating system. The command varies with the operating system:
- Linux: Run ll /dev/disk/by-id.
For example, add a block to VM test.
admin:/>show virtual_machine block ID Health Status Running Status Owner Container ID Capacity Use Mode WWN Virtual Machine ID Virtual Machine Name -- ------------- -------------- ------------------ ---------- -------- -------------------------------- ------------------ -------------------- 0 Normal Online 0 150.000GB DATA 630d17e100b0fe1400065f6800000000 1 Normal Online 1 150.000GB DATA 630d17e100b0fe14000667ff00000001 2 Normal Online 0 191.000GB DATA 630d17e100b0fe140154791500000003 admin:/>add virtual_machine block vm_id=1 block_id_list=2 Add block 2 successfully.
- Power on the VM. For details, see Powering on a VM.
- Open the VM Console. For details, see Opening the VM Console.
- Configure the service port IP address for the VM on the VM operating system.
- Run related commands to use storage space provided by the storage system.