在 1 秒内安装 Azure 磁盘。可以安装多个磁盘。可以将它们安装在任何位置。dysk 将 Azure 磁盘作为 Linux 块设备直接安装在 VM 上。
在 1 秒内安装 Azure 磁盘。可以安装多个磁盘。可以将它们安装在任何位置。dysk 将 Azure 磁盘作为 Linux 块设备直接安装在 VM 上。
Attach Azure disks in Check Design for details on how dysk works.
Dysk works with storage accounts V1 or V2[storage api version:2017-04-17]. Premium SKU is subject to size based throttling. Please install dysk kernel module before running the below commands.
Auto-Create and mount 2 GB Azure Page Blob as a block device
sudo dyskctl mount auto-create -a {STORAGE ACCOUNT NAME} -k {STORAGE ACCOUNT KEY}
## output
Created PageBlob in account:xdysk dysks/dysk6Hjr5R52.vhd(2GiB)
Wrote VHD header for PageBlob in account:xdysk dysks/dysk6Hjr5R52.vhd
Type Name VHD SizeGB AccountName Path
RW dysk6Hjr5R52 Yes 2 xdysk /dysks/dysk6Hjr5R52.vhdWhen using the auto-create command the client library by default writes the vhd footer for you. This enables you to mount the disk using ARM if needed. You can disable this using the
-vhdflag Make sure the storage account supports http (not https)
Mount existing Azure Page Blob (with or without a lease id)
sudo dyskctl mount -a {STORAGE ACCOUNT NAME} -k {STORAGE ACCOUNT KEY} -c {CONTAINER NAME} -d {DISK NAME} -i {LEASE ID}
## output
Type Name VHD SizeGB AccountName Path
RW dysk1cmwC5uU Yes 2 dyskdemo /dysks/dysk1cmwC5uU.vhdMount an existing Azure Page Blob (with a SAS):
sudo dyskctl mount -a {STORAGE ACCOUNT NAME} -s {SAS URL} -p dyskHrcjoIj4.vhd -l -b
## SAS URLs are currently using this format:
## "se=2020-04-05T20%3A13%3A24Z&sig=foo%3D&sp=rw&sr=b&sv=2017-04-01"If you are seeing error storage: service returned error: StatusCode=409, ErrorCode=LeaseAlreadyPresent, ErrorMessage=There is already a lease present., you can set the --break-lease flag to true to break the existing lease.
sudo dyskctl mount -a {STORAGE ACCOUNT NAME} -k {STORAGE ACCOUNT KEY} -c {CONTAINER NAME} -d {DISK NAME} -i {LEASE ID} -b true
## output
lease not valid
acquiring new lease
break lease
Type Name VHD SizeGB AccountName Path
RW dysk1cmwC5uU Yes 2 dyskdemo /dysks/dysk1cmwC5uU.vhdIf you do not provide a
--lease-id, you will most likely need to set the--break-leaseflag totrueto break any existing lease on it. Unless it has been previously released.
Dysks are block devices, so it can be used using common Linux commands
#List block devices
lsblk
# dysks can be formatted as regular disks using mkfs command, example:
sudo mkfs.ext4 /dev/dysk6Hjr5R52 #Device name from the output above.Dysks can be mounted as read-only (on many nodes) devices using the --read-only flag
You can list dysks using the following command
…Keys are never stored, they are kept in module's kernel memory.
Unmounting using the following command
sudo dyskctl unmount -d dysk6Hjr5R52 for further CLI commands execute
dyskctl --help
The kernel module is licensed as GPLv2 and the rest of the repo is licensed as MIT
暂无开放 Issues,或尚未同步最近议题。