From: ogawa.yasufumi@lab.ntt.co.jp
To: spp@dpdk.org, ferruh.yigit@intel.com, ogawa.yasufumi@lab.ntt.co.jp
Subject: [spp] [PATCH 04/20] docs: move virsh setup section
Date: Mon, 18 Feb 2019 20:48:15 +0900 [thread overview]
Message-ID: <1550490511-31683-5-git-send-email-ogawa.yasufumi@lab.ntt.co.jp> (raw)
In-Reply-To: <1550490511-31683-1-git-send-email-ogawa.yasufumi@lab.ntt.co.jp>
From: Yasufumi Ogawa <ogawa.yasufumi@lab.ntt.co.jp>
This patch is to move virsh setup section from `SPP VF` to `Getting
Started Guide`.
Signed-off-by: Yasufumi Ogawa <ogawa.yasufumi@lab.ntt.co.jp>
---
docs/guides/gsg/howto_use.rst | 171 +++++++++++++++++++++++++-
docs/guides/spp_vf/gsg/setup.rst | 163 ------------------------
docs/guides/spp_vf/use_cases/vf_ssh_login.rst | 2 +-
docs/guides/use_cases/spp_nfv.rst | 4 +-
4 files changed, 173 insertions(+), 167 deletions(-)
diff --git a/docs/guides/gsg/howto_use.rst b/docs/guides/gsg/howto_use.rst
index cc3dd9b..d3b0ceb 100644
--- a/docs/guides/gsg/howto_use.rst
+++ b/docs/guides/gsg/howto_use.rst
@@ -1,7 +1,7 @@
.. SPDX-License-Identifier: BSD-3-Clause
Copyright(c) 2010-2014 Intel Corporation
-.. _spp_setup_howto_use:
+.. _spp_gsg_howto_use:
How to Use
==========
@@ -26,6 +26,8 @@ If you just patch two DPDK applications on host, it is enough to use one
How to use of these secondary processes is described in next chapters.
+.. _spp_gsg_howto_controller:
+
SPP Controller
--------------
@@ -226,6 +228,8 @@ Here is an example for changing command prompt.
$ spp
+.. _spp_gsg_howto_pri:
+
SPP Primary
-----------
@@ -324,6 +328,8 @@ secondary processes.
- -s: IP address of controller and port prepared for primary.
+.. _spp_gsg_howto_sec:
+
SPP Secondary
-------------
@@ -576,3 +582,166 @@ applications with SPP.
SPP enables users to configure service function chaining between applications
running on host and VMs.
Usecases of network configuration are explained in the next chapter.
+
+
+.. _spp_gsg_howto_virsh:
+
+Using virsh
+~~~~~~~~~~~
+
+First of all, please check version of qemu-kvm.
+
+.. code-block:: console
+
+ $ qemu-system-x86_64 --version
+
+If your system does not have qemu-kvm or the version of qemu is less than 2.7,
+then please install qemu following
+the instruction of https://wiki.qemu.org/index.php/Hosts/Linux
+to install qemu 2.7.
+You may need to install libvirt-bin,
+virtinst, bridge-utils packages via ``apt-get`` install to run
+``virt-install``.
+
+
+``virsh`` is a command line interface that can be used to create, destroy,
+stop start and edit VMs and configure. After create an image file,
+you can setup it with ``virt-install``.
+``--location`` is a URL of installer and it should be
+``http://archive.ubuntu.com/ubuntu/dists/xenial/main/installer-amd64/``
+for amd64.
+
+.. code-block:: console
+
+ virt-install \
+ --name [VM_NAME] \
+ --ram 4096 \
+ --disk path=/var/lib/libvirt/images/[VM_NAME].img,size=30 \
+ --vcpus 4 \
+ --os-type linux \
+ --os-variant ubuntu16.04 \
+ --network network=default \
+ --graphics none \
+ --console pty,target_type=serial \
+ --location '[LOCATION]' \
+ --extra-args 'console=ttyS0,115200n8 serial'
+
+You may need type the following commands through ssh to activate console.
+
+.. code-block:: console
+
+ $sudo systemctl enable serial-getty@ttyS0.service
+ $sudo systemctl start serial-getty@ttyS0.service
+
+
+Edit VM configuration with virsh.
+
+.. code-block:: console
+
+ $ virsh edit [VM_NAME]
+
+You need to add ``xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'``
+into the domain tag because of adding ``<qemu:commandline>`` tag.
+In addition, you need to add the tag enclosed by ``<memoryBacking>`` and
+``</memoryBacking>``, ``<qemu:commandline>`` and ``</qemu:commandline>``
+because SPP uses vhost-user as interface with VM.
+Note that number used in those tags should be the same value
+(e.g. chr0,sock0,vhost-net0) and these values should correspond
+to "add vhost N" (in this example 0).
+MAC address used in
+``<qemu:arg value='virtio-net-pci,netdev=vhost-net0,mac=52:54:00:12:34:56'/>``
+can be specified when registering MAC address to classifier
+using Secondary command.
+
+ The following is an example of modified xml file:
+
+.. code-block:: xml
+
+ <domain type='kvm' xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'>
+ <name>spp-vm1</name>
+ <uuid>d90f5420-861a-4479-8559-62d7a1545cb9</uuid>
+ <memory unit='KiB'>4194304</memory>
+ <currentMemory unit='KiB'>4194304</currentMemory>
+ <memoryBacking>
+ <hugepages/>
+ </memoryBacking>
+ <vcpu placement='static'>4</vcpu>
+ <os>
+ <type arch='x86_64' machine='pc-i440fx-2.3'>hvm</type>
+ <boot dev='hd'/>
+ </os>
+ <features>
+ <acpi/>
+ <apic/>
+ <pae/>
+ </features>
+ <clock offset='utc'/>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>restart</on_reboot>
+ <on_crash>restart</on_crash>
+ <devices>
+ <emulator>/usr/local/bin/qemu-system-x86_64</emulator>
+ <disk type='file' device='disk'>
+ <driver name='qemu' type='raw'/>
+ <source file='/var/lib/libvirt/images/spp-vm1.qcow2'/>
+ <target dev='hda' bus='ide'/>
+ <address type='drive' controller='0' bus='0' target='0' unit='0'/>
+ </disk>
+ <disk type='block' device='cdrom'>
+ <driver name='qemu' type='raw'/>
+ <target dev='hdc' bus='ide'/>
+ <readonly/>
+ <address type='drive' controller='0' bus='1' target='0' unit='0'/>
+ </disk>
+ <controller type='usb' index='0'>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x01'
+ function='0x2'/>
+ </controller>
+ <controller type='pci' index='0' model='pci-root'/>
+ <controller type='ide' index='0'>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x01'
+ function='0x1'/>
+ </controller>
+ <interface type='network'>
+ <mac address='52:54:00:99:aa:7f'/>
+ <source network='default'/>
+ <model type='rtl8139'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x02'
+ function='0x0'/>
+ </interface>
+ <serial type='pty'>
+ <target type='isa-serial' port='0'/>
+ </serial>
+ <console type='pty'>
+ <target type='serial' port='0'/>
+ </console>
+ <memballoon model='virtio'>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x03'
+ function='0x0'/>
+ </memballoon>
+ </devices>
+ <qemu:commandline>
+ <qemu:arg value='-cpu'/>
+ <qemu:arg value='host'/>
+ <qemu:arg value='-object'/>
+ <qemu:arg
+ value='memory-backend-file,id=mem,size=4096M,mem-path=/run/hugepages/kvm,share=on'/>
+ <qemu:arg value='-numa'/>
+ <qemu:arg value='node,memdev=mem'/>
+ <qemu:arg value='-mem-prealloc'/>
+ <qemu:arg value='-chardev'/>
+ <qemu:arg value='socket,id=chr0,path=/tmp/sock0,server'/>
+ <qemu:arg value='-device'/>
+ <qemu:arg
+ value='virtio-net-pci,netdev=vhost-net0,mac=52:54:00:12:34:56'/>
+ <qemu:arg value='-netdev'/>
+ <qemu:arg value='vhost-user,id=vhost-net0,chardev=chr0,vhostforce'/>
+ <qemu:arg value='-chardev'/>
+ <qemu:arg value='socket,id=chr1,path=/tmp/sock1,server'/>
+ <qemu:arg value='-device'/>
+ <qemu:arg
+ value='virtio-net-pci,netdev=vhost-net1,mac=52:54:00:12:34:57'/>
+ <qemu:arg value='-netdev'/>
+ <qemu:arg value='vhost-user,id=vhost-net1,chardev=chr1,vhostforce'/>
+ </qemu:commandline>
+ </domain>
diff --git a/docs/guides/spp_vf/gsg/setup.rst b/docs/guides/spp_vf/gsg/setup.rst
index 426033e..f0b8274 100644
--- a/docs/guides/spp_vf/gsg/setup.rst
+++ b/docs/guides/spp_vf/gsg/setup.rst
@@ -62,169 +62,6 @@ PCI number is inspected
$ sudo $RTE_SDK/usertools/dpdk-devbind.py --bind=igb_uio PCI_NUM
-.. _spp_vf_gsg_virsh_setup:
-
-virsh setup
------------
-
-First of all, please check version of qemu-kvm.
-
-.. code-block:: console
-
- $ qemu-system-x86_64 --version
-
-If your system does not have qemu-kvm or the version of qemu is less than 2.7,
-then please install qemu following
-the instruction of https://wiki.qemu.org/index.php/Hosts/Linux
-to install qemu 2.7.
-You may need to install libvirt-bin,
-virtinst, bridge-utils packages via ``apt-get`` install to run
-``virt-install``.
-
-
-``virsh`` is a command line interface that can be used to create, destroy,
-stop start and edit VMs and configure. After create an image file,
-you can setup it with ``virt-install``.
-``--location`` is a URL of installer and it should be
-``http://archive.ubuntu.com/ubuntu/dists/xenial/main/installer-amd64/``
-for amd64.
-
-.. code-block:: console
-
- virt-install \
- --name [VM_NAME] \
- --ram 4096 \
- --disk path=/var/lib/libvirt/images/[VM_NAME].img,size=30 \
- --vcpus 4 \
- --os-type linux \
- --os-variant ubuntu16.04 \
- --network network=default \
- --graphics none \
- --console pty,target_type=serial \
- --location '[LOCATION]' \
- --extra-args 'console=ttyS0,115200n8 serial'
-
-You may need type the following commands through ssh to activate console.
-
-.. code-block:: console
-
- $sudo systemctl enable serial-getty@ttyS0.service
- $sudo systemctl start serial-getty@ttyS0.service
-
-
-Edit VM configuration with virsh.
-
-.. code-block:: console
-
- $ virsh edit [VM_NAME]
-
-You need to add ``xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'``
-into the domain tag because of adding ``<qemu:commandline>`` tag.
-In addition, you need to add the tag enclosed by ``<memoryBacking>`` and
-``</memoryBacking>``, ``<qemu:commandline>`` and ``</qemu:commandline>``
-because SPP uses vhost-user as interface with VM.
-Note that number used in those tags should be the same value
-(e.g. chr0,sock0,vhost-net0) and these values should correspond
-to "add vhost N" (in this example 0).
-MAC address used in
-``<qemu:arg value='virtio-net-pci,netdev=vhost-net0,mac=52:54:00:12:34:56'/>``
-can be specified when registering MAC address to classifier
-using Secondary command.
-
- The following is an example of modified xml file:
-
-.. code-block:: xml
-
- <domain type='kvm' xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'>
- <name>spp-vm1</name>
- <uuid>d90f5420-861a-4479-8559-62d7a1545cb9</uuid>
- <memory unit='KiB'>4194304</memory>
- <currentMemory unit='KiB'>4194304</currentMemory>
- <memoryBacking>
- <hugepages/>
- </memoryBacking>
- <vcpu placement='static'>4</vcpu>
- <os>
- <type arch='x86_64' machine='pc-i440fx-2.3'>hvm</type>
- <boot dev='hd'/>
- </os>
- <features>
- <acpi/>
- <apic/>
- <pae/>
- </features>
- <clock offset='utc'/>
- <on_poweroff>destroy</on_poweroff>
- <on_reboot>restart</on_reboot>
- <on_crash>restart</on_crash>
- <devices>
- <emulator>/usr/local/bin/qemu-system-x86_64</emulator>
- <disk type='file' device='disk'>
- <driver name='qemu' type='raw'/>
- <source file='/var/lib/libvirt/images/spp-vm1.qcow2'/>
- <target dev='hda' bus='ide'/>
- <address type='drive' controller='0' bus='0' target='0' unit='0'/>
- </disk>
- <disk type='block' device='cdrom'>
- <driver name='qemu' type='raw'/>
- <target dev='hdc' bus='ide'/>
- <readonly/>
- <address type='drive' controller='0' bus='1' target='0' unit='0'/>
- </disk>
- <controller type='usb' index='0'>
- <address type='pci' domain='0x0000' bus='0x00' slot='0x01'
- function='0x2'/>
- </controller>
- <controller type='pci' index='0' model='pci-root'/>
- <controller type='ide' index='0'>
- <address type='pci' domain='0x0000' bus='0x00' slot='0x01'
- function='0x1'/>
- </controller>
- <interface type='network'>
- <mac address='52:54:00:99:aa:7f'/>
- <source network='default'/>
- <model type='rtl8139'/>
- <address type='pci' domain='0x0000' bus='0x00' slot='0x02'
- function='0x0'/>
- </interface>
- <serial type='pty'>
- <target type='isa-serial' port='0'/>
- </serial>
- <console type='pty'>
- <target type='serial' port='0'/>
- </console>
- <memballoon model='virtio'>
- <address type='pci' domain='0x0000' bus='0x00' slot='0x03'
- function='0x0'/>
- </memballoon>
- </devices>
- <qemu:commandline>
- <qemu:arg value='-cpu'/>
- <qemu:arg value='host'/>
- <qemu:arg value='-object'/>
- <qemu:arg
- value='memory-backend-file,id=mem,size=4096M,mem-path=/run/hugepages/kvm,share=on'/>
- <qemu:arg value='-numa'/>
- <qemu:arg value='node,memdev=mem'/>
- <qemu:arg value='-mem-prealloc'/>
- <qemu:arg value='-chardev'/>
- <qemu:arg value='socket,id=chr0,path=/tmp/sock0,server'/>
- <qemu:arg value='-device'/>
- <qemu:arg
- value='virtio-net-pci,netdev=vhost-net0,mac=52:54:00:12:34:56'/>
- <qemu:arg value='-netdev'/>
- <qemu:arg value='vhost-user,id=vhost-net0,chardev=chr0,vhostforce'/>
- <qemu:arg value='-chardev'/>
- <qemu:arg value='socket,id=chr1,path=/tmp/sock1,server'/>
- <qemu:arg value='-device'/>
- <qemu:arg
- value='virtio-net-pci,netdev=vhost-net1,mac=52:54:00:12:34:57'/>
- <qemu:arg value='-netdev'/>
- <qemu:arg value='vhost-user,id=vhost-net1,chardev=chr1,vhostforce'/>
- </qemu:commandline>
- </domain>
-
-
Setup spp_mirror
----------------
diff --git a/docs/guides/spp_vf/use_cases/vf_ssh_login.rst b/docs/guides/spp_vf/use_cases/vf_ssh_login.rst
index 719d673..a116a86 100644
--- a/docs/guides/spp_vf/use_cases/vf_ssh_login.rst
+++ b/docs/guides/spp_vf/use_cases/vf_ssh_login.rst
@@ -230,7 +230,7 @@ Setup for VMs
-------------
Launch VM1 and VM2 with virsh command.
-Setup for virsh is described in :ref:`spp_vf_gsg_virsh_setup`.
+Setup for virsh is described in :ref:`spp_gsg_howto_virsh`.
.. code-block:: console
diff --git a/docs/guides/use_cases/spp_nfv.rst b/docs/guides/use_cases/spp_nfv.rst
index 31ca4ea..c4e3f0c 100644
--- a/docs/guides/use_cases/spp_nfv.rst
+++ b/docs/guides/use_cases/spp_nfv.rst
@@ -309,7 +309,7 @@ Vhost PMD
Vhost PMD is an interface for communicating between on hsot and guest VM.
As described in
-:ref:`How to Use<spp_setup_howto_use>`,
+:ref:`How to Use<spp_gsg_howto_use>`,
vhost must be created by ``add`` subcommand before the VM is launched.
@@ -344,7 +344,7 @@ Setup Network Configuration in spp_nfv
Launch a VM by using the vhost interface created in the previous step.
Lauunching VM is described in
-:ref:`How to Use<spp_setup_howto_use>`.
+:ref:`How to Use<spp_gsg_howto_use>`.
Patch ``phy:0`` to ``vhost:0`` and ``vhost:1`` to ``phy:1`` from ``nfv 1``
running on host.
--
2.7.4
next prev parent reply other threads:[~2019-02-18 11:50 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-02-18 11:48 [spp] [PATCH 00/20] Remove SPP VF chapter in docs ogawa.yasufumi
2019-02-18 11:48 ` [spp] [PATCH 01/20] docs: move design of SPP VF ogawa.yasufumi
2019-02-18 11:48 ` [spp] [PATCH 02/20] docs: divide getting started guide ogawa.yasufumi
2019-02-18 11:48 ` [spp] [PATCH 03/20] docs: move libvirt setup to gsg ogawa.yasufumi
2019-02-18 11:48 ` ogawa.yasufumi [this message]
2019-02-18 11:48 ` [spp] [PATCH 05/20] docs: move package installation " ogawa.yasufumi
2019-02-18 11:48 ` [spp] [PATCH 06/20] docs: move descs of packet copy mode of spp_mirror ogawa.yasufumi
2019-02-18 11:48 ` [spp] [PATCH 07/20] docs: move usecase of spp_vf ogawa.yasufumi
2019-02-18 11:48 ` [spp] [PATCH 08/20] docs: update usecase of ssh with spp_vf ogawa.yasufumi
2019-02-18 11:48 ` [spp] [PATCH 09/20] docs: update how to use for virsh ogawa.yasufumi
2019-02-18 11:48 ` [spp] [PATCH 10/20] docs: update usecase of spp_mirror ogawa.yasufumi
2019-02-18 11:48 ` [spp] [PATCH 11/20] docs: revise how to use and usecases ogawa.yasufumi
2019-02-18 11:48 ` [spp] [PATCH 12/20] docs: move usecase of spp_pcap ogawa.yasufumi
2019-02-18 11:48 ` [spp] [PATCH 13/20] docs: remove SPP VF ogawa.yasufumi
2019-02-18 11:48 ` [spp] [PATCH 14/20] docs: move image of ICMP usecase of spp_vf ogawa.yasufumi
2019-02-18 11:48 ` [spp] [PATCH 15/20] docs: revise labels of image of spp_vf usecase ogawa.yasufumi
2019-02-18 11:48 ` [spp] [PATCH 16/20] docs: fix image of spp_mirror monitoring usecase ogawa.yasufumi
2019-02-18 11:48 ` [spp] [PATCH 17/20] docs: move image of design of spp_vf ogawa.yasufumi
2019-02-18 11:48 ` [spp] [PATCH 18/20] docs: move images of design of mirror and pcap ogawa.yasufumi
2019-02-18 11:48 ` [spp] [PATCH 19/20] docs: move image of overview of spp_pcap ogawa.yasufumi
2019-02-18 11:48 ` [spp] [PATCH 20/20] docs: fix in image of spp_mirror monitor usecase ogawa.yasufumi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1550490511-31683-5-git-send-email-ogawa.yasufumi@lab.ntt.co.jp \
--to=ogawa.yasufumi@lab.ntt.co.jp \
--cc=ferruh.yigit@intel.com \
--cc=spp@dpdk.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).