Skip to content

Commit

Permalink
feat: pass nvme disks into infra vm
Browse files Browse the repository at this point in the history
  • Loading branch information
ArthurVardevanyan committed Jan 29, 2024
1 parent 50a34af commit c38ae4a
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 192 deletions.
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -207,10 +207,15 @@ sudo virsh dumpxml worker-6 > worker-6.xml
#### OKD Longhorn Secondary Disk Setup

```bash
# https://askubuntu.com/questions/144894/add-physical-disk-to-kvm-virtual-machine
sudo mkfs.ext4 -L longhorn /dev/nvme0n1
sudo mkfs.ext4 -L longhorn1 /dev/nvme1n1

# Sandbox
sudo mkfs.ext4 -L longhorn /dev/vdb
sudo mkfs.ext4 -L longhorn1 /dev/vdc

# Pre Machine Config
# Pre Machine Config (Sandbox)
sudo su
echo "/dev/vdb /var/mnt/longhorn auto nofail" > /etc/fstab
sudo reboot
Expand Down
79 changes: 13 additions & 66 deletions okd/vms/xml/infra-1.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<domain type='kvm' id='2' xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'>
<domain type='kvm' xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'>
<name>infra-1</name>
<uuid>b590d381-7c39-4665-be05-b0a5f536cc2f</uuid>
<metadata>
Expand All @@ -9,9 +9,6 @@
<memory unit='KiB'>7340032</memory>
<currentMemory unit='KiB'>7340032</currentMemory>
<vcpu placement='static'>4</vcpu>
<resource>
<partition>/machine</partition>
</resource>
<os>
<type arch='x86_64' machine='pc-q35-rhel9.2.0'>hvm</type>
<boot dev='hd' />
Expand Down Expand Up @@ -39,182 +36,132 @@
<emulator>/usr/libexec/qemu-kvm</emulator>
<disk type='file' device='disk'>
<driver name='qemu' type='raw' cache='none' />
<source file='/home/okd/infra-1.raw' index='3' />
<backingStore />
<source file='/home/okd/infra-1.raw' />
<target dev='vda' bus='virtio' />
<alias name='virtio-disk0' />
<address type='pci' domain='0x0000' bus='0x04' slot='0x00' function='0x0' />
</disk>
<disk type='file' device='disk'>
<driver name='qemu' type='raw' cache='none' />
<source file='/mnt/storage-1/infra-1_storage.raw' index='2' />
<backingStore />
<disk type='block' device='disk'>
<driver name='qemu' type='raw' cache='none' discard='unmap' />
<source dev='/dev/nvme0n1' />
<target dev='vdb' bus='virtio' />
<alias name='virtio-disk1' />
<address type='pci' domain='0x0000' bus='0x05' slot='0x00' function='0x0' />
</disk>
<disk type='file' device='disk'>
<disk type='block' device='disk'>
<driver name='qemu' type='raw' cache='none' discard='unmap' />
<source file='/mnt/storage/infra-1_storage.raw' index='1' />
<backingStore />
<source dev='/dev/nvme1n1' />
<target dev='vdc' bus='virtio' />
<alias name='virtio-disk2' />
<address type='pci' domain='0x0000' bus='0x08' slot='0x00' function='0x0' />
</disk>
<controller type='usb' index='0' model='qemu-xhci' ports='15'>
<alias name='usb' />
<address type='pci' domain='0x0000' bus='0x02' slot='0x00' function='0x0' />
</controller>
<controller type='pci' index='0' model='pcie-root'>
<alias name='pcie.0' />
</controller>
<controller type='pci' index='0' model='pcie-root' />
<controller type='pci' index='1' model='pcie-root-port'>
<model name='pcie-root-port' />
<target chassis='1' port='0x8' />
<alias name='pci.1' />
<address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0' multifunction='on' />
</controller>
<controller type='pci' index='2' model='pcie-root-port'>
<model name='pcie-root-port' />
<target chassis='2' port='0x9' />
<alias name='pci.2' />
<address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1' />
</controller>
<controller type='pci' index='3' model='pcie-root-port'>
<model name='pcie-root-port' />
<target chassis='3' port='0xa' />
<alias name='pci.3' />
<address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2' />
</controller>
<controller type='pci' index='4' model='pcie-root-port'>
<model name='pcie-root-port' />
<target chassis='4' port='0xb' />
<alias name='pci.4' />
<address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x3' />
</controller>
<controller type='pci' index='5' model='pcie-root-port'>
<model name='pcie-root-port' />
<target chassis='5' port='0xc' />
<alias name='pci.5' />
<address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x4' />
</controller>
<controller type='pci' index='6' model='pcie-root-port'>
<model name='pcie-root-port' />
<target chassis='6' port='0xd' />
<alias name='pci.6' />
<address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x5' />
</controller>
<controller type='pci' index='7' model='pcie-root-port'>
<model name='pcie-root-port' />
<target chassis='7' port='0xe' />
<alias name='pci.7' />
<address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x6' />
</controller>
<controller type='pci' index='8' model='pcie-root-port'>
<model name='pcie-root-port' />
<target chassis='8' port='0xf' />
<alias name='pci.8' />
<address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x7' />
</controller>
<controller type='pci' index='9' model='pcie-root-port'>
<model name='pcie-root-port' />
<target chassis='9' port='0x10' />
<alias name='pci.9' />
<address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0' multifunction='on' />
</controller>
<controller type='pci' index='10' model='pcie-root-port'>
<model name='pcie-root-port' />
<target chassis='10' port='0x11' />
<alias name='pci.10' />
<address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x1' />
</controller>
<controller type='pci' index='11' model='pcie-root-port'>
<model name='pcie-root-port' />
<target chassis='11' port='0x12' />
<alias name='pci.11' />
<address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x2' />
</controller>
<controller type='pci' index='12' model='pcie-root-port'>
<model name='pcie-root-port' />
<target chassis='12' port='0x13' />
<alias name='pci.12' />
<address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x3' />
</controller>
<controller type='pci' index='13' model='pcie-root-port'>
<model name='pcie-root-port' />
<target chassis='13' port='0x14' />
<alias name='pci.13' />
<address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x4' />
</controller>
<controller type='pci' index='14' model='pcie-root-port'>
<model name='pcie-root-port' />
<target chassis='14' port='0x15' />
<alias name='pci.14' />
<address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x5' />
</controller>
<controller type='sata' index='0'>
<alias name='ide' />
<address type='pci' domain='0x0000' bus='0x00' slot='0x1f' function='0x2' />
</controller>
<controller type='virtio-serial' index='0'>
<alias name='virtio-serial0' />
<address type='pci' domain='0x0000' bus='0x03' slot='0x00' function='0x0' />
</controller>
<interface type='bridge'>
<mac address='10:00:00:00:01:21' />
<source bridge='br0' />
<target dev='vnet1' />
<model type='virtio' />
<alias name='net0' />
<address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0' />
</interface>
<serial type='pty'>
<source path='/dev/pts/1' />
<target type='isa-serial' port='0'>
<model name='isa-serial' />
</target>
<alias name='serial0' />
</serial>
<console type='pty' tty='/dev/pts/1'>
<source path='/dev/pts/1' />
<console type='pty'>
<target type='serial' port='0' />
<alias name='serial0' />
</console>
<channel type='unix'>
<source mode='bind'
path='/var/lib/libvirt/qemu/channel/target/domain-2-infra-1/org.qemu.guest_agent.0' />
<target type='virtio' name='org.qemu.guest_agent.0' state='connected' />
<alias name='channel0' />
<target type='virtio' name='org.qemu.guest_agent.0' />
<address type='virtio-serial' controller='0' bus='0' port='1' />
</channel>
<input type='mouse' bus='ps2'>
<alias name='input0' />
</input>
<input type='keyboard' bus='ps2'>
<alias name='input1' />
</input>
<input type='mouse' bus='ps2' />
<input type='keyboard' bus='ps2' />
<audio id='1' type='none' />
<watchdog model='itco' action='reset'>
<alias name='watchdog0' />
</watchdog>
<watchdog model='itco' action='reset' />
<memballoon model='virtio'>
<alias name='balloon0' />
<address type='pci' domain='0x0000' bus='0x06' slot='0x00' function='0x0' />
</memballoon>
<rng model='virtio'>
<backend model='random'>/dev/urandom</backend>
<alias name='rng0' />
<address type='pci' domain='0x0000' bus='0x07' slot='0x00' function='0x0' />
</rng>
</devices>
<seclabel type='dynamic' model='selinux' relabel='yes'>
<label>system_u:system_r:svirt_t:s0:c45,c517</label>
<imagelabel>system_u:object_r:svirt_image_t:s0:c45,c517</imagelabel>
</seclabel>
<seclabel type='dynamic' model='dac' relabel='yes'>
<label>+107:+107</label>
<imagelabel>+107:+107</imagelabel>
</seclabel>
<qemu:commandline>
<qemu:arg value='-fw_cfg' />
<qemu:arg value='name=opt/com.coreos/config,file=/var/lib/libvirt/images/worker.ign' />
Expand Down
Loading

0 comments on commit c38ae4a

Please sign in to comment.