Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add DiskIDTransform Rules #403

Merged
merged 13 commits into from
Jan 16, 2025
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@
"Linux": {
"PartitionerType": "parted",
"CreatePartitionIfNoEphemeralDisk": true,
"DevicePathResolutionType": "virtio"
"DevicePathResolutionType": "virtio",
"ServiceManager": "systemd",
"DiskIDTransformPattern": "^d-(.+)$",
"DiskIDTransformReplacement": "virtio-${1}"
}
},
"Infrastructure": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
"PartitionerType": "parted",
"DevicePathResolutionType": "virtio",
"CreatePartitionIfNoEphemeralDisk": true,
"ServiceManager": "systemd"
"ServiceManager": "systemd",
"DiskIDTransformPattern": "^(vol-(.+))$",
ramonskie marked this conversation as resolved.
Show resolved Hide resolved
"DiskIDTransformReplacement": "nvme-Amazon_Elastic_Block_Store_vol${2}"
}
},
"Infrastructure": {
Expand Down
61 changes: 61 additions & 0 deletions stemcell_builder/stages/bosh_aws_agent_settings/assets/agent.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# Disk ID transform rules
the following 2 json entries
```
"DiskIDTransformPattern": "^(vol-(.+))$",
"DiskIDTransformReplacement": "nvme-Amazon_Elastic_Block_Store_vol${2}"
```

## what it does
the `DiskIDTransformPattern` will match `vol-04b2a40747d7e9625` in to 2 groups `vol-` and `04b2a40747d7e9625`

the `DiskIDTransformReplacement` will match and replace `04b2a40747d7e9625` with `nvme-Amazon_Elastic_Block_Store_vol04b2a40747d7e9625`

## related information

contents of persistent_disk_hints.json
```
{
"vol-04b2a40747d7e9625": {
"ID": "vol-04b2a40747d7e9625",
"DeviceID": "",
"VolumeID": "/dev/disk/by-id/nvme-Amazon_Elastic_Block_Store_vol04b2a40747d7e9625",
"Lun": "",
"HostDeviceID": "",
"Path": "/dev/disk/by-id/nvme-Amazon_Elastic_Block_Store_vol04b2a40747d7e9625",
"ISCSISettings": {
"InitiatorName": "",
"Username": "",
"Target": "",
"Password": ""
},
"FileSystemType": "",
"MountOptions": null,
"Partitioner": ""
}
}
```

files listed in `/dev/disk/by-id`
```
nvme-Amazon_Elastic_Block_Store_vol04b2a40747d7e9625
nvme-Amazon_Elastic_Block_Store_vol04b2a40747d7e9625_1
nvme-Amazon_Elastic_Block_Store_vol04b2a40747d7e9625_1-part1
nvme-Amazon_Elastic_Block_Store_vol04b2a40747d7e9625-part1
nvme-Amazon_Elastic_Block_Store_vol0c2ee6da5d33b8f8b
nvme-Amazon_Elastic_Block_Store_vol0c2ee6da5d33b8f8b_1
nvme-Amazon_Elastic_Block_Store_vol0c2ee6da5d33b8f8b_1-part1
nvme-Amazon_Elastic_Block_Store_vol0c2ee6da5d33b8f8b_1-part2
nvme-Amazon_Elastic_Block_Store_vol0c2ee6da5d33b8f8b-part1
nvme-Amazon_Elastic_Block_Store_vol0c2ee6da5d33b8f8b-part2
nvme-Amazon_Elastic_Block_Store_vol0c67d3300b92fe851
nvme-Amazon_Elastic_Block_Store_vol0c67d3300b92fe851_1
nvme-Amazon_Elastic_Block_Store_vol0c67d3300b92fe851_1-part1
nvme-Amazon_Elastic_Block_Store_vol0c67d3300b92fe851-part1
nvme-nvme.1d0f-766f6c3034623261343037343764376539363235-416d617a6f6e20456c617374696320426c6f636b2053746f7265-00000001
nvme-nvme.1d0f-766f6c3034623261343037343764376539363235-416d617a6f6e20456c617374696320426c6f636b2053746f7265-00000001-part1
nvme-nvme.1d0f-766f6c3063326565366461356433336238663862-416d617a6f6e20456c617374696320426c6f636b2053746f7265-00000001
nvme-nvme.1d0f-766f6c3063326565366461356433336238663862-416d617a6f6e20456c617374696320426c6f636b2053746f7265-00000001-part1
nvme-nvme.1d0f-766f6c3063326565366461356433336238663862-416d617a6f6e20456c617374696320426c6f636b2053746f7265-00000001-part2
nvme-nvme.1d0f-766f6c3063363764333330306239326665383531-416d617a6f6e20456c617374696320426c6f636b2053746f7265-00000001
nvme-nvme.1d0f-766f6c3063363764333330306239326665383531-416d617a6f6e20456c617374696320426c6f636b2053746f7265-00000001-part1
```
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
"PartitionerType": "parted",
"DevicePathResolutionType": "virtio",
"VirtioDevicePrefix": "google",
"ServiceManager": "systemd"
"ServiceManager": "systemd",
"DiskIDTransformPattern": "^(disk-.+)$",
"DiskIDTransformReplacement": "google-${1}"
}
},
"Infrastructure": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
"PartitionerType": "parted",
"CreatePartitionIfNoEphemeralDisk": true,
"DevicePathResolutionType": "virtio",
"ServiceManager": "systemd"
"ServiceManager": "systemd",
"DiskIDTransformPattern": "^([0-9a-f]{8})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{12})$",
"DiskIDTransformReplacement": "scsi-${1}${2}${3}${4}${5}"
}
},
"Infrastructure": {
Expand Down