diff --git a/stemcell_builder/stages/bosh_alicloud_agent_settings/assets/agent.json b/stemcell_builder/stages/bosh_alicloud_agent_settings/assets/agent.json index 43e4cf737..b94e416da 100644 --- a/stemcell_builder/stages/bosh_alicloud_agent_settings/assets/agent.json +++ b/stemcell_builder/stages/bosh_alicloud_agent_settings/assets/agent.json @@ -3,7 +3,10 @@ "Linux": { "PartitionerType": "parted", "CreatePartitionIfNoEphemeralDisk": true, - "DevicePathResolutionType": "virtio" + "DevicePathResolutionType": "virtio", + "ServiceManager": "systemd", + "DiskIDTransformPattern": "^d-(.+)$", + "DiskIDTransformReplacement": "virtio-${1}" } }, "Infrastructure": { diff --git a/stemcell_builder/stages/bosh_alicloud_agent_settings/assets/agent.md b/stemcell_builder/stages/bosh_alicloud_agent_settings/assets/agent.md new file mode 100644 index 000000000..107443111 --- /dev/null +++ b/stemcell_builder/stages/bosh_alicloud_agent_settings/assets/agent.md @@ -0,0 +1,52 @@ +# Introduction +The problem that we have is that the diskID provided by the IAAS does not correspond with the diskID on the vm as you can see in the related information part. +Therefore, we are trying to mitigate this issue by using diskIdTransformation as you can see in the example below + +Do note that if this fails it will always fallback to other means of mounting the disk + +## Disk ID transform rules +the following 2 json entries +``` +"DiskIDTransformPattern": "^d-(.+)$", +"DiskIDTransformReplacement": "virtio-${1}" +``` + +## what it does +the `DiskIDTransformPattern` will match `d-gw8ibkvqdrmdqzwpo4rk` in to 2 groups `d-` and `gw8ibkvqdrmdqzwpo4rk` +the `DiskIDTransformReplacement` will match and replace `gw8ibkvqdrmdqzwpo4rk` with `virtio-gw8a1q0dqyqmcjrnetpj` + +the agent will then glob and mount `/dev/disk/by-id/virtio-gw8a1q0dqyqmcjrnetpj` + +## related information +contents of `persistent_disk_hints.json` +``` +{ + "d-gw8ibkvqdrmdqzwpo4rk": { + "ID": "d-gw8ibkvqdrmdqzwpo4rk", + "DeviceID": "", + "VolumeID": "/dev/disk/by-id/virtio-gw8ibkvqdrmdqzwpo4rk", + "Lun": "", + "HostDeviceID": "", + "Path": "/dev/disk/by-id/virtio-gw8ibkvqdrmdqzwpo4rk", + "ISCSISettings": { + "InitiatorName": "", + "Username": "", + "Target": "", + "Password": "" + }, + "FileSystemType": "", + "MountOptions": null, + "Partitioner": "" + } +} +``` +files listed in `/dev/disk/by-id` +``` +virtio-gw8a1q0dqyqmcjrnetpj +virtio-gw8a1q0dqyqmcjrnetpj-part1 +virtio-gw8a1q0dqyqmcjrnetpj-part2 +virtio-gw8au7up14j66ge6u4vs +virtio-gw8au7up14j66ge6u4vs-part1 +virtio-gw8ibkvqdrmdqzwpo4rk +virtio-gw8ibkvqdrmdqzwpo4rk-part1 +``` \ No newline at end of file diff --git a/stemcell_builder/stages/bosh_aws_agent_settings/assets/agent.json b/stemcell_builder/stages/bosh_aws_agent_settings/assets/agent.json index 1bcdf1171..2a0f10a3b 100644 --- a/stemcell_builder/stages/bosh_aws_agent_settings/assets/agent.json +++ b/stemcell_builder/stages/bosh_aws_agent_settings/assets/agent.json @@ -4,7 +4,9 @@ "PartitionerType": "parted", "DevicePathResolutionType": "virtio", "CreatePartitionIfNoEphemeralDisk": true, - "ServiceManager": "systemd" + "ServiceManager": "systemd", + "DiskIDTransformPattern": "^vol-(.+)$", + "DiskIDTransformReplacement": "nvme-Amazon_Elastic_Block_Store_vol${1}" } }, "Infrastructure": { diff --git a/stemcell_builder/stages/bosh_aws_agent_settings/assets/agent.md b/stemcell_builder/stages/bosh_aws_agent_settings/assets/agent.md new file mode 100644 index 000000000..645d18deb --- /dev/null +++ b/stemcell_builder/stages/bosh_aws_agent_settings/assets/agent.md @@ -0,0 +1,67 @@ +# Introduction +The problem that we have is that the diskID provided by the IAAS does not correspond with the diskID on the vm as you can see in the related information part. +Therefore, we are trying to mitigate this issue by using diskIdTransformation as you can see in the example below + +Do note that if this fails it will always fallback to other means of mounting the disk + +## Disk ID transform rules +the following 2 json entries +``` +"DiskIDTransformPattern": "^vol-(.+)$", +"DiskIDTransformReplacement": "nvme-Amazon_Elastic_Block_Store_vol${1}" +``` + +## what it does +the `DiskIDTransformPattern` will match `vol-04b2a40747d7e9625` in to 1 group `04b2a40747d7e9625` +the `DiskIDTransformReplacement` will match and replace `04b2a40747d7e9625` with `nvme-Amazon_Elastic_Block_Store_vol04b2a40747d7e9625` + +the agent will then glob and mount `/dev/disk/by-id/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 +``` \ No newline at end of file diff --git a/stemcell_builder/stages/bosh_google_agent_settings/assets/agent.json b/stemcell_builder/stages/bosh_google_agent_settings/assets/agent.json index 4927e7370..ca2721745 100644 --- a/stemcell_builder/stages/bosh_google_agent_settings/assets/agent.json +++ b/stemcell_builder/stages/bosh_google_agent_settings/assets/agent.json @@ -5,7 +5,9 @@ "PartitionerType": "parted", "DevicePathResolutionType": "virtio", "VirtioDevicePrefix": "google", - "ServiceManager": "systemd" + "ServiceManager": "systemd", + "DiskIDTransformPattern": "^(disk-.+)$", + "DiskIDTransformReplacement": "google-${1}" } }, "Infrastructure": { diff --git a/stemcell_builder/stages/bosh_google_agent_settings/assets/agent.md b/stemcell_builder/stages/bosh_google_agent_settings/assets/agent.md new file mode 100644 index 000000000..1e8e78ae5 --- /dev/null +++ b/stemcell_builder/stages/bosh_google_agent_settings/assets/agent.md @@ -0,0 +1,61 @@ +# Introduction +The problem that we have is that the diskID provided by the IAAS does not correspond with the diskID on the vm as you can see in the related information part. +Therefore, we are trying to mitigate this issue by using diskIdTransformation as you can see in the example below + +Do note that if this fails it will always fallback to other means of mounting the disk + +## Disk ID transform rules +the following 2 json entries +``` +"DiskIDTransformPattern": "^(disk-.+)$", +"DiskIDTransformReplacement": "google-${1}" +``` + +## what it does +the `DiskIDTransformPattern` will match `disk-69e53b13-76b3-4400-4437-633782a5cbb5` in to 1 group `disk-69e53b13-76b3-4400-4437-633782a5cbb5` +the `DiskIDTransformReplacement` will match and replace ``disk-69e53b13-76b3-4400-4437-633782a5cbb5` with `google-disk-69e53b13-76b3-4400-4437-633782a5cbb5` + +the agent will then glob and mount `/dev/disk/by-id/google-disk-69e53b13-76b3-4400-4437-633782a5cbb5` + +## related information +contents of `persistent_disk_hints.json` +``` +{ + "disk-69e53b13-76b3-4400-4437-633782a5cbb5": { + "ID": "disk-69e53b13-76b3-4400-4437-633782a5cbb5", + "DeviceID": "", + "VolumeID": "/dev/sdb", + "Lun": "", + "HostDeviceID": "", + "Path": "/dev/sdb", + "ISCSISettings": { + "InitiatorName": "", + "Username": "", + "Target": "", + "Password": "" + }, + "FileSystemType": "", + "MountOptions": null, + "Partitioner": "" + } +} +``` + +files listed in `/dev/disk/by-id` +``` +google-disk-69e53b13-76b3-4400-4437-633782a5cbb5 +google-disk-69e53b13-76b3-4400-4437-633782a5cbb5-part1 +google-persistent-disk-0 +google-persistent-disk-0-part1 +google-persistent-disk-0-part2 +google-persistent-disk-0-part3 +google-persistent-disk-0-part4 +scsi-0Google_PersistentDisk_disk-69e53b13-76b3-4400-4437-633782a5cbb5 +scsi-0Google_PersistentDisk_disk-69e53b13-76b3-4400-4437-633782a5cbb5-part1 +scsi-0Google_PersistentDisk_persistent-disk-0 +scsi-0Google_PersistentDisk_persistent-disk-0-part1 +scsi-0Google_PersistentDisk_persistent-disk-0-part2 +scsi-0Google_PersistentDisk_persistent-disk-0-part3 +scsi-0Google_PersistentDisk_persistent-disk-0-part4 +```nvme.1d0f-766f6c3063363764333330306239326665383531-416d617a6f6e20456c617374696320426c6f636b2053746f7265-00000001-part1 +``` \ No newline at end of file diff --git a/stemcell_builder/stages/bosh_openstack_agent_settings/assets/agent.json b/stemcell_builder/stages/bosh_openstack_agent_settings/assets/agent.json index 30ce5d9c8..a6e17ce01 100644 --- a/stemcell_builder/stages/bosh_openstack_agent_settings/assets/agent.json +++ b/stemcell_builder/stages/bosh_openstack_agent_settings/assets/agent.json @@ -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": { diff --git a/stemcell_builder/stages/bosh_openstack_agent_settings/assets/agent.md b/stemcell_builder/stages/bosh_openstack_agent_settings/assets/agent.md new file mode 100644 index 000000000..7a79c538c --- /dev/null +++ b/stemcell_builder/stages/bosh_openstack_agent_settings/assets/agent.md @@ -0,0 +1,58 @@ +# Introduction +The problem that we have is that the diskID provided by the IAAS does not correspond with the diskID on the vm as you can see in the related information part. +Therefore, we are trying to mitigate this issue by using diskIdTransformation as you can see in the example below + +Do note that if this fails it will always fallback to other means of mounting the disk + +## Disk ID transform rules +the following 2 json entries +``` +"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}" +``` + +## what it does +the `DiskIDTransformPattern` will match `05c185c6-e8a3-4216-ab30-1f5cf7d17f0d` in to 5 groups `05c185c6`, `e8a3`, `4216`, `ab30`, `1f5cf7d17f0d` +the `DiskIDTransformReplacement` will match and replace `scsi-` with the 5 groups `scsi-305c185c6e8a34216ab301f5cf7d17f0d` + +the agent will then glob and mount `/dev/disk/by-id/scsi-305c185c6e8a34216ab301f5cf7d17f0d` + +## related information +contents of `persistent_disk_hints.json` +``` +{ + "05c185c6-e8a3-4216-ab30-1f5cf7d17f0d": { + "ID": "05c185c6-e8a3-4216-ab30-1f5cf7d17f0d", + "DeviceID": "", + "VolumeID": "/dev/sdb", + "Lun": "", + "HostDeviceID": "", + "Path": "/dev/sdb", + "ISCSISettings": { + "InitiatorName": "", + "Username": "", + "Target": "", + "Password": "" + }, + "FileSystemType": "", + "MountOptions": null, + "Partitioner": "" + } +} +``` + +files listed in `/dev/disk/by-id` +``` +scsi-305c185c6e8a34216ab301f5cf7d17f0d +scsi-305c185c6e8a34216ab301f5cf7d17f0d-part1 +scsi-36000c295e04c2c9a4b447d59632b887b +scsi-36000c295e04c2c9a4b447d59632b887b-part1 +scsi-36000c295e04c2c9a4b447d59632b887b-part2 +scsi-36000c295e04c2c9a4b447d59632b887b-part3 +wwn-0x05c185c6e8a34216ab301f5cf7d17f0d +wwn-0x05c185c6e8a34216ab301f5cf7d17f0d-part1 +wwn-0x6000c295e04c2c9a4b447d59632b887b +wwn-0x6000c295e04c2c9a4b447d59632b887b-part1 +wwn-0x6000c295e04c2c9a4b447d59632b887b-part2 +wwn-0x6000c295e04c2c9a4b447d59632b887b-part3 +``` \ No newline at end of file