A method, system, terminal and storage medium for rapidly deploying OVA images
By converting the OVA image file into a VMX image file, and automatically obtaining and verifying the host information, establishing a connection between the virtual machine and the host, the cumbersome and complex problem of the installation of OVA image in the existing technology is solved, and a rapid and simplified installation process is achieved, improving the user experience.
Patent Information
- Application Number
- CN202111265835.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-10-28
- Publication Date
- 2025-05-16
- Estimated Expiration
- 2041-10-28
AI Technical Summary
In the prior art, the installation of OVA images in the workstation requires manual import, which is complicated and complicated, which can easily lead to configuration errors and affect the normal operation of the system. Especially for ordinary users, it is difficult and time-consuming to operate.
By converting OVA image files into VMX image files, the initial information of the host is automatically obtained and verified, including hardware configuration, IP address and gateway, and establish verification and business connections between the virtual machine and the host in bridge mode, simplifying the user's operation process.
It greatly simplifies the user's operation process, reduces installation time, improves user experience, and avoids installation failure problems caused by manual configuration errors.
Smart Images

Figure CN114035811B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a method, system, terminal and storage medium for rapidly deploying an OVA image. Background Art
[0002] With the continuous development of the Internet world, the environment in which vendors provide services is becoming increasingly complex. Each service may involve different middleware. Even if installation documentation is provided, the installation process is still relatively cumbersome and complicated for users. If one of the links is misconfigured, the entire system will not operate normally, affecting the customer experience.
[0003] At present, the installation of OVA images on workstations is done by manual import. After the image is successfully imported, network-related configurations are performed to access it. If the Linux system is installed in the virtual machine, the operation will be more complicated, causing more trouble for users.
[0004] Regarding the above-mentioned related technologies, the inventor believes that manual import requires users to be familiar with the product features of the workstation, while most ordinary users just want to use related services and do not want to be involved in too much configuration or waste time. Therefore, a method is urgently needed to simplify the user's operation process. Summary of the invention
[0005] In order to simplify the user's operation process, the present application provides a method, system, terminal and storage medium for quickly deploying missed scan OVA.
[0006] In a first aspect, the present application provides a method for rapidly deploying an OVA image, using the following technical solution:
[0007] A method for quickly deploying an OVA image includes the following steps:
[0008] Convert the OVA image file into a VMX image file, and start a virtual machine based on the VMX image file, wherein the virtual machine is configured with a first network card and a second network card;
[0009] The user's computer is used as a host machine, the host machine is configured with a host network card, the initial information of the host machine is obtained, and it is verified that the initial information meets the operating conditions. The initial information includes the hardware configuration, the host gateway of the host network card, and the host IP address. The host IP address includes a verification IP address and a service IP address;
[0010] Establishing a verification connection between the host network card and the first network card based on the bridge mode, and detecting the verification connection to obtain a detection result;
[0011] A service connection is established between the host network card and the second network card based on the detection result and the service IP address.
[0012] By adopting the above technical solution, the OVA image file is converted into a VMX image file in advance, which reduces the conversion time during the user's installation process; the user's computer hardware configuration, host IP address and host gateway are automatically obtained and verified, which reduces the time for users to find information on their own; the connection between the virtual machine and the host is automatically verified during the installation process. The settings of this application greatly simplify the user's operation process and improve the user's experience.
[0013] Optionally, starting the virtual machine based on the VMX image file includes the following steps:
[0014] Find the installation directory of VMware workstation and obtain the default storage directory of the virtual machine;
[0015] Put the VMX image file into the default storage directory of the virtual machine;
[0016] Call the vmrun command to import and start the virtual machine.
[0017] Optionally, obtaining initial information of the host machine and verifying that the initial information meets the operating conditions includes the following steps:
[0018] Obtain the hardware configuration of the host machine, verify the hardware configuration, generate a prompt if the hardware configuration does not meet the installation conditions, and obtain the host machine IP address and host machine gateway if the hardware configuration meets the installation conditions;
[0019] Verify the verification IP address, the business IP address and the host gateway information. If the verification IP address and the business IP address are both connectable, execute the next step. If the verification IP address and / or the business IP address cannot be connected, make adjustments until the verification IP address and the business IP address are both connectable.
[0020] By adopting the above technical solution, the initial information of the host machine is verified, which reduces the time for users to find installation conditions before installation and avoids the problem of installation failure due to host machine configuration problems during the installation process.
[0021] Optionally, establishing a verification connection between the host network card and the first network card based on the bridge mode, and performing a detection to obtain a detection result comprises the following steps:
[0022] Set the host network card, the first network card and the second network card to bridge mode, and set the gateway of the second network card to be the same as the host gateway;
[0023] Configuring a first IP address for the first network card based on the verification IP address;
[0024] Ping the first IP address in the local area network according to the verification IP address;
[0025] If the host machine fails to ping the first IP address of the virtual machine, the first IP address of the virtual machine is checked, and the ping command is executed cyclically until the host machine pings the first IP address of the virtual machine;
[0026] If the host machine can ping the first IP address of the virtual machine, it is determined that a verification connection has been established between the host machine network card and the first network card.
[0027] By adopting the above technical solution, the first IP address is configured according to the verification IP address, which ensures the connectivity of subsequent verification connections and reduces the process and time of user self-configuration.
[0028] Optionally, configuring the first IP address for the first network card based on the verification IP address includes the following steps:
[0029] The host machine executes a ping command in the local area network where the host machine is located according to the verification IP address, and pings the IP addresses in the same network segment in sequence;
[0030] The first IP address that cannot be pinged is obtained, and is configured as the first IP address of the virtual machine.
[0031] By adopting the above technical solution, the first IP address and the verification IP address are in the same network segment, thereby ensuring the stability of the connection between the first IP address and the verification IP address.
[0032] Optionally, establishing a service connection between the host network card and the second network card based on the detection result and the service IP address includes the following steps:
[0033] Based on the service IP address, configure a second IP address and a gateway of the host machine for the virtual machine;
[0034] A service connection is established between the host machine and the virtual machine based on the service IP address and the second IP address.
[0035] By adopting the above technical solution, a service connection between the host machine and the virtual machine is established according to the second IP address and the service IP address, so that the user can realize the service connection between the host machine and the virtual machine, so that the virtual machine can access the user's service network.
[0036] In the second aspect, the present application discloses a system for fast step OVA image, which adopts the following technical solution:
[0037] A system for rapidly deploying an OVA image, comprising:
[0038] A preprocessing module, the preprocessing module is used to convert the OVA image file into a VMX image file, start the virtual machine based on the VMX image file, and configure the first network card and the second network card for the virtual machine;
[0039] A detection module, the detection module is used to obtain initial information of the host machine and detect the initial information;
[0040] a first connection module, the first connection module is used to establish a verification connection between the host machine and the virtual machine, and verify the connection between the host machine and the virtual machine, and output a verification result,
[0041] and a second connection module, wherein the second connection module is used to establish a service connection between the host machine and the virtual machine based on the verification result.
[0042] By adopting the above technical solution, the pre-processing module converts the OVA image file into a VMX image file in advance, reducing the time for users to import virtual machines. The detection module automatically detects the initial information of the user's computer to ensure that the user's computer meets the installation conditions for virtual machine installation. During installation, the first connection module establishes a verification connection, and after installation, the second connection module establishes a business connection between the host and the virtual machine. The setting of this application can effectively simplify the user's operating process and shorten the installation time of the OVA image file.
[0043] Optionally, the first connection module includes:
[0044] A first configuration unit, wherein the first configuration unit is used to configure a first IP address for the virtual machine;
[0045] A first connection unit, the first connection unit is used to establish a verification connection between the virtual machine and the host machine based on a bridge mode;
[0046] and a verification unit, which verifies the verification connection between the virtual machine and the host machine and outputs a verification result.
[0047] In a third aspect, the present application provides a terminal device, which adopts the following technical solution:
[0048] A terminal device comprises a memory, a processor and a computer program stored in the memory and capable of running on the processor. When the processor loads and executes the computer program, the method for rapidly deploying an OVA image is adopted.
[0049] By adopting the above technical solution, the above method of quickly deploying OVA images is generated into a computer program and stored in a memory so as to be loaded and executed by a processor, thereby making a terminal device based on the memory and the processor for easy use.
[0050] In a fourth aspect, the present application provides a computer-readable storage medium, which adopts the following technical solution:
[0051] A computer-readable storage medium stores a computer program, and when the computer program is loaded and executed by a processor, the method for rapidly deploying an OVA image is adopted.
[0052] By adopting the above technical solution, the above method of quickly deploying OVA images is generated into a computer program and stored in a computer-readable storage medium so as to be loaded and executed by a processor. The computer-readable storage medium facilitates the reading and storage of the computer program. BRIEF DESCRIPTION OF THE DRAWINGS
[0053] Figure 1 It is a schematic diagram of the overall process structure of a method for quickly deploying an OVA image in an embodiment of the present application.
[0054] Figure 2 It is a schematic diagram of the flow structure of steps S201 to S203 in a method for quickly deploying an OVA image in an embodiment of the present application.
[0055] Figure 3 It is a schematic diagram of the process structure of step S301-step S302 in a method for quickly deploying an OVA image in an embodiment of the present application.
[0056] Figure 4 It is a flow structure diagram of steps S401 to S405 in a method for quickly deploying an OVA image in an embodiment of the present application.
[0057] Figure 5 It is a flow structure diagram of step S501 to step S502 in a method for quickly deploying an OVA image in an embodiment of the present application.
[0058] Figure 6It is a flow structure diagram of step S601 to step S602 in a method for quickly deploying an OVA image in an embodiment of the present application.
[0059] Figure 7 It is a schematic diagram of the overall module structure of a system for quickly deploying OVA images according to an embodiment of the present application.
[0060] Description of reference numerals:
[0061] 1. Preprocessing module; 11. Conversion unit; 12. Startup unit; 2. Detection module; 21. Acquisition unit; 22. Detection unit; 3. First connection unit; 31. First configuration unit; 32. First connection unit; 33. Verification unit; 4. Second connection module; 41. Second configuration unit; 42. Second connection unit. DETAILED DESCRIPTION
[0062] The following is combined with Figure 1-7 This application is described in further detail.
[0063] The present application embodiment discloses a method for rapidly deploying an OVA image. Figure 1 , including the following steps:
[0064] S101, converting the OVA image file into a VMX image file, starting a virtual machine based on the VMX image file, where the virtual machine is configured with a first network card and a second network card;
[0065] S102, taking the user's computer as a host, the host is configured with a host network card, obtaining initial information of the host, and verifying that the initial information meets the operating conditions, the initial information includes hardware configuration, host gateway information of the host network card, and host IP address, the host IP address includes a verification IP address and a service IP address;
[0066] S103, establishing a verification connection between the host network card and the first network card based on the bridge mode, and detecting the verification connection to obtain a detection result;
[0067] S104: Establish a service connection between the host network card and the second network card based on the detection result and the service IP address.
[0068] Among them, in step S101, before the virtual machine program is installed, the OVA image file is first converted into a VMX image file. When actually used, the file received by the user is a VMX image file. Under normal circumstances, the conversion of the OVA image file into the VMX image file is implemented during the import process of the virtual machine, which takes up the most installation time. This application saves the user's import and installation time by converting the OVA image file into the VMX image file in advance. When making the OVA image, the virtual machine is configured with a first network card and a second network card.
[0069] Specifically, use the Ovftool tool to convert the OVA image file into a VMX file. Ovftool is a tool developed by VMware. In the Windows system, the specific operations are as follows: open and run through the windows+R shortcut key, enter cmd and press Enter, switch to the directory where Ovftool is located, and run Ovftool.exe*.ova*.vmx to convert the .OVA image file in the directory into a .VMX image file.
[0070] Specifically, after converting the OVA image file to a VMX image file, the VMX image file can be used to import and start the virtual machine. Figure 2 Steps S201 to S203 in:
[0071] S201, find the installation directory of VMware workstation and obtain the default storage directory of the virtual machine;
[0072] S202, placing the VMX image file into the default storage directory of the virtual machine;
[0073] S203, calling the vmrun command to import and start the virtual machine.
[0074] VMware workstation is a powerful desktop virtual computer software that can help users virtualize a PC (virtual machine for short) and simulate a complete network environment. Virtualization can reduce the increase in the number of servers, simplify server management, and significantly improve server utilization, network flexibility and reliability.
[0075] In step S102, before installing the virtual machine on the user's computer, the initial information of the user's computer needs to be verified, and the user's computer is used as the host to ensure that the host's hardware configuration, host gateway information, and host IP address meet the installation conditions. Figure 3 Step S301-step S302 in:
[0076] S301, obtaining the hardware configuration of the host machine, verifying the hardware configuration, generating a prompt if the hardware configuration does not meet the installation conditions, and obtaining the host machine IP address and host machine gateway information if the hardware configuration meets the installation conditions;
[0077] S302, verify the verification IP address and the business IP address. If the verification IP address and the business IP address are both connectable, execute the next step. If the verification IP address and / or the business IP address are not connectable, make adjustments until the verification IP address and the business IP address are both connectable.
[0078] Specifically, in step 301, the hardware configuration of the host machine is obtained and verified. In this embodiment, the program monitors the hardware configuration of the host machine by executing the systeminfo command. If the hardware configuration of the host machine does not meet the standard, that is, it cannot meet the installation conditions for installing the virtual machine, a prompt is issued to the user, and the minimum configuration requirements that meet the installation conditions are given, so that the user can adjust the hardware configuration.
[0079] Specifically, in step S302, the host machine IP address and the host machine gateway are obtained. In this embodiment, in order to protect the reliability of information transmission, the host machine IP address includes a verification IP address and a business IP address. The verification IP address is used to verify the connection between the host machine and the virtual machine, and the business IP address is used for business transmission between the host machine and the virtual machine. Verifying that the host machine IP address and the virtual machine IP address can be connected to the local area network is a guarantee for subsequent installation and connection procedures.
[0080] Among them, in step S103, after detecting the initial information of the host machine and determining that the hardware configuration of the host machine, the host machine gateway and the host machine IP address all meet the installation conditions, it is necessary to establish a verification connection between the host machine and the virtual machine, that is, the host machine can log in to the virtual machine and verify the connectivity of the verification connection. After the verification is available, the service connection between the host machine and the virtual machine can be established. For details, refer to Figure 4 Steps S401 to S405 in:
[0081] S401, setting the host network card, the first network card and the second network card to bridge mode;
[0082] S402, configuring a first IP address for the first network card based on the verified IP address;
[0083] S403, the host machine pings the first IP address in the local area network according to the verification IP address;
[0084] S404, if the host machine cannot ping the first IP address of the virtual machine, check the first IP address of the virtual machine and execute the ping command in a loop until the host machine pings the first IP address of the virtual machine;
[0085] S405: If the host machine can ping the first IP address of the virtual machine, it is determined that a connection has been established between the host machine network card and the first network card.
[0086] The main ways for a virtual machine to access a network are NAT and bridging. In order to prevent users from being exposed to too many technical terms and to avoid too many choices, the way for a virtual machine to access a network introduced in this application is bridging mode. The NAT setting mode is basically the same, but the way the network is implemented inside the virtual machine is slightly different. No matter which method is selected, it does not affect the implementation of the present invention. For the convenience of introduction, this application takes the bridging mode as an example.
[0087] Specifically, in step S401, the first network card, the second network card and the host network card are all set to bridge mode, so that the host network card and the first network card are bridged, and the host network card and the second network card are bridged. At the same time, the gateway of the second network card is set to be the same as the host gateway, so that the host network card and the first network card are in the same network segment, and the host network card and the second network card are in the same network segment.
[0088] Specifically, in step S402, after obtaining the initial information of the host machine, the first IP address is obtained according to the verification IP address of the host machine. Figure 5 Step S501-step S502 in:
[0089] S501, the host executes a ping command in the local area network where the host is located according to the verification IP address, and pings the IP addresses in the same network segment in sequence;
[0090] S502: Obtain the first IP address that cannot be pinged, and configure it as the first IP address of the virtual machine.
[0091] Specifically, when the virtual machine enters the IP interface, it will generate an available IP as the first IP address of the first network card. For example, the verification IP address of the host machine is 172.168.5.2. Taking the Windows operating system as an example, open the run command with the windows+R shortcut key, enter cmd and press Enter to open the command prompt, and then enter ping 192.168.5.N to perform the ping operation. The first IP that cannot be pinged is taken as the first IP address of the virtual machine. If the ping fails, it means that the IP is not occupied and the virtual machine can use it. If the IP: 172.168.5.1 cannot be pinged, it will be used as the first IP address of the virtual machine, that is, the first IP address of the first network card is: 172.168.5.1. Of course, users can also set the first IP address according to their needs during actual use.
[0092] Specifically, in step S403, after configuring the first IP address of the first network card as 172.168.5.1, it is necessary to verify the connection between the verification IP address and the first IP address. The verification method is to use the ping command in the command line of the host machine. The ping command is written as: ping 192.168.5.1. Taking the Windows operating system as an example, press the windows+R shortcut key to open the run, enter cmd and press Enter to open the command prompt, and then enter ping 192.168.5.1 to perform the ping operation.
[0093] Specifically, in step S404-step S405, if the host machine cannot ping the first IP address, then check whether the bridge mode of the first network card and the first IP address are set successfully. After determining that the bridge mode is correct and the first IP address is configured correctly, continue to loop and execute the ping command: ping 192.168.5.1 until it is pinged. If the host machine can ping the first IP address, it is determined that the verification IP address of the host machine has established a verification connection with the first IP address.
[0094] Among them, in step S104, when the host machine can ping the first IP address and determine that the verification IP address of the host machine can establish a verification connection with the first IP address, according to the known business IP address, it is necessary to configure a gateway and a second IP address for the virtual machine at this time, so as to establish a business connection between the host machine and the virtual machine. Figure 6 Step S601-step S602 in:
[0095] S601, configuring a second IP address and a gateway for the second network card based on the service IP address;
[0096] S602: Establish a service connection between the host machine and the virtual machine based on the service IP address and the second IP address.
[0097] Specifically, in step S601-step S602, the second network card is configured with the same gateway as the host machine gateway. The second network card is configured with a gateway because the business network that the second network card may access is in other network segments, such as accessing 192.168.20.1 or 192.168.30.1, etc., which requires a gateway. The first network card is used to establish a verification connection with the host network card, and only a connection needs to be established between the virtual machine and the host, so there is no need to set a gateway.
[0098] For example, if the service IP address of the host machine is known to be 192.168.1.1, a second IP address is configured for the virtual machine based on the service IP address. When the first IP address is known, the host machine can log in to the operating system of the virtual machine through the communication of the first network card, thereby configuring the second IP address of the second network card. For example, the second IP address is configured as: 192.168.1.2, the service IP of the host machine and the second IP address are in the same network segment, and since the host network card can establish a verification connection with the first network card, and a bridge has been established between the host network card and the second network card, it can be determined that the host network card can establish a service connection with the second network card, and the two IP addresses for establishing the service connection are the service IP address of the host machine and the second IP address of the second network card.
[0099] The implementation principle of a method for quickly deploying an OVA image in an embodiment of the present application is as follows: calling ovftool to convert the OVA image file into a VMX image file in advance, reducing the conversion time during the user's installation process, and automatically obtaining the user's computer hardware configuration, host machine IP address and host machine gateway, and verifying them. If the installation conditions are not met, a prompt is given, and the connection between the virtual machine and the host machine is automatically verified during the installation process. The setting of this application greatly simplifies the user's operation process and improves the user's experience.
[0100] The present application embodiment discloses a system for rapidly deploying an OVA image. Figure 7 ,include:
[0101] Preprocessing module 1, preprocessing module 1 is used to convert the OVA image file into a VMX image file, start the virtual machine based on the VMX image file, and configure the first network card and the second network card for the virtual machine;
[0102] Detection module 2, detection module 2 is used to obtain initial information of the host machine and detect the initial information;
[0103] The first connection module 3 is used to establish a verification connection between the host machine and the virtual machine, verify the connection between the host machine and the virtual machine, and output the verification result.
[0104] And a second connection module 4, the second connection module 4 is used to establish a service connection between the host machine and the virtual machine based on the verification result.
[0105] The preprocessing module 1 includes a conversion unit 11 and a startup unit 12. The conversion unit 11 is used to convert an OVA image file into a VMX image file, in which a first network card and a second network card are configured for a virtual machine. The startup unit 12 is used to import and start a virtual machine based on the VMX image file.
[0106] Specifically, the conversion unit 11 converts the OVA image file into a VMX file through the Ovftool tool. Ovftool is a tool developed by VMware. In the Windows system, the specific operations are as follows: open and run through the windows+R shortcut key, enter cmd and press Enter, switch to the directory where Ovftool is located, and run Ovftool.exe*.ova*.vmx to convert the .OVA image file in the directory into a .VMX image file.
[0107] Specifically, the startup unit 12 finds the installation directory of VMware workstation and obtains the default storage directory of the virtual machine, then puts the VMX image file into the default storage directory of the virtual machine, and calls the vmrun command to import and start the virtual machine.
[0108] VMware workstation is a powerful desktop virtual computer software that can help users virtualize a PC (virtual machine for short) and simulate a complete network environment. Virtualization can reduce the increase in the number of servers, simplify server management, and significantly improve server utilization, network flexibility and reliability.
[0109] The detection module 2 includes an acquisition unit 21 and a detection unit 22. The acquisition unit 21 is used to acquire the initial information of the host, and the initial information includes the hardware configuration, the host gateway of the host network card, and the host IP address. The detection unit 22 is used to detect the hardware configuration, the host gateway of the host network card, and the host IP address, and determine whether the hardware configuration, the host gateway of the host network card, and the host IP address meet the installation conditions.
[0110] Specifically, the acquisition unit 21 acquires the hardware configuration of the host machine, and the detection unit 22 verifies the hardware configuration of the host machine. In this embodiment, the acquisition unit 21 monitors the hardware configuration of the host machine by executing the systeminfo program command. If the detection unit 22 detects that the hardware configuration of the host machine does not meet the standard, that is, it cannot meet the installation conditions for installing the virtual machine, it will issue a prompt to the user and provide the minimum configuration requirements that meet the installation conditions, so that the user can adjust the hardware configuration.
[0111] Specifically, the acquisition unit 21 acquires the host machine IP address and the host machine gateway. In this embodiment, in order to protect the reliability of information transmission, the host machine IP address includes a verification IP address and a business IP address. The verification IP address is used to verify the connection between the host machine and the virtual machine, and the business IP address is used for business transmission between the host machine and the virtual machine. The detection unit 22 is used to detect the connectivity of the host machine IP address to ensure the subsequent installation and connection procedures.
[0112] The first connection module 3 includes a first configuration unit 31, a first connection unit 32 and a verification unit 33. The first configuration unit 31 configures a first IP address for the first network card according to the verification IP address of the host. The first connection unit 32 establishes a verification connection between the host network card and the first network card based on the verification IP address and the first IP address. The verification unit 33 is used to detect whether the verification connection between the host network card and the first network card is available.
[0113] Specifically, the ways in which a virtual machine accesses a network are mainly NAT and bridging. In order to prevent users from being exposed to too many technical terms and to avoid too many choices, the way in which a virtual machine accesses a network introduced in this application is bridging mode. The NAT setting mode is basically the same, except that the way in which the network is implemented inside the virtual machine is slightly different. No matter which mode is selected, it does not affect the implementation of the present invention. For the convenience of introduction, this application takes the bridging mode as an example.
[0114] Specifically, the first configuration unit 31 sets the first network card, the second network card and the host network card to the bridge mode, so that the host network card and the first network card are bridged, and the host network card and the second network card are bridged. At the same time, the gateway of the second network card is set to be the same as the host gateway, so that the host network card and the first network card are in the same network segment, and the host network card and the second network card are in the same network segment.
[0115] Specifically, when the virtual machine enters the IP interface, the first configuration unit 31 will automatically generate an available IP as the first IP address of the first network card based on the verification IP address. For example, the verification IP address of the host machine is 172.168.5.2. Taking the Windows operating system as an example, open the run by pressing the windows+R shortcut key, enter cmd and press Enter to open the command prompt, and then enter ping 192.168.5.N to perform the ping operation, and take the first IP that cannot be pinged as the first IP address of the virtual machine. If the ping fails, it means that the IP is not occupied and the virtual machine can use it. If IP: 172.168.5.1 cannot be pinged, it will be used as the first IP address of the virtual machine, that is, the first IP address of the first network card is: 172.168.5.1. Of course, the user can also set the first IP address according to their needs during actual use.
[0116] Specifically, the first connection unit 32 enables the host network card and the first network card to establish a verification connection, and the verification unit 33 detects the connection. For example, the verification unit 33 uses the ping command in the command line of the host machine. The ping command is written as: ping 192.168.5.1. Taking the Windows operating system as an example, the windows+R shortcut key is used to open the run, enter cmd and press Enter to open the command prompt, and then enter ping 192.168.5.1 to perform the ping operation. If the verification unit 33 fails to ping the first IP address, the gateway and the first IP address of the first network card of the virtual machine are checked to determine that the bridging mode and the first IP address of the first network card are correctly configured, and the ping command is continued to be executed in a loop: ping 192.168.5.1 until it is pinged. If the host machine can ping the first IP address, it is determined that the verification IP address of the host machine has established a verification connection with the first IP address.
[0117] Among them, the second connection module 4 includes a second configuration unit 41 and a second connection unit 42. The second configuration unit 41 configures a second IP address for the second network card according to the service IP address of the host machine. The second connection unit 42 is used to establish a business connection between the host machine network card and the second network card through the service IP address and the second IP address, that is, a connection between the host machine and the virtual machine, for user business information transmission.
[0118] Specifically, the second configuration unit configures the second network card with the same gateway as the host machine gateway. The second network card is configured with a gateway because the business network that the second network card may access is in other network segments, such as accessing 192.168.20.1 or 192.168.30.1, etc., which requires a gateway. The first network card is used to establish a verification connection with the host network card, and only a connection needs to be established between the virtual machine and the host, so there is no need to set a gateway.
[0119] Specifically, when the first IP address is known, the host can log in to the operating system of the virtual machine through the communication of the first network card, thereby configuring the second IP address of the second network card. For example, it is known that the service IP address of the host is 192.168.1.1, and the second IP address is configured as: 192.168.1.2. The service IP of the host and the second IP address are in the same network segment. Since the host network card can establish a verification connection with the first network card, and a bridge has been established between the host network card and the second network card, it can be determined that the host network card can establish a service connection with the second network card. The two IP addresses for establishing the service connection are the service IP address of the host and the second IP address of the second network card.
[0120] The implementation principle of a system for rapidly deploying an OVA image in an embodiment of the present application is as follows: the OVA image file is converted into a VMX image file in advance by a preprocessing module 1, which reduces the time for the user to import a virtual machine; the detection module 2 automatically detects the initial information of the user's computer to ensure that the user's computer meets the installation conditions for installing the virtual machine; during installation, the first connection module 3 selects a suitable first IP address for the user to log in to the virtual machine and establishes a verification connection; after installation, the second connection module 4 configures a second IP address and establishes a business connection between the host machine and the virtual machine. The settings of the present application can effectively simplify the user's operating process and shorten the installation time of the OVA image file.
[0121] An embodiment of the present application further discloses a terminal device, including a memory, a processor, and a computer program stored in the memory and capable of running on the processor, wherein when the processor executes the computer program, the method for rapidly deploying an OVA image in the above embodiment is adopted.
[0122] The terminal device may be a computer device such as a desktop computer, a laptop computer or a cloud server, and the terminal device includes but is not limited to a processor and a memory. For example, the terminal device may also include input and output devices, a network access device and a bus.
[0123] Among them, the processor can adopt a central processing unit (CPU). Of course, according to actual usage, other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. can also be adopted. The general-purpose processor can adopt a microprocessor or any conventional processor, etc., and this application does not impose any restrictions on this.
[0124] Among them, the memory can be an internal storage unit of the terminal device, such as a hard disk or memory of the terminal device, or it can be an external storage device of the terminal device, such as a plug-in hard disk, a smart memory card (SMC), a secure digital card (SD) or a flash memory card (FC) equipped on the terminal device, and the memory can also be a combination of an internal storage unit and an external storage device of the terminal device. The memory is used to store computer programs and other programs and data required by the terminal device. The memory can also be used to temporarily store data that has been output or is to be output, and this application does not impose any restrictions on this.
[0125] Among them, through this terminal device, the method for quickly deploying the OVA image in the above embodiment is stored in the memory of the terminal device, and is loaded and executed on the processor of the terminal device, which is convenient for use.
[0126] The embodiment of the present application further discloses a computer-readable storage medium, and the computer-readable storage medium stores a computer program, wherein when the computer program is executed by a processor, the method for rapidly deploying an OVA image in the above embodiment is adopted.
[0127] Among them, the computer program can be stored in a computer-readable medium, the computer program includes computer program code, the computer program code can be in the form of source code, object code, executable file or certain middleware, etc. The computer-readable medium includes any entity or device that can carry the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signal, telecommunication signal and software distribution medium, etc. It should be noted that the computer-readable medium includes but is not limited to the above-mentioned components.
[0128] Among them, through this computer-readable storage medium, the method for quickly deploying an OVA image in the above embodiment is stored in a computer-readable storage medium, and is loaded and executed on a processor to facilitate the storage and application of the above method.
[0129] The above are all preferred embodiments of the present application, and the protection scope of the present application is not limited thereto. Therefore, any equivalent changes made according to the structure, shape, and principle of the present application should be included in the protection scope of the present application.
Claims
1. A method for rapidly deploying an OVA image, characterized in that: The following steps are involved: Convert the OVA image file to a VMX image file, start a virtual machine based on the VMX image file, the virtual machine is configured with a first network card and a second network card; use the user's computer as a host machine, the host machine is configured with a host network card, obtain initial information of the host machine, and verify that the initial information meets the operating conditions, the initial information includes hardware configuration, the host gateway of the host network card, and the host IP address, the host IP address includes a verification IP address and a service IP address; A verification connection is established between the host network card and the first network card based on the bridge mode, and the verification connection is tested to obtain a test result; a service connection is established between the host network card and the second network card based on the test result and the service IP address.
2. A method for rapidly deploying an OVA image according to claim 1, characterized in that: The method of starting a virtual machine based on the VMX image file includes the following steps: finding the installation directory of VMware workstation and obtaining the default storage directory of the virtual machine; placing the VMX image file in the default storage directory of the virtual machine; and calling the vmrun command to import and start the virtual machine.
3. A method for rapidly deploying an OVA image according to claim 2, characterized in that: The method of obtaining the initial information of the host machine and verifying that the initial information meets the operating conditions includes the following steps: obtaining the hardware configuration of the host machine and verifying the hardware configuration. If the hardware configuration cannot meet the installation conditions, a prompt is generated. If the hardware configuration meets the installation conditions, the host IP address and the host gateway are obtained; verifying the verification IP address and the business IP address. If the verification IP address and the business IP address are both connectable, the next step is executed. If the verification IP address and / or the business IP address are not connectable, adjustments are made until the verification IP address and the business IP address are both connectable.
4. A method for rapidly deploying an OVA image according to claim 3, characterized in that: The method of establishing a verification connection between the host network card and the first network card based on the bridging mode and performing detection to obtain the detection result includes the following steps: setting the host network card, the first network card and the second network card to bridging mode; configuring a first IP address for the first network card based on the verification IP address; pinging the first IP address in the local area network according to the verification IP address; if the host machine cannot ping the first IP address of the virtual machine, checking the first IP address of the virtual machine and executing the ping command in a loop until the host machine pings the first IP address of the virtual machine; if the host machine can ping the first IP address of the virtual machine, determining that a verification connection has been established between the host network card and the first network card.
5. A method for rapidly deploying an OVA image according to claim 4, characterized in that: Configuring the first IP address for the first network card based on the verification IP address includes the following steps: the host machine executes a ping command in the local area network where the host machine is located according to the verification IP address, and pings the IP addresses in the same network segment in turn; obtains the first IP address that cannot be pinged, and configures it as the first IP address of the virtual machine.
6. A method for rapidly deploying an OVA image according to claim 4, characterized in that: The establishing of a service connection between the host network card and the second network card based on the detection result and the service IP address includes the following steps: configuring a second IP address and a gateway for the second network card based on the service IP address; establishing a service connection between the host and the virtual machine based on the service IP address and the second IP address.
7. A system for rapidly deploying OVA images, characterized in that: The user computer is used as a host machine. The system comprises: a preprocessing module (1), a detection module (2), a first connection module (3) and a second connection module (4). The preprocessing module (1) is used to convert an OVA image file into a VMX image file, and start a virtual machine based on the VMX image file, and configure a first network card and a second network card for the virtual machine; the detection module (2) comprises an acquisition unit (21) and a detection unit (22). The acquisition unit (21) is used to acquire initial information of the host machine, and the initial information includes hardware configuration, a host gateway of the host network card and a host IP address; the detection unit (22) is used to detect the hardware configuration, the host gateway of the host network card and the host IP address, and determine whether the hardware configuration, the host gateway of the host network card and the host IP address meet the installation conditions; the first connection module (3), the first connection module (3) is used to establish a verification connection between the host machine and the virtual machine, and verify the connection between the host machine and the virtual machine, and output a verification result; the second connection module (4) is used to establish a service connection between the host machine and the virtual machine based on the verification result.
8. A system for rapidly deploying OVA images according to claim 7, characterized in that: The first connection module (3) includes: a first configuration unit (31), the first configuration unit (31) is used to configure a first IP address for the virtual machine; a first connection unit (32), the first connection unit is used to establish a verification connection between the virtual machine and the host machine based on a bridging mode; and a verification unit (33), the verification unit (33) verifies the verification connection between the virtual machine and the host machine and outputs a verification result.
9. A terminal device, comprising a memory, a processor, and a computer program stored in the memory and capable of running on the processor, characterized in that: When the processor loads and executes the computer program, the method according to any one of claims 1 to 6 is adopted.
10. A computer-readable storage medium having a computer program stored therein, characterized in that: When the computer program is loaded and executed by a processor, the method according to any one of claims 1 to 6 is adopted.
Citation Information
Patent Citations
OVA file import method and device
CN106886448A
Network load test method, device, equipment and medium
CN111404771A