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 nvme support #5263

Merged
merged 2 commits into from
May 30, 2024
Merged
Changes from all 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
11 changes: 10 additions & 1 deletion cloudinit/config/cc_disk_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import logging
import os
import shlex
from pathlib import Path
from textwrap import dedent

from cloudinit import subp, util
Expand Down Expand Up @@ -915,7 +916,15 @@ def mkfs(fs_cfg):
if not partition or partition.isdigit():
# Handle manual definition of partition
if partition.isdigit():
# nvme support
# https://github.com/torvalds/linux/blob/45db3ab/block/partitions
# /core.c#L330
if device[-1].isdigit():
device = f"{device}p"
device = "%s%s" % (device, partition)
if not Path(device).is_block_device():
LOG.warning("Path %s does not exist or is not a block device")
return
LOG.debug(
"Manual request of partition %s for %s", partition, device
)
Expand All @@ -937,7 +946,7 @@ def mkfs(fs_cfg):
LOG.debug("Device %s has required file system", device)
return
else:
LOG.warning("Destroying filesystem on %s", device)
LOG.debug("Destroying filesystem on %s", device)

else:
LOG.debug("Device %s is cleared for formatting", device)
Expand Down
Loading