No relevant resource is found in the selected language.

This site uses cookies. By continuing to browse the site you are agreeing to our use of cookies. Read our privacy policy>Search

Reminder

To have a better experience, please upgrade your IE browser.

upgrade
CLI-based Configuration Guide - Virtualization
AR500, AR510, AR531, AR550, AR1500, and AR2500 V200R009

This document provides the basic concepts, configuration procedures, and configuration examples in different application scenarios of the virtualization feature supported by the device.

Rate and give feedback:
Huawei uses machine translation combined with human proofreading to translate this document to different languages in order to help you better understand the content of this document. Note: Even the most advanced machine translation cannot match the quality of professional translators. Huawei shall not bear any responsibility for translation accuracy and it is recommended that you refer to the English document (a link for which has been provided).
How Do I Make a VM Installation Package Offline?

How Do I Make a VM Installation Package Offline?

You can make a VM installation package offline in a Linux system using the following methods:

Method 1: Make an .ova file that contains an .iso installation file and a blank disk file.
  1. Run the qemu-img create –f format filename size command to make a blank disk file.
    For example, run the qemu-img create –f qcow2 win7.img 10G command.
    Formatting 'win7.img', fmt=qcow2 size=10 encryption=off cluster_size=65536 lazy_refcounts=off
  2. Run the createova –d filename -li filename -c cpu-num -m size -s serial_number -ns nic-num -ea network-card-type -hwex extend-description command to make a VM installation package.
    For example, run the createova -d win7.img -li win7.iso -c 4 -m 256 -s 1 -ns 2 -ea virtio -hwex "-hdb /dev/external_disk -serial /dev/ttyS1" command.
    MSG: qcow2 image file find
    win7.ovf
    win7.img
    win7.iso
    pack /home/share/JSC/win7.ova success
    
Table 5-2  Description of parameters involved in method 1

Parameter

Description

Value

–f format

Specifies the format of a VM image file.

The qcow2 and raw formats are supported. The qcow2 format is recommended.

filename

Specifies the name of a VM image file.

The value is a string of 1 to 32 case-sensitive characters and consists of letters and digits.

size

Specifies the size of the disk space that can be used by a VM image file.

The value is an integer that ranges from 5 to 500, in GB.

–d filename

Specifies the name of the VM image file that is packaged to the .ova file.

The value is a string of 1 to 28 case-sensitive characters and consists of letters and digits.

-li filename

Specifies the name of the .iso file that is in the CD-ROM and packaged to the .ova file.

The value is a string of 1 to 32 case-sensitive characters and consists of letters and digits.

-c cpu-num

Specifies the number of simulated CPUs.

The value is an integer that ranges from 1 to 8.

-m size

Specifies the number of memories used by a VM.

The value is an integer that ranges from 256 to 8192.

-s serial_number

Specifies the number of simulated serial interfaces.

The value is an integer that ranges from 0 to 2.

-ns nic-num

Specifies the number of simulated NICs.

The value is an integer that ranges from 1 to 8.

-ea network-card-type

Specifies the network adapter type.

The network adapter types include:
  • e1000
  • rpl8139
  • virtio
A network adapter of the virtio type is recommended.

-hwex extend-description

Specifies the user-defined parameter extended description. User-defined parameters include supported audio and video, pluggable hard disk mounted to the VM, and serial interface for access.

The value is a character string. It is enclosed within double quotation marks (" "). The character string inside the double quotation marks does not support double quotation marks (" "), single quotation marks (' '), and escape characters (\). For example, the value can be "-hdb /dev/external_disk". The recommended values for user-defined parameters are as follows:
  • Audio and video: "-device pci-assign,host=0000:00:02.0,id=inteligd -gfx_passthru -device pci-assign,host=0000:00:1b.0 "
  • Hard disk: "-hdb /dev/external_disk"
  • Serial interface: "-serial /dev/ttyS1"
  • USB/Hub: " -device ehci,driver=ich9-usb-ehci1,addr=1c.0,multifunction=on,id=ehci -device uhci-1,driver=ich9-usb-uhci1,addr=1c.1,multifunction=on,masterbus=ehci.0,firstport=0 -device uhci-2,driver=ich9-usb-uhci2,addr=1c.2,multifunction=on,masterbus=ehci.0,firstport=2 -device uhci-3,driver=ich9-usb-uhci3,addr=1c.3,multifunction=on,masterbus=ehci.0,firstport=4 -device usb-host,hostbus=1,hostport=2,bus=ehci.0 -device usb-host,hostbus=1,hostport=2.1,bus=ehci.0 -device usb-host,hostbus=1,hostport=2.2,bus=ehci.0 -device usb-host,hostbus=1,hostport=2.3,bus=ehci.0 -device usb-host,hostbus=1,hostport=2.4,bus=ehci.0 -device ehci,driver=ich9-usb-ehci1,addr=1d.0,multifunction=on,id=ehci1 -device uhci-1,driver=ich9-usb-uhci1,addr=1d.1,multifunction=on,masterbus=ehci1.0,firstport=0 -device uhci-2,driver=ich9-usb-uhci2,addr=1d.2,multifunction=on,masterbus=ehci1.0,firstport=2 -device uhci-3,driver=ich9-usb-uhci3,addr=1d.3,multifunction=on,masterbus=ehci1.0,firstport=4 -device usb-host,hostbus=1,hostport=3,bus=ehci1.0 -device usb-host,hostbus=1,hostport=3.1,bus=ehci1.0 -device usb-host,hostbus=1,hostport=3.2,bus=ehci1.0 -device usb-host,hostbus=1,hostport=3.3,bus=ehci1.0 -device usb-host,hostbus=1,hostport=3.4,bus=ehci1.0 -device ehci,driver=ich9-usb-ehci1,addr=1e.0,multifunction=on,id=ehci2 -device uhci-1,driver=ich9-usb-uhci1,addr=1e.1,multifunction=on,masterbus=ehci2.0,firstport=0 -device uhci-2,driver=ich9-usb-uhci2,addr=1e.2,multifunction=on,masterbus=ehci2.0,firstport=2 -device uhci-3,driver=ich9-usb-uhci3,addr=1e.3,multifunction=on,masterbus=ehci2.0,firstport=4 -device usb-host,hostbus=1,hostport=1,bus=ehci2.0 -device usb-host,hostbus=1,hostport=1.1,bus=ehci2.0 -device usb-host,hostbus=1,hostport=1.2,bus=ehci2.0 -device usb-host,hostbus=1,hostport=1.3,bus=ehci2.0 -device usb-host,hostbus=1,hostport=1.4,bus=ehci2.0"

If both the hard disk and serial interface are supported, the value is "-hdb /dev/external_disk -serial /dev/ttyS1".

Method 2: Make an .ova file that contains the OS image.
  1. Run the qemu-img create –f format filename size command to make a blank disk file.
    For example, run the qemu-img create –f qcow2 win7.img 10G command.
    Formatting 'win7.img', fmt=qcow2 size=10 encryption=off cluster_size=65536 lazy_refcounts=off
  2. Run the qemu-system-x86_64-M pc --enable-kvm -m size -hda filename -cdrom iso_name -boot c -k en-us -smp cpu_number -usbdevice tablet command to install the OS image in the blank disk.
  3. Install the OS on the VM in the same way you install an OS on a PC.
  4. (Optional)Install the virtio drive program. Windows Server 2008 is used as an example.
    NOTE:

    If the VM runs Windows OS and virtio network adapters are used, perform this step. Download the latest Windows virtio drive program such as virtio-win-0.1-74.iso and store it in the same folder as the OS image.

    1. Run the sudo qemu-system-x86_64 –M pc -m memsize --enable-kvm -hda imgname -net nic,model=virtio,vlan=0,macaddr=00:e0:fc:00:00:01 -net tap,vlan=0,ifname=tap0,script=no -cdrom virtio-win-0.1-74.iso -usbdevice tablet -vga std -boot c command to start the VM that has Windows OS installed.
    2. Choose Start > Control Panel > HardWare > Device Manager.

      The Device Manager page is displayed.

    3. Choose Other devices > Ethernet Controller, right-click Ethernet Controller, and choose Update Driver Software from the shortcut menu.

      The Update Driver Software page is displayed.

    4. Click Browse my computer for driver software.
    5. Click Browse, select the drive program to be installed, and click OK.

      The Update Driver Software page is displayed.

    6. Click Next and OK to install the drive program.
    7. Click Close.
  5. Run the createova –d filename -c cpu-num -m size -s serial_number -ns nic-num -ea network-card-type -hwex extend-description command to make a VM installation package.
    For example, run the createova -d win7.img -c 4 -m 256 -s 1 -ns 2 -ea virtio -hwex "-hdb /dev/external_disk -serial /dev/ttyS1" command.
    MSG: qcow2 image file find
    win7.ovf
    win7.img
    win7.iso
    pack /home/share/JSC/win7.ova success
    
Table 5-3  Description of parameters involved in method 2

Parameter

Description

Value

–f format

Specifies the format of a VM image file.

The qcow2 and raw formats are supported. The qcow2 format is recommended.

filename

Specifies the name of a VM image file.

The value is a string of 1 to 32 case-sensitive characters and consists of letters and digits.

size

Specifies the size of the disk space that can be used by a VM image file.

The value is an integer that ranges from 5 to 500, in GB.

–m size

Specifies the number of memories used by a VM.

The value is an integer that ranges from 256 to 8192.

-hda filename

Specifies the name of a disk image file.

The value is a string of 1 to 28 case-sensitive characters and consists of letters and digits.

-cdrom iso_name

Specifies the name of an image file that is loaded in the simulated CD-ROM of a VM.

The value is a string of 1 to 32 case-sensitive characters and consists of letters and digits.

-smp cpu_number

Specifies the number of simulated CPUs.

The value is an integer that ranges from 1 to 8.

-m memsize

Specifies the number of memories used by a VM.

The value is an integer that ranges from 256 to 8192.

-hda imgname

Specifies the name of a disk image file.

The value is a string of 1 to 28 case-sensitive characters and consists of letters and digits.

–d filename

Specifies the name of the VM image file that is packaged to the .ova file.

The value is a string of 1 to 28 case-sensitive characters and consists of letters and digits.

-c cpu-num

Specifies the number of simulated CPUs.

The value is an integer that ranges from 1 to 8.

-m size

Specifies the number of memories used by a VM.

The value is an integer that ranges from 256 to 8192.

-s serial_number

Specifies the number of simulated serial interfaces.

The value is an integer that ranges from 0 to 2.

-ns nic-num

Specifies the number of simulated NICs.

The value is an integer that ranges from 1 to 8.

-ea network-card-type

Specifies the network adapter type.

The network adapter types include:
  • e1000
  • rpl8139
  • virtio
A network adapter of the virtio type is recommended.

-hwex extend-description

Specifies the user-defined parameter extended description. User-defined parameters include supported audio and video, pluggable hard disk mounted to the VM, and serial interface for access.

The value is a character string. It is enclosed within double quotation marks (" "). The character string inside the double quotation marks does not support double quotation marks (" "), single quotation marks (' '), and escape characters (\). For example, the value can be "-hdb /dev/external_disk". The recommended values for user-defined parameters are as follows:
  • Audio and video: "-device pci-assign,host=0000:00:02.0,id=inteligd -gfx_passthru -device pci-assign,host=0000:00:1b.0 "
  • Hard disk: "-hdb /dev/external_disk"
  • Serial interface: "-serial /dev/ttyS1"
  • USB/Hub: " -device ehci,driver=ich9-usb-ehci1,addr=1c.0,multifunction=on,id=ehci -device uhci-1,driver=ich9-usb-uhci1,addr=1c.1,multifunction=on,masterbus=ehci.0,firstport=0 -device uhci-2,driver=ich9-usb-uhci2,addr=1c.2,multifunction=on,masterbus=ehci.0,firstport=2 -device uhci-3,driver=ich9-usb-uhci3,addr=1c.3,multifunction=on,masterbus=ehci.0,firstport=4 -device usb-host,hostbus=1,hostport=2,bus=ehci.0 -device usb-host,hostbus=1,hostport=2.1,bus=ehci.0 -device usb-host,hostbus=1,hostport=2.2,bus=ehci.0 -device usb-host,hostbus=1,hostport=2.3,bus=ehci.0 -device usb-host,hostbus=1,hostport=2.4,bus=ehci.0 -device ehci,driver=ich9-usb-ehci1,addr=1d.0,multifunction=on,id=ehci1 -device uhci-1,driver=ich9-usb-uhci1,addr=1d.1,multifunction=on,masterbus=ehci1.0,firstport=0 -device uhci-2,driver=ich9-usb-uhci2,addr=1d.2,multifunction=on,masterbus=ehci1.0,firstport=2 -device uhci-3,driver=ich9-usb-uhci3,addr=1d.3,multifunction=on,masterbus=ehci1.0,firstport=4 -device usb-host,hostbus=1,hostport=3,bus=ehci1.0 -device usb-host,hostbus=1,hostport=3.1,bus=ehci1.0 -device usb-host,hostbus=1,hostport=3.2,bus=ehci1.0 -device usb-host,hostbus=1,hostport=3.3,bus=ehci1.0 -device usb-host,hostbus=1,hostport=3.4,bus=ehci1.0 -device ehci,driver=ich9-usb-ehci1,addr=1e.0,multifunction=on,id=ehci2 -device uhci-1,driver=ich9-usb-uhci1,addr=1e.1,multifunction=on,masterbus=ehci2.0,firstport=0 -device uhci-2,driver=ich9-usb-uhci2,addr=1e.2,multifunction=on,masterbus=ehci2.0,firstport=2 -device uhci-3,driver=ich9-usb-uhci3,addr=1e.3,multifunction=on,masterbus=ehci2.0,firstport=4 -device usb-host,hostbus=1,hostport=1,bus=ehci2.0 -device usb-host,hostbus=1,hostport=1.1,bus=ehci2.0 -device usb-host,hostbus=1,hostport=1.2,bus=ehci2.0 -device usb-host,hostbus=1,hostport=1.3,bus=ehci2.0 -device usb-host,hostbus=1,hostport=1.4,bus=ehci2.0"

If both the hard disk and serial interface are supported, the value is "-hdb /dev/external_disk -serial /dev/ttyS1".

Translation
Download
Updated: 2019-05-06

Document ID: EDOC1000177806

Views: 9837

Downloads: 38

Average rating:
This Document Applies to these Products

Related Version

Related Documents

Share
Previous Next