aws / aws/eks-anywhere

What's the right setting of DEST_DISK for the stream-image action

Open
#7,109 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
2.1k
Forks
328
Avg merge
1d 4h
Merged PRs (30d)
9

Description

In https://anywhere.eks.amazonaws.com/docs/getting-started/baremetal/bare-spec/, I find this note:

`NOTE: For the stream-image action, DEST_DISK points to the device representing the entire hard disk (for example, /dev/sda). For UEFI-enabled images, such as Ubuntu, write actions use DEST_DISK to point to the second partition (for example, /dev/sda2), with the first being the EFI partition. For the Bottlerocket image, which has 12 partitions, DEST_DISK is partition 12 (for example, /dev/sda12). Device names will be different for different disk types.`

And both the Ubuntu and the Bottlerocket TinkerbellTemplateConfig examples use the same environment w.r.t DEST_DISK in action "stream-image":
` DEST_DISK: /dev/sda`

However, in code https://github.com/tinkerbell/hub/blob/main/actions/image2disk/v1/main.go#L14-L22, I don't see the different write actions for Ubuntu and Bottlerocket, instead, it uses the $DESK_DISK directly:

```
disk := os.Getenv("DEST_DISK")
img := os.Getenv("IMG_URL")
compressedEnv := os.Getenv("COMPRESSED")
// We can ignore the error and default compressed to false.
cmp, _ := strconv.ParseBool(compressedEnv)
// Write the image to disk
err := image.Write(img, disk, cmp)
```

How are /dev/sda2 and /dev/sda12 introduced (for Ubuntu and Bottlerocket, respectively) ?

What are the right setting of DEST_DISK for the stream-image action?

What are the APIs/tools can be used to find the right value of DEST_DISK in the go code of action "image2disk" ?

Contributor guide

Open the contributing guide

Research direction

Compare the bare-metal specification at anywhere.eks.amazonaws.com/docs/getting-started/baremetal/bare-spec/ with hub/actions/image2disk/v1/main.go, focusing on how DEST_DISK is passed to image.Write. Trace the Ubuntu and Bottlerocket examples and document the correct setting, how the partition values arise, and which APIs or tools determine it.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
documentation
Issue type
Documentation
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.