...
코드 블럭 |
---|
language | yml |
---|
title | /var/lib/libvirt/images/node-definitions/ubuntu.yaml |
---|
linenumbers | true |
---|
collapse | true |
---|
|
#
# Ubuntu node definition (cloud image, using cloud-init)
#
id: ubuntu
sim:
linux_native:
driver: server
libvirt_domain_driver: kvm
disk_driver: virtio
nic_driver: virtio
ram: 2048
cpus: 1
data_volume: 0
boot_disk_size: 64
inherited:
image:
ram: true
cpus: true
cpu_limit: true
data_volume: true
boot_disk_size: true
node:
ram: true
cpus: true
cpu_limit: true
data_volume: true
boot_disk_size: true
general:
nature: server
description: Ubuntu Cloud Init Platform
read_only: true
schema_version: 0.0.1
configuration:
generator:
driver: ubuntu
provisioning:
volume_name: cidata
media_type: iso
files:
- name: meta-data
content: |
instance-id: ubuntu
local-hostname: ubuntu
editable: false
- name: user-data
content: |
#cloud-config
hostname: inserthostname-here
manage_etc_hosts: True
system_info:
default_user:
name: cisco
password: cisco
chpasswd: { expire: False }
ssh_pwauth: True
ssh_authorized_keys:
- your-ssh-pubkey-line-goes-here
editable: true
device:
interfaces:
# 8 should be enough, they are called ens2, ens3, ...
# however, those are PCI bus/slot numbers. I guess they are
# not static. Depends what device goes before '2'
physical:
- ens2
- ens3
- ens4
- ens5
- ens6
- ens7
- ens8
- ens9
has_loopback_zero: false
default_count: 1
serial_ports: 1
boot:
timeout: 180
# seems that without proper meta-data the hostname is not
# correctly set at initial boot. It is 'ubuntu'. Also, the
# first line is not seen at first boot. Only at second
# boot, the correct hostname plus the 'reached target' is
# will be set / shown on the console.
completed:
- "Cloud-init target"
- "Welcome to Ubuntu"
- "running 'modules:final' at"
pyats:
os: linux
ui:
group: Others
icon: server
label: Ubuntu
label_prefix: ubuntu-
visible: true
description: |
Ubuntu Cloud Init Platform
2 GB DRAM, 1 vCPU (can be adjusted)
##### Configuration
The Ubuntu image uses cloud-init YAML for configuration. Please
ensure that you have a valid cloud-init configuration in the node's
Edit Config pane in the Workbench. When you drop an Ubuntu node
on the canvas in the Workbench, a very brief (but complete) skeleton
for a cloud-init configuration is added to the node.
The pre-configured default username on the VM image is ubuntu,
but the initial config for the node overrides the default_user account
to be cisco. To log into the node as with this default user account,
ensure that the cloud-init config for the node either specifies a password
with the top-level password field or provides at least one SSH public key
with the top-level ssh_authorized_keys field.
See [the cloud-init documentation](https://cloudinit.readthedocs.io/en/latest/topics/examples.html)
for additional cloud-init examples. |
Process
코드 블럭 |
---|
title | ps auxf |
---|
linenumbers | true |
---|
collapse | true |
---|
|
root@cml-controller:/var/lib/libvirt/images# ps auxf | awk '{ print substr($0, 1, 9) substr($0, 67) }'
USER# virsh list --all
Id Name COMMAND
root /bin/bash -c /bin/busctl monitor --system --json=short
State
------------------------------------------------------
1 86770ca2-685f-4c57-b215-350265c973c4 running
2 50e4385b-f762-42a1-9f3f-89bca3785ff1 running
3 8b9c1cd8-254c-4bf4-86f2-c840e301bbc7 running |
코드 블럭 |
---|
language | xml |
---|
title | virsh dumpxml 86770ca2-685f-4c57-b215-350265c973c4 |
---|
linenumbers | true |
---|
collapse | true |
---|
|
<domain type='kvm' id='1'>
<name>86770ca2-685f-4c57-b215-350265c973c4</name>
<uuid>86770ca2-685f-4c57-b215-350265c973c4</uuid>
<description>cat8000v-0: Lab at Mon 00:44 AM (cat8000v)</description>
<memory unit='KiB'>4194304</memory>
<currentMemory unit='KiB'>4194304</currentMemory>
<vcpu placement='auto'>1</vcpu>
<numatune>
<memory mode='strict' placement='auto'/>
</numatune>
<resource>
<partition>/machine</partition>
</resource>
<os>
<type arch='x86_64' machine='pc-i440fx-4.2'>hvm</type>
<boot dev='hd'/>
</os>
<features>
<acpi/>
</features>
<cpu mode='host-passthrough' check='none'/>
<clock offset='utc'/>
<on_poweroff>destroy</on_poweroff>
<on_reboot>restart</on_reboot>
<on_crash>destroy</on_crash>
<devices>
<emulator>/usr/bin/qemu-system-x86_64</emulator>
<disk type='file' device='disk'>
<driver name='qemu' type='qcow2' cache='writethrough'/>
<source file='/var/local/virl2/images/9688ac22-ad37-4cf3-aa06-2efe9d8c7786/86770ca2-685f-4c57-b215-350265c973c4/node0.img' index='2'>--match "interface=org.fedoraproject.FirewallD1,member=Reloaded"
| while read -r line ; do /usr/local/bin/libvirt-iptables-checker.sh ; done
root /usr/bin/python3 /usr/bin/networkd-dispatcher --run-startup-triggers
root /lib/systemd/systemd-logind
root /lib/systemd/systemd-machined
root /usr/lib/udisks2/udisksd
root /usr/sbin/ModemManager
root /bin/bash /usr/sbin/ksmtuned
root \_ sleep 60
root /usr/sbin/NetworkManager --no-daemon
root /usr/sbin/libvirtd
root /usr/sbin/rpc.mountd --manage-gids
root /usr/bin/python3 -Es /usr/sbin/tuned -l -P
root nginx: master process /usr/sbin/nginx -g daemon on; master_process on;
www-data \_ nginx: worker process
www-data \_ nginx: worker process
...
libvirt+ /usr/sbin/dnsmasq --conf-file=/var/lib/libvirt/dnsmasq/default.conf
<seclabel model='dac' relabel='no'/>
</source>
--leasefile-ro --dhcp-script=/usr/lib/libvirt/libvirt_leaseshelper
root <backingStore type='file' index='3'>
<format type='qcow2'/>
/sbin/agetty -o -p -- \u --noclear tty1 linux
root <source file='/var/lib/libvirt/images/virl-base-images/cat8000v-17-13-01a/c8000v-universalk9_8G_serial.17.13.01a.qcow2'>
systemd/systemd --user
root <seclabel model='dac' relabel='no'/>\_ (sd-pam)
virl2 /usr/local/bin/devicemux
</source>
-logtostderr <backingStore/>
-stderrthreshold=WARNING
</backingStore>
<target dev='vda' bus='virtio'/>
-config /var/local/virl2/devicemux-config.yml
root <alias name='virtio-disk0'/>
\_ sudo -n /usr/local/bin/sysctldisableipv6
virl2 <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
/usr/local/bin/ipsnooper
</disk>
<disk-logtostderr type='file' device='cdrom'>
-stderrthreshold=WARNING
<driver name='qemu' type='raw' cache='none'/>
<source-config file='/var/local/virl2/images/9688ac22-ad37-4cf3-aa06-2efe9d8c7786/86770ca2-685f-4c57-b215-350265c973c4/config.img' index='1'/>/ipsnooper.yml
www-data /usr/local/bin/pcapdemux
<backingStore/>
<target-logtostderr dev='vdb' bus='ide'/>
-stderrthreshold=WARNING
<readonly/>
-bindapi :8004 -controller <alias name='ide0-0-1'/>ip6-localhost:8001 -usetls=false -verify=false -dispatcher ip6-localhost:8006
www-data /usr/local/bin/dispatcher
<address type='drive' controller='0' bus='0' target='0' unit='1'/>
</disk> -logtostderr -stderrthreshold=WARNING
root /usr/local/bin/virl2-sshd
<controller type='usb' index='0' model='piix3-uhci'>
<alias-logtostderr name='usb'/>
-stderrthreshold=WARNING
<address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
</controller>
<controller type='pci' index='0' model='pci-root'>
<alias name='pci.0'/>
</controller>
<controller type='ide' index='0'>
-listen :22 -hostkey /etc/ssh/ssh_host_rsa_key -controller http://ip6-localhost:8001 -user virl2
www-data /usr/bin/python3 -u /var/local/virl2/.local/bin/virl2-licensing --loglevel=WARNING
virl2 /usr/bin/python3 -u /var/local/virl2/.local/bin/virl2-lowlevel-driver --loglevel=WARNING
virl2 /usr/bin/python3 -u /var/local/virl2/.local/bin/virl2-core-driver
www-data /usr/bin/python3 -u /var/local/virl2/.local/bin/virl2_webserver
<alias name='ide'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>--path /run/virl2/virl2_1.sock --bindto lo --port 8001 --loglevel=WARNING
</controller>
<interface type='udp'>
--db_conn_str=sqlite:////var/local/virl2/config/controller.db
root <mac address='52:54:00:05:2d:cf'/>
<source address='127.0.0.1' port='21000'>
tmux new-session -d -s lld -n SHELL -c /var/local/virl2 -x80 -y24 /bin/bash
root <local address='127.0.0.1' port='21001'/>
\_ /bin/bash
root </source>
<model type='vmxnet3'/>
\_ bash -c ulimit -c0;
<alias name='net0'/>
while /bin/true;
<address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
</interface>
do echo "Ctrl-\ to <interface type='udp'>restart";
<mac address='52:54:00:0f:2a:29'/>
<source address='127.0.0.1' port='21002'> /usr/bin/journalctl --output=short --no-hostname --follow -u virl2-controller ;
<local address='127.0.0.1' port='21003'/>
</source>done
root \_ bash -c ulimit <model type='vmxnet3'/>
-c0;
<alias name='net1'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
while /bin/true;
</interface>
<interface type='udp'>
do echo "Ctrl-\ to <mac address='52:54:00:04:be:e7'/>restart";
<source address='127.0.0.1' port='21004'>
<local address='127.0.0.1' port='21005'/>
</source>
/usr/bin/journalctl --output=cat --follow -u virl2-fabric ;
<model type='vmxnet3'/>
<alias name='net2'/>
done
root <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/> \_ bash -c ulimit -c0;
</interface>
<interface type='udp'>
<mac address='52:54:00:0d:32:f4'/>while /bin/true;
<source address='127.0.0.1' port='21006'>
<local address='127.0.0.1' port='21007'/>
</source> do echo "Ctrl-\ to restart";
<model type='vmxnet3'/>
<alias name='net3'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>/usr/bin/journalctl --output=cat --follow -u virl2-devicemux ;
</interface>
<serial type='pty'>
<source path='/dev/pts/11'/>
done
root \_ bash -c <targetulimit type='isa-serial' port='0'>-c0;
<model name='isa-serial'/>
while </target>/bin/true;
<alias name='serial0'/>
</serial>
<serial type='pty'>
do echo "Ctrl-\ to <source path='/dev/pts/12'/>
restart";
<target type='isa-serial' port='1'>
<model name='isa-serial'/>
</target>
/usr/bin/journalctl --output=cat --follow -u virl2-pcapdemux ;
<alias name='serial1'/>
</serial>done
root <console type='pty' tty='/dev/pts/11'>
<source path='/dev/pts/11'/>
\_ bash -c ulimit -c0;
<target type='serial' port='0'/>
<alias name='serial0'/>while /bin/true;
</console>
<input type='mouse' bus='ps2'>
<alias name='input0'/>
</input>do echo "Ctrl-\ to restart";
<input type='keyboard' bus='ps2'>
<alias name='input1'/>
</input>
<memballoon model='virtio'>/usr/bin/journalctl --output=cat --follow -u virl2-ipsnooper ;
<alias name='balloon0'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/>
done
root </memballoon>
<rng model='virtio'>\_ bash -c ulimit -c0;
<backend model='random'>/dev/urandom</backend>
<alias name='rng0'/>while /bin/true;
<address type='pci' domain='0x0000' bus='0x00' slot='0x08' function='0x0'/>
</rng>
</devices>
<seclabel type='dynamic' model='apparmor' relabel='yes'>
<label>libvirt-86770ca2-685f-4c57-b215-350265c973c4</label>
<imagelabel>libvirt-86770ca2-685f-4c57-b215-350265c973c4</imagelabel>
</seclabel>
<seclabel type='dynamic' model='dac' relabel='yes'>
<label>+64055:+108</label>
<imagelabel>+64055:+108</imagelabel>
</seclabel>
</domain> |
코드 블럭 |
---|
language | xml |
---|
title | virsh dumpxml 50e4385b-f762-42a1-9f3f-89bca3785ff1 |
---|
linenumbers | true |
---|
collapse | true |
---|
|
<domain type='kvm' id='2'>
<name>50e4385b-f762-42a1-9f3f-89bca3785ff1</name>
<uuid>50e4385b-f762-42a1-9f3f-89bca3785ff1</uuid>
<description>ubuntu-0: Lab at Mon 00:44 AM (ubuntu)</description>
<memory unit='KiB'>2097152</memory>
<currentMemory unit='KiB'>2097152</currentMemory>
<vcpu placement='auto'>1</vcpu>
<numatune>
<memory mode='strict' placement='auto'/>
</numatune>
<resource>
<partition>/machine</partition>
</resource>
<os>
<type arch='x86_64' machine='pc-i440fx-4.2'>hvm</type>
<boot dev='hd'/>
</os>
<features>
<acpi/>
</features>
<cpu mode='host-passthrough' check='none'/>
<clock offset='utc'/>
<on_poweroff>destroy</on_poweroff>
<on_reboot>restart</on_reboot>
<on_crash>destroy</on_crash>
<devices>
<emulator>/usr/bin/qemu-system-x86_64</emulator>
<disk type='file' device='disk'>
<driver name='qemu' type='qcow2' cache='writethrough'/>
<source file='/var/local/virl2/images/9688ac22-ad37-4cf3-aa06-2efe9d8c7786/50e4385b-f762-42a1-9f3f-89bca3785ff1/node0.img' index='2'> do echo "Ctrl-\ to restart";
/usr/bin/journalctl --output=cat --follow -u virl2-dispatcher ;
done
root \_ bash -c ulimit -c0;
while /bin/true;
do echo "Ctrl-\ to restart";
/usr/bin/journalctl --output=short --no-hostname --follow -u virl2-core-driver ;
done
root \_ bash -c ulimit -c0;
while /bin/true;
do echo "Ctrl-\ to restart";
/usr/bin/journalctl --output=short --no-hostname --follow -u virl2-lowlevel-driver ;
<seclabel model='dac' relabel='no'/>
</source>done
root <backingStore type='file' index='3'>
<format type='qcow2'/>
<source file='/var/lib/libvirt/images/virl-base-images/ubuntu-22-04-20240126/jammy-server-cloudimg-amd64.img'>
<seclabel model='dac' relabel='no'/>
</source>
<backingStore/>
</backingStore>
<target dev='vda' bus='virtio'/>
<alias name='virtio-disk0'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
</disk>
<disk type='file' device='cdrom'>
<driver name='qemu' type='raw' cache='none'/>
<source file='/var/local/virl2/images/9688ac22-ad37-4cf3-aa06-2efe9d8c7786/50e4385b-f762-42a1-9f3f-89bca3785ff1/config.img' index='1'/>
<backingStore/>
<target dev='vdb' bus='ide'/>
<readonly/>
<alias name='ide0-0-1'/>
<address type='drive' controller='0' bus='0' target='0' unit='1'/>
</disk>
<controller type='usb' index='0' model='piix3-uhci'>
<alias name='usb'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
</controller>
<controller type='pci' index='0' model='pci-root'>
<alias name='pci.0'/>
</controller>
<controller type='ide' index='0'>
<alias name='ide'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
</controller>
<interface type='udp'>
<mac address='52:54:00:19:35:da'/>
<source address='127.0.0.1' port='21008'>
/usr/sbin/virtlogd
libvirt+ /usr/bin/qemu-system-x86_64 -name guest=86770ca2-685f-4c57-b215-350265c973c4 ...
libvirt+ /usr/bin/qemu-system-x86_64 -name guest=50e4385b-f762-42a1-9f3f-89bca3785ff1 ...
libvirt+ /usr/bin/qemu-system-x86_64 -name guest=8b9c1cd8-254c-4bf4-86f2-c840e301bbc7 ... |
tmux sessions
Image Added
코드 블럭 |
---|
root@cml-controller:/var/lib/libvirt/images# ps auxf | awk '{ print substr($0, 1, 9) substr($0, 67) }'
USER COMMAND
root tmux new-session -d -s lld -n SHELL -c /var/local/virl2 -x80 -y24 /bin/bash
root \_ /bin/bash
root \_ bash -c ulimit -c0;
while /bin/true;
do echo "Ctrl-\ to restart";
/usr/bin/journalctl --output=short --no-hostname --follow -u virl2-controller ;
done
root \_ bash -c ulimit -c0;
while /bin/true;
do echo "Ctrl-\ to restart";
/usr/bin/journalctl --output=cat --follow -u virl2-fabric ;
done
root \_ bash -c ulimit -c0;
<local address='127.0.0.1' port='21009'/>
while </source>/bin/true;
<model type='virtio'/>
<driver>
do echo "Ctrl-\ to <host csum='off'/>restart";
</driver>
<alias name='net0'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>/usr/bin/journalctl --output=cat --follow -u virl2-devicemux ;
</interface>
<serial type='pty'>
<source path='/dev/pts/13'/>
done
root \_ <targetbash type='isa-serial' port='0'>
-c ulimit -c0;
<model name='isa-serial'/>
while </target>/bin/true;
<alias name='serial0'/>
</serial>
<console type='pty' tty='/dev/pts/13'>
<source path='/dev/pts/13'/>
do echo "Ctrl-\ to restart";
<target type='serial' port='0'/>
<alias name='serial0'/>
</console> /usr/bin/journalctl --output=cat --follow -u virl2-pcapdemux ;
<input type='mouse' bus='ps2'>
<alias name='input0'/>
</input>done
root <input type='keyboard' bus='ps2'>
<alias name='input1'/>
\_ bash -c ulimit -c0;
</input>
<memballoon model='virtio'>
<alias name='balloon0'/>
while /bin/true;
<address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
</memballoon>
do echo <rng model='virtio'>
"Ctrl-\ to restart";
<backend model='random'>/dev/urandom</backend>
<alias name='rng0'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
</rng>
</devices>
<seclabel type='dynamic' model='apparmor' relabel='yes'>
<label>libvirt-50e4385b-f762-42a1-9f3f-89bca3785ff1</label>
<imagelabel>libvirt-50e4385b-f762-42a1-9f3f-89bca3785ff1</imagelabel>
</seclabel>
<seclabel type='dynamic' model='dac' relabel='yes'>
<label>+64055:+108</label>
<imagelabel>+64055:+108</imagelabel>
</seclabel>
</domain>
|
코드 블럭 |
---|
<disk type='file' device='disk'>
<driver name='qemu' type='qcow2' cache='writethrough'/>/usr/bin/journalctl --output=cat --follow -u virl2-ipsnooper ;
done
root \_ bash -c ulimit -c0;
while /bin/true;
do echo "Ctrl-\ to restart";
<source file='/var/local/virl2/images/9688ac22-ad37-4cf3-aa06-2efe9d8c7786/86770ca2-685f-4c57-b215-350265c973c4/node0.img' index='2'> /usr/bin/journalctl --output=cat --follow -u virl2-dispatcher ;
<seclabel model='dac' relabel='no'/>
</source>ddone
root <backingStore type='file' index='3'>
\_ bash -c ulimit -c0;
<format type='qcow2'/>
<source file='/var/lib/libvirt/images/virl-base-images/cat8000v-17-13-01a/c8000v-universalk9_8G_serial.17.13.01a.qcow2'> while /bin/true;
<seclabel model='dac' relabel='no'/>
do </source>
echo "Ctrl-\ to restart";
<backingStore/>
</backingStore>
<target dev='vda' bus='virtio'/>
/usr/bin/journalctl --output=short --no-hostname --follow -u virl2-core-driver ;
<alias name='virtio-disk0'/>
done
root <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
\_ bash -c ulimit -c0;
</disk> |
코드 블럭 |
---|
# ls -alhwhile /var/local/virl2/images/9688ac22-ad37-4cf3-aa06-2efe9d8c7786/86770ca2-685f-4c57-b215-350265c973c4/node0.img \
/var/lib/libvirt/images/virl-base-images/cat8000v-17-13-01a/c8000v-universalk9_8G_serial.17.13.01a.qcow2
-r--rw-r-- 1 libvirt-qemu virl2 1.9G Jun 23 23:35 /var/lib/libvirt/images/virl-base-images/cat8000v-17-13-01a/c8000v-universalk9_8G_serial.17.13.01a.qcow2
-rw-r--r-- 1 libvirt-qemu kvm 303M Aug 19 01:16 /var/local/virl2/images/9688ac22-ad37-4cf3-aa06-2efe9d8c7786/86770ca2-685f-4c57-b215-350265c973c4/node0.imgbin/true;
do echo "Ctrl-\ to restart";
/usr/bin/journalctl --output=short --no-hostname --follow -u virl2-lowlevel-driver ;
done
root@cml-controller:~# tmux ls
lld: 9 windows (created Wed Aug 14 09:10:13 2024)
root@cml-controller:~# tmux attach -t lld |
QEMU
dumpxml
코드 블럭 |
---|
|
# virsh list --all
Id Name State
------------------------------------------------------
1 86770ca2-685f-4c57-b215-350265c973c4 running
2 50e4385b-f762-42a1-9f3f-89bca3785ff1 running
3 8b9c1cd8-254c-4bf4-86f2-c840e301bbc7 running |
코드 블럭 |
---|
language | xml |
---|
title | virsh dumpxml 86770ca2-685f-4c57-b215-350265c973c4 |
---|
linenumbers | true |
---|
collapse | true |
---|
|
<domain type='kvm' id='1'>
<name>86770ca2-685f-4c57-b215-350265c973c4</name>
<uuid>86770ca2-685f-4c57-b215-350265c973c4</uuid>
<description>cat8000v-0: Lab at Mon 00:44 AM (cat8000v)</description>
<memory unit='KiB'>4194304</memory>
<currentMemory unit='KiB'>4194304</currentMemory>
<vcpu placement='auto'>1</vcpu>
<numatune>
<memory mode='strict' placement='auto'/>
</numatune>
<resource>
<partition>/machine</partition>
</resource>
<os>
<type arch='x86_64' machine='pc-i440fx-4.2'>hvm</type>
<boot dev='hd'/>
</os>
<features>
<acpi/>
</features>
<cpu mode='host-passthrough' check='none'/>
<clock offset='utc'/>
<on_poweroff>destroy</on_poweroff>
<on_reboot>restart</on_reboot>
<on_crash>destroy</on_crash>
<devices>
<emulator>/usr/bin/qemu-system-x86_64</emulator>
<disk type='file' device='disk'>
<driver name='qemu' type='qcow2' cache='writethrough'/>
<source file='/var/local/virl2/images/9688ac22-ad37-4cf3-aa06-2efe9d8c7786/86770ca2-685f-4c57-b215-350265c973c4/node0.img' index='2'>
<seclabel model='dac' relabel='no'/>
</source>
<backingStore type='file' index='3'>
<format type='qcow2'/>
<source file='/var/lib/libvirt/images/virl-base-images/cat8000v-17-13-01a/c8000v-universalk9_8G_serial.17.13.01a.qcow2'>
<seclabel model='dac' relabel='no'/>
</source>
<backingStore/>
</backingStore>
<target dev='vda' bus='virtio'/>
<alias name='virtio-disk0'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
</disk>
<disk type='file' device='cdrom'>
<driver name='qemu' type='raw' cache='none'/>
<source file='/var/local/virl2/images/9688ac22-ad37-4cf3-aa06-2efe9d8c7786/86770ca2-685f-4c57-b215-350265c973c4/config.img' index='1'/>
<backingStore/>
<target dev='vdb' bus='ide'/>
<readonly/>
<alias name='ide0-0-1'/>
<address type='drive' controller='0' bus='0' target='0' unit='1'/>
</disk>
<controller type='usb' index='0' model='piix3-uhci'>
<alias name='usb'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
</controller>
<controller type='pci' index='0' model='pci-root'>
<alias name='pci.0'/>
</controller>
<controller type='ide' index='0'>
<alias name='ide'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
</controller>
<interface type='udp'>
<mac address='52:54:00:05:2d:cf'/>
<source address='127.0.0.1' port='21000'>
<local address='127.0.0.1' port='21001'/>
</source>
<model type='vmxnet3'/>
<alias name='net0'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
</interface>
<interface type='udp'>
<mac address='52:54:00:0f:2a:29'/>
<source address='127.0.0.1' port='21002'>
<local address='127.0.0.1' port='21003'/>
</source>
<model type='vmxnet3'/>
<alias name='net1'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
</interface>
<interface type='udp'>
<mac address='52:54:00:04:be:e7'/>
<source address='127.0.0.1' port='21004'>
<local address='127.0.0.1' port='21005'/>
</source>
<model type='vmxnet3'/>
<alias name='net2'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
</interface>
<interface type='udp'>
<mac address='52:54:00:0d:32:f4'/>
<source address='127.0.0.1' port='21006'>
<local address='127.0.0.1' port='21007'/>
</source>
<model type='vmxnet3'/>
<alias name='net3'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
</interface>
<serial type='pty'>
<source path='/dev/pts/11'/>
<target type='isa-serial' port='0'>
<model name='isa-serial'/>
</target>
<alias name='serial0'/>
</serial>
<serial type='pty'>
<source path='/dev/pts/12'/>
<target type='isa-serial' port='1'>
<model name='isa-serial'/>
</target>
<alias name='serial1'/>
</serial>
<console type='pty' tty='/dev/pts/11'>
<source path='/dev/pts/11'/>
<target type='serial' port='0'/>
<alias name='serial0'/>
</console>
<input type='mouse' bus='ps2'>
<alias name='input0'/>
</input>
<input type='keyboard' bus='ps2'>
<alias name='input1'/>
</input>
<memballoon model='virtio'>
<alias name='balloon0'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/>
</memballoon>
<rng model='virtio'>
<backend model='random'>/dev/urandom</backend>
<alias name='rng0'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x08' function='0x0'/>
</rng>
</devices>
<seclabel type='dynamic' model='apparmor' relabel='yes'>
<label>libvirt-86770ca2-685f-4c57-b215-350265c973c4</label>
<imagelabel>libvirt-86770ca2-685f-4c57-b215-350265c973c4</imagelabel>
</seclabel>
<seclabel type='dynamic' model='dac' relabel='yes'>
<label>+64055:+108</label>
<imagelabel>+64055:+108</imagelabel>
</seclabel>
</domain> |
코드 블럭 |
---|
language | xml |
---|
title | virsh dumpxml 50e4385b-f762-42a1-9f3f-89bca3785ff1 |
---|
linenumbers | true |
---|
collapse | true |
---|
|
<domain type='kvm' id='2'>
<name>50e4385b-f762-42a1-9f3f-89bca3785ff1</name>
<uuid>50e4385b-f762-42a1-9f3f-89bca3785ff1</uuid>
<description>ubuntu-0: Lab at Mon 00:44 AM (ubuntu)</description>
<memory unit='KiB'>2097152</memory>
<currentMemory unit='KiB'>2097152</currentMemory>
<vcpu placement='auto'>1</vcpu>
<numatune>
<memory mode='strict' placement='auto'/>
</numatune>
<resource>
<partition>/machine</partition>
</resource>
<os>
<type arch='x86_64' machine='pc-i440fx-4.2'>hvm</type>
<boot dev='hd'/>
</os>
<features>
<acpi/>
</features>
<cpu mode='host-passthrough' check='none'/>
<clock offset='utc'/>
<on_poweroff>destroy</on_poweroff>
<on_reboot>restart</on_reboot>
<on_crash>destroy</on_crash>
<devices>
<emulator>/usr/bin/qemu-system-x86_64</emulator>
<disk type='file' device='disk'>
<driver name='qemu' type='qcow2' cache='writethrough'/>
<source file='/var/local/virl2/images/9688ac22-ad37-4cf3-aa06-2efe9d8c7786/50e4385b-f762-42a1-9f3f-89bca3785ff1/node0.img' index='2'>
<seclabel model='dac' relabel='no'/>
</source>
<backingStore type='file' index='3'>
<format type='qcow2'/>
<source file='/var/lib/libvirt/images/virl-base-images/ubuntu-22-04-20240126/jammy-server-cloudimg-amd64.img'>
<seclabel model='dac' relabel='no'/>
</source>
<backingStore/>
</backingStore>
<target dev='vda' bus='virtio'/>
<alias name='virtio-disk0'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
</disk>
<disk type='file' device='cdrom'>
<driver name='qemu' type='raw' cache='none'/>
<source file='/var/local/virl2/images/9688ac22-ad37-4cf3-aa06-2efe9d8c7786/50e4385b-f762-42a1-9f3f-89bca3785ff1/config.img' index='1'/>
<backingStore/>
<target dev='vdb' bus='ide'/>
<readonly/>
<alias name='ide0-0-1'/>
<address type='drive' controller='0' bus='0' target='0' unit='1'/>
</disk>
<controller type='usb' index='0' model='piix3-uhci'>
<alias name='usb'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
</controller>
<controller type='pci' index='0' model='pci-root'>
<alias name='pci.0'/>
</controller>
<controller type='ide' index='0'>
<alias name='ide'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
</controller>
<interface type='udp'>
<mac address='52:54:00:19:35:da'/>
<source address='127.0.0.1' port='21008'>
<local address='127.0.0.1' port='21009'/>
</source>
<model type='virtio'/>
<driver>
<host csum='off'/>
</driver>
<alias name='net0'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
</interface>
<serial type='pty'>
<source path='/dev/pts/13'/>
<target type='isa-serial' port='0'>
<model name='isa-serial'/>
</target>
<alias name='serial0'/>
</serial>
<console type='pty' tty='/dev/pts/13'>
<source path='/dev/pts/13'/>
<target type='serial' port='0'/>
<alias name='serial0'/>
</console>
<input type='mouse' bus='ps2'>
<alias name='input0'/>
</input>
<input type='keyboard' bus='ps2'>
<alias name='input1'/>
</input>
<memballoon model='virtio'>
<alias name='balloon0'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
</memballoon>
<rng model='virtio'>
<backend model='random'>/dev/urandom</backend>
<alias name='rng0'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
</rng>
</devices>
<seclabel type='dynamic' model='apparmor' relabel='yes'>
<label>libvirt-50e4385b-f762-42a1-9f3f-89bca3785ff1</label>
<imagelabel>libvirt-50e4385b-f762-42a1-9f3f-89bca3785ff1</imagelabel>
</seclabel>
<seclabel type='dynamic' model='dac' relabel='yes'>
<label>+64055:+108</label>
<imagelabel>+64055:+108</imagelabel>
</seclabel>
</domain>
|
Disk - snapshot
c8000v-universalk9_8G_serial.17.13.01a.qcow2 | read-only base image |
---|
node0.img | differences |
---|
코드 블럭 |
---|
language | xml |
---|
title | virsh dumpxml 86770ca2-685f-4c57-b215-350265c973c4 |
---|
linenumbers | true |
---|
|
<disk type='file' device='disk'>
<driver name='qemu' type='qcow2' cache='writethrough'/>
<source file='/var/local/virl2/images/9688ac22-ad37-4cf3-aa06-2efe9d8c7786/86770ca2-685f-4c57-b215-350265c973c4/node0.img' index='2'>
<seclabel model='dac' relabel='no'/>
</source>d
<backingStore type='file' index='3'>
<format type='qcow2'/>
<source file='/var/lib/libvirt/images/virl-base-images/cat8000v-17-13-01a/c8000v-universalk9_8G_serial.17.13.01a.qcow2'>
<seclabel model='dac' relabel='no'/>
</source>
<backingStore/>
</backingStore>
<target dev='vda' bus='virtio'/>
<alias name='virtio-disk0'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
</disk> |
코드 블럭 |
---|
|
# ls -alh /var/local/virl2/images/9688ac22-ad37-4cf3-aa06-2efe9d8c7786/86770ca2-685f-4c57-b215-350265c973c4/node0.img \
/var/lib/libvirt/images/virl-base-images/cat8000v-17-13-01a/c8000v-universalk9_8G_serial.17.13.01a.qcow2
-r--rw-r-- 1 libvirt-qemu virl2 1.9G Jun 23 23:35 /var/lib/libvirt/images/virl-base-images/cat8000v-17-13-01a/c8000v-universalk9_8G_serial.17.13.01a.qcow2
-rw-r--r-- 1 libvirt-qemu kvm 303M Aug 19 01:16 /var/local/virl2/images/9688ac22-ad37-4cf3-aa06-2efe9d8c7786/86770ca2-685f-4c57-b215-350265c973c4/node0.img |
코드 블럭 |
---|
|
root@cml-controller:~# virsh domblklist 86770ca2-685f-4c57-b215-350265c973c4
Target Source
------------------------------------------------------------------------------------------------------------------------
vda /var/local/virl2/images/.../86770ca2-685f-4c57-b215-350265c973c4/node0.img
vdb /var/local/virl2/images/.../86770ca2-685f-4c57-b215-350265c973c4/config.img
root@cml-controller:~# virsh domblkstat 86770ca2-685f-4c57-b215-350265c973c4 vda --human
Device: vda
number of read operations: 20923
number of bytes read: 1582396928
number of write operations: 1077
number of bytes written: 608612352
number of flush operations: 0
total duration of reads (ns): 6638006817
total duration of writes (ns): 238078868428
total duration of flushes (ns): 0 |
Network - QEMU UDP Unicast Tunnel
https://linuxsimba.github.io/qemu-tunnel-types
https://oglok.github.io/2018-10-04-Interconnecting-VNFs-on-your-laptop/
코드 블럭 |
---|
language | xml |
---|
title | virsh dumpxml 86770ca2-685f-4c57-b215-350265c973c4 |
---|
linenumbers | true |
---|
|
<interface type='udp'>
<mac address='52:54:00:05:2d:cf'/>
<source address='127.0.0.1' port='21000'>
<local address='127.0.0.1' port='21001'/>
</source>
<model type='vmxnet3'/>
<alias name='net0'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
</interface>
...
<interface type='udp'>
<mac address='52:54:00:0d:32:f4'/>
<source address='127.0.0.1' port='21006'>
<local address='127.0.0.1' port='21007'/>
</source>
<model type='vmxnet3'/>
<alias name='net3'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
</interface> |
코드 블럭 |
---|
# virsh domiflist 86770ca2-685f-4c57-b215-350265c973c4
Interface Type Source Model MAC
----------------------------------------------------------
- udp - vmxnet3 52:54:00:05:2d:cf
- udp - vmxnet3 52:54:00:0f:2a:29
- udp - vmxnet3 52:54:00:04:be:e7
- udp - vmxnet3 52:54:00:0d:32:f4 |
https://docs.redhat.com/en/documentation/red_hat_enterprise_linux/7/html/virtualization_deployment_and_administration_guide/sect-statlists