How Can I Manually Create VM-related Storage Resources?
This section describes how to manually initialize VM services on the CLI in V500R007C72 and later versions instead of using DeviceManager.
Context
- In V500R007C72 and later versions, VM services can be initialized and managed on DeviceManager of storage systems.
- You are advised to preferentially use DeviceManager to initialize VM services. If this method is unavailable (for example, some resources to be created already exist in the system and users do not want to delete them), you can manually create VM-related storage resources on the CLI.
- The following command outputs are for reference only. Planning and configuration should be based on the actual conditions. For detailed commands, refer to the command reference specific to your product model and version.
- The procedure for creating a VM file system varies with the storage system status. Details are as follows:
- If the VM file system, LUNs, storage pools, and disk domains are deleted, start from Step 1.
- If the VM file system, LUNs, and storage pools are deleted, start from Step 2.
- If the VM file system and LUNs are deleted, start from Step 3.
- If only the LUNs are deleted, forcibly delete the VM file system and then start from Step 3.
- In other cases, use similar rules or consult technical support engineers.
Procedure
- Create a disk domain.
Before creating a disk domain, run the show disk general command to query disk configuration. Use the first four disks (1.20 TB SAS disks) of the controller enclosure to create a disk domain.
create disk_domain name=? disk_list=?
[Example]
admin:/>create disk_domain name=disk_domain_0 disk_list=CTE0.0,CTE0.1,CTE0.2,CTE0.3 Command executed successfully.
- Create a storage pool.
Create a 1.5 TB RAID 10 storage pool.
create storage_pool name=? disk_type=? capacity=? raid_level=? disk_domain_id=?
[Example]
admin:/>create storage_pool name=storage_pool_0 disk_type=SAS capacity=1536GB raid_level=RAID10 disk_domain_id=0 Command executed successfully.
- Create two LUNs.
Run the following command to create two thick LUNs vm_lun_reserved_container0 and vm_lun_reserved_container1 and set their owning controllers to controllers 0A and 0B respectively.
create lun name=? pool_id=? capacity=? lun_type=? owner_controller=?
Obtain the pool_id field from the output of the show storage_pool general command.
[Example]
admin:/>create lun name=vm_lun_reserved_container0 pool_id=0 capacity=400GB lun_type=thick owner_controller=0A Command executed successfully. admin:/>create lun name=vm_lun_reserved_container1 pool_id=0 capacity=400GB lun_type=thick owner_controller=0B Command executed successfully.
- Create two LUN groups.
Run the following command to create two LUN groups vm_lg_reserved_container0 and vm_lg_reserved_container1 and add the two LUNs to the LUN groups.
create lun_group name=? lun_name_list=?
[Example]
admin:/>create lun_group name=vm_lg_reserved_container0 lun_name_list=vm_lun_reserved_container0 Create LUN group successfully. Add LUN vm_lun_reserved_container0 to LUN group successfully. admin:/>create lun_group name=vm_lg_reserved_container1 lun_name_list=vm_lun_reserved_container1 Create LUN group successfully. Add LUN vm_lun_reserved_container1 to LUN group successfully.
- Create two hosts.
Run the following command to create two hosts vm_host_reserved_container0 and vm_host_reserved_container1 and set the host OS to Linux.
create host name=? operating_system=?
[Example]
admin:/>create host name=vm_host_reserved_container0 operating_system=Linux CAUTION: 1. Before performing this operation, confirm that the operating system type of the host to be created is the same as that of the service host. 2. If the operating system of the service host is Windows, and all thin LUN functions are required to get better experience, select Windows Server 2012. Suggestion: Confirm again that the correct operating system type has been specified. Do you wish to continue?(y/n)y Command executed successfully. admin:/>create host name=vm_host_reserved_container1 operating_system=Linux CAUTION: 1. Before performing this operation, confirm that the operating system type of the host to be created is the same as that of the service host. 2. If the operating system of the service host is Windows, and all thin LUN functions are required to get better experience, select Windows Server 2012. Suggestion: Confirm again that the correct operating system type has been specified. Do you wish to continue?(y/n)y Command executed successfully.
- Add the initiators to the two created hosts.
Query the WWNs of the vHBA initiators and add the initiators to the two created hosts.
The commands are as follows:
- Run the show vhba general command to query the WWNs of the vHBA initiators.
- Run the add host vhost_initiator host_name=? wwn=? command to add an initiator to a host.
- Run the show vhost_initiator general command to query the VHOST initiator information about the host.
[Example]
admin:/>show vhba general Work Container ID Owner Container ID VHBA WWN ----------------- ------------------ ---------------- 0 0 21007817be0c1dac 1 1 21017817be0c1dac admin:/>add host vhost_initiator host_name=vm_host_reserved_container0 wwn=21007817be0c1dac DANGER: You are about to add initiator to host. Suggestion: Before performing this operation, determine whether the initiator that you have selected belongs to the host. Have you read danger alert message carefully?(y/n)y Are you sure you really want to perform the operation?(y/n)y Command executed successfully. admin:/>add host vhost_initiator host_name=vm_host_reserved_container1 wwn=21017817be0c1dac DANGER: You are about to add initiator to host. Suggestion: Before performing this operation, determine whether the initiator that you have selected belongs to the host. Have you read danger alert message carefully?(y/n)y Are you sure you really want to perform the operation?(y/n)y Command executed successfully. admin:/> admin:/>show vhost_initiator general WWN Running Status Free Alias Host ID ---------------- -------------- ---- ----- ------- 21007817be0c1dac Online No -- 7 21017817be0c1dac Online No -- 8
Add the initiator whose WWN starts with 2100 to host vm_host_reserved_container0.
Add the initiator whose WWN starts with 2101 to host vm_host_reserved_container1.
- Create two host groups.
Run the following command to create two host groups vm_hg_reserved_container0 and vm_hg_reserved_container1 and add the two created hosts to the host groups.
create host_group name=? host_name_list=?
[Example]
admin:/>create host_group name=vm_hg_reserved_container0 host_name_list=vm_host_reserved_container0 Create host group successfully. Add host vm_host_reserved_container0 to host group successfully. admin:/>create host_group name=vm_hg_reserved_container1 host_name_list=vm_host_reserved_container1 Create host group successfully. Add host vm_host_reserved_container1 to host group successfully.
- Create two mapping views.
Run the following command to create mapping views vm_mv_reserved_container0 and vm_mv_reserved_container1.
create mapping_view name=? lun_group_name=? host_group_name=?
[Example]
admin:/>create mapping_view name=vm_mv_reserved_container0 lun_group_name=vm_lg_reserved_container0 host_group_name=vm_hg_reserved_container0 DANGER: You are about to map all LUNs in the LUN group to all hosts in the host group. If the host group contains multiple hosts but mutual access exclusion is not properly configured, multiple service hosts may write data to the same LUN, causing data damage or inconsistency. Suggestion: Before you perform this operation, ensure that mutual access exclusion has been correctly configured on service hosts. Have you read danger alert message carefully?(y/n)y Are you sure you really want to perform the operation?(y/n)y Create mapping view successfully. Add host group 3 to mapping view successfully. Add LUN group vm_lg_reserved_container0 to mapping view successfully. admin:/>create mapping_view name=vm_mv_reserved_container1 lun_group_name=vm_lg_reserved_container1 host_group_name=vm_hg_reserved_container1 DANGER: You are about to map all LUNs in the LUN group to all hosts in the host group. If the host group contains multiple hosts but mutual access exclusion is not properly configured, multiple service hosts may write data to the same LUN, causing data damage or inconsistency. Suggestion: Before you perform this operation, ensure that mutual access exclusion has been correctly configured on service hosts. Have you read danger alert message carefully?(y/n)y Are you sure you really want to perform the operation?(y/n)y Create mapping view successfully. Add host group 4 to mapping view successfully. Add LUN group vm_lg_reserved_container1 to mapping view successfully.
A mapping view can only be created between a LUN group and its corresponding controller's host group. For example, it can only be created between a LUN of controller A and the host whose VHBA WWN corresponds to controller A.
- Scan the block device information in the specified container.
The commands are as follows:
- Run the show vm_container general command to query VM container information.
- Run the scan virtual_machine block owner_container_id=? command to scan the block device information in the container.
In the command, the value of the owner_container_id field is the same as the value of the VM Container ID field in the output of the show vm_container general command.
[Example]
admin:/>show vm_container general VM Container ID Owner Controller ID Health Status Total Memory Free Memory CPU Isolate Enable CPU Counts Available CPU Counts --------------- ------------------- ------------- ------------ ----------- ------------------ ---------- -------------------- 0 0A Normal 32.000GB 32.000GB Yes 10 -- 1 0B Normal 32.000GB 32.000GB Yes 10 -- admin:/>scan virtual_machine block owner_container_id=0 Command executed successfully. admin:/>scan virtual_machine block owner_container_id=1 Command executed successfully.
The memory and number of CPU cores in the command output vary depending on the device specifications.
- Create two VM file systems.
The commands are as follows:
- Run the show virtual_machine block command to query information about block devices in current system.
- Run the change user_mode current_mode user_mode=developer command to switch to the developer view.
- Run the create vm_fs general block_id=? container_id=? command to create a VM file system.
In the command, block_id indicates the ID of the block device used to create the VM file system, and you can obtain its value from the output of the show virtual_machine block command. container_id indicates the ID of the specified VM container, and its value is the same as that of VM Container ID in the output of the show vm_container general command.
[Example]
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 400.000GB DATA 67817be1000c1dac0289e70f00000111 1 Normal Online 1 400.000GB DATA 67817be1000c1dac028a8d9400000112 admin:/>change user_mode current_mode user_mode=developer DANGER: You are about to switch to the developer view. Commands in this view must be run under the guidance of R&D engineers. You can choose whether to run this command. If you run this command to switch to the developer view, it means that you know risks of running commands in the developer view. Device vendors are not responsible for any loss or damage caused to the user or others by running commands in the developer view. 1. Running the command in the developer view may cause system reset, restart, offline, service interruption, data loss, and data inconsistency. 2. Running the command in the developer view may cause the performance to decrease. 3. Running the command in the developer view to delete or remove configurations may have impact on the service and data. 4. Running the command in the developer view may cause system alarms. Suggestion: Run this command under the guidance of R&D engineers. Have you read danger alert message carefully?(y/n)y Are you sure you really want to perform the operation?(y/n)y developer:/>create vm_fs general block_id=0 container_id=0 Command executed successfully. developer:/>create vm_fs general block_id=1 container_id=1 Command executed successfully.
- Check whether the VM file system is successfully configured.
The commands are as follows:
- Run the show vm_fs general command to check whether the VM file system is successfully created.
- Run the show virtual_machine block command to check whether Use Mode of the block device is SYSTEM.
[Example]
admin:/>show vm_fs general ID Block ID Health Status Running Status Work VM_Container ID Owner VM_Container ID -- -------- ------------- -------------- -------------------- --------------------- 0 0 Normal Mount 0 0 1 1 Normal Mount 1 1 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 400.000GB SYSTEM 67817be1000c1dac0289e70f00000111 1 Normal Online 1 400.000GB SYSTEM 67817be1000c1dac028a8d9400000112
After the preceding initial configurations are complete, install a VM and add service ports and block devices for the VM by referring to section "Configuring a VM".