I am running into a couple of issues:
The first one is that the assignment of the naming of the block devices is not consistent between builds. So I am creating a vm and then adding more storage (using vagrant)
Code: Select all
VBoxManage createhd --filename disk-1.vdi --size 1000 --format VDI
VBoxManage storageattach server-1 --storagectl SATA Controller --port 1 --device 0 --type hdd --medium disk-1.vdi
VBoxManage createhd --filename disk-2.vdi --size 2000 --format VDI
VBoxManage storageattach server-1 --storagectl SATA Controller --port 2 --device 0 --type hdd --medium disk-2.vdi
Code: Select all
# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 40G 0 disk
├─sda1 8:1 0 1M 0 part
├─sda2 8:2 0 1G 0 part /boot
└─sda3 8:3 0 39G 0 part
├─VolGroup00-LogVol00 253:0 0 37.5G 0 lvm /
└─VolGroup00-LogVol01 253:1 0 1.5G 0 lvm [SWAP]
sdb 8:16 0 2G 0 disk
sdc 8:32 0 2G 0 disk
Code: Select all
[root@oss-1 ~]# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 3.9G 0 disk
sdb 8:16 0 3.9G 0 disk
sdc 8:32 0 40G 0 disk
├─sdc1 8:33 0 1M 0 part
├─sdc2 8:34 0 1G 0 part /boot
└─sdc3 8:35 0 39G 0 part
├─VolGroup00-LogVol00 253:0 0 37.5G 0 lvm /
└─VolGroup00-LogVol01 253:1 0 1.5G 0 lvm [SWAP]
The second problem is that I haven't found a good way to identify which block device corresponds to which storage attachment.
For example this storage attachment doesn't have any information that would allow me to know which block device it was in the guest (that I can find)...:
Code: Select all
$ VBoxManage showmediuminfo disk 8eeb4296-b12d-429f-aacf-7887109f006a
UUID: 8eeb4296-b12d-429f-aacf-7887109f006a
Parent UUID: base
State: locked write
Type: normal (base)
Location: /home/user/.cache/molecule/limepepper.lustre/default/disk-1.vdi
Storage format: VDI
Format variant: dynamic default
Capacity: 2000 MBytes
Size on disk: 2 MBytes
Encryption: disabled
Property: AllocationBlockSize=1048576
In use by VMs: default_server-1_1632947020173_28144 (UUID: 84807671-cffa-4628-a703-3433b67735a9)
and from the vminfo
Code: Select all
Storage Controller Name (0): IDE
Storage Controller Type (0): PIIX4
Storage Controller Instance Number (0): 0
Storage Controller Max Port Count (0): 2
Storage Controller Port Count (0): 2
Storage Controller Bootable (0): on
Storage Controller Name (1): SATA Controller
Storage Controller Type (1): IntelAhci
Storage Controller Instance Number (1): 0
Storage Controller Max Port Count (1): 30
Storage Controller Port Count (1): 30
Storage Controller Bootable (1): on
IDE (0, 0): /home/user/VirtualBox VMs/default_server-1_1632947020173_28144/Snapshots/{17f378ba-d5d1-4c64-b6d9-1cdaecbdbf97}.vmdk (UUID: 17f378ba-d5d1-4c64-b6d9-1cdaecbdbf97)
SATA Controller (1, 0): /home/user/.cache/molecule/limepepper.lustre/default/disk-1.vdi (UUID: 8eeb4296-b12d-429f-aacf-7887109f006a)
SATA Controller (2, 0): /home/user/.cache/molecule/limepepper.lustre/default/disk-2.vdi (UUID: 62884296-97c0-4815-8c19-75b4013eb8db)
Those values don't seem to match up with the IDs used in the guest, for example
Code: Select all
[root@server-1 ~]# lshw -class disk -class storage
*-ide
description: IDE interface
product: 82371AB/EB/MB PIIX4 IDE
vendor: Intel Corporation
physical id: 1.1
bus info: pci@0000:00:01.1
logical name: scsi0
version: 01
width: 32 bits
clock: 33MHz
capabilities: ide isa_compat_mode pci_native_mode bus_master emulated
configuration: driver=ata_piix latency=64
resources: irq:0 ioport:1f0(size=8) ioport:3f6 ioport:170(size=8) ioport:376 ioport:d000(size=16)
*-disk
description: ATA Disk
product: VBOX HARDDISK
vendor: VirtualBox
physical id: 0.0.0
bus info: scsi@0:0.0.0
logical name: /dev/sda
version: 1.0
serial: VBadc40c44-d88452e2
size: 40GiB (42GB)
capabilities: partitioned partitioned:dos
configuration: ansiversion=5 logicalsectorsize=512 sectorsize=512 signature=000a218d
*-sata
description: SATA controller
product: 82801HM/HEM (ICH8M/ICH8M-E) SATA Controller [AHCI mode]
vendor: Intel Corporation
physical id: d
bus info: pci@0000:00:0d.0
logical name: scsi3
logical name: scsi4
version: 02
width: 32 bits
clock: 33MHz
capabilities: sata pm ahci_1.0 bus_master cap_list emulated
configuration: driver=ahci latency=64
resources: irq:21 ioport:d248(size=8) ioport:d250(size=4) ioport:d258(size=8) ioport:d260(size=4) ioport:d270(size=16) memory:f0840000-f0841fff
*-disk:0
description: ATA Disk
product: VBOX HARDDISK
vendor: VirtualBox
physical id: 0
bus info: scsi@3:0.0.0
logical name: /dev/sdb
version: 1.0
serial: VB8eeb4296-6a009f10
size: 2000MiB (2097MB)
configuration: ansiversion=5 logicalsectorsize=512 sectorsize=512
*-disk:1
description: ATA Disk
product: VBOX HARDDISK
vendor: VirtualBox
physical id: 1
bus info: scsi@4:0.0.0
logical name: /dev/sdc
version: 1.0
serial: VB62884296-dbb83e01
size: 2000MiB (2097MB)
configuration: ansiversion=5 logicalsectorsize=512 sectorsize=512