How to mount the subpath of blockBlob container of storage account on the vm? - azure

I have a storage account name storeabc of blockblob type inside that I have a container named testcontainer. I created a folder inside the container named testfolder.
I can successfully mount the container(till the container only). using the below command.
mount -o sec=sys,vers=3,nolock,proto=tcp storeabc.blob.core.windows.net:/storeabc/testcontainer /nfsdata
However, I was looking for a way to mount the folder i.e. testfolder.
I tried,
mount -o sec=sys,vers=3,nolock,proto=tcp storeabc.blob.core.windows.net:/storeabc/testcontainer/testfolder /nfsdata
which ends up with the error.
mount.nfs: mounting storeabc.blob.core.windows.net:/storeabc/testcontainer/testfolder failed, reason given by server: No such file or directory
TIA.

mount.nfs: mounting storeabc.blob.core.windows.net:/storeabc/testcontainer/testfolder
failed, reason given by server: No such file or directory
According to this MS-document Known issues with Network File System (NFS) 3.0 protocol support for Azure Blob Storage .you can only mount the root directory i.e (Container). Mounting sub directories in azure blob storage not yet supported.
mount -o sec=sys,vers=3,nolock,proto=tcp <storage-account-name>.blob.core.windows.net:/<storage-account-name>/<container-name> /nfsdata
Please try to type the commands and avoid copy pasting as hidden characters in that command can cause these error.
Reference:
Mount Azure Blob Storage by using the NFS 3.0 protocol | Microsoft Docs

Related

mount point for Azure file share on VM

I am using Azure file share to sync large amounts of data between multiple machines. I followed the mounting docs to mount the file share to an Azure VM (running Ubuntu 20.04):
https://learn.microsoft.com/en-us/azure/storage/files/storage-how-to-use-files-linux?tabs=smb311
The Azure VM currently has a /data location with a 64 GB data drive that I elected as an additional option when the VM was created. I then mounted the fileshare at the /data location, mostly as a convenience to have the fileshare directory located in the same place as the local data. The file share mount is now located at /data/storage-account-name/fileshare-name.
When I run df, I can see the /data mount (filesystem /dev/sda1) and the /data/storage-account-name/fileshare-name mount (filesystem //storage-account-name.file.core.windows.net/fileshare-name). The two locations seem to be totally separate mounts, and everything is working as expected with the file share.
However, is it bad practice to mount the file share "on top" of the /data disk like this? Is it preferred to mount at /mnt or /media for any reason? Or is the mount location somewhat arbitrary?

Unmounting and Mounting fileshare in azure

I have a storage account where fileshare has been mounted which includes nearly 300+ files in that fileshare. Now if I try unmounting it with below command,
sudo umount /xyx/files
Then what is the command to mount it back? Is it
P
sudo mount /xyx/files ???
I have mounted initially from windows share to Linux OS . Do I need to use the same command or the above mount command?
If I use the same command then will there be any loss of my files?
I tried to reproduce the same in my environment I have mount a file share in storage account:
First make sure you have checked your storage account accessible from public network as below:
I tried to mount a sample file in azure storage account
I have mounted my sample files successfully as below:
To unmount the azure file share, make use of below command:
sudo umount /mnt/<yourfileshare>
In the event that any files are open, or any processes are running in the working directory, the file system cannot be unmounted.
To unmount a file share drive you can make use below command
net use <drive-letter> /delete
When you try to unmount the files once the execution has been complete the mount point will be deleted from that moment, we can't access the data through the mount point on the storage. if you want to restore the file if you have already enabled the soft delete. in file share some files are deleted in that time you can disable the soft delete and in file share you can enable show deleted shares option and you can make use of undelete.
Reference: Mount Azure Blob storage as a file system on Linux with BlobFuse | Microsoft Learn

Mounting azure blob to VM

I am trying to mount an azure blob with a Linux VM and I am successfully able to do it with the storage access key. Is there any other route to do the mount? Maybe using the SAS token or AD authentication. Any help is appreciated.
If you are using blobfuse and you want to mount a blob/container via SAS token, pls try the steps below:
create a connection.cfg file with content as official doc indicated: https://github.com/Azure/azure-storage-fuse/blob/master/connection.cfg
in my case :
Run mount command:
blobfuse /<-the path you want to mount-> --tmp-path=/mnt/blobfusetmp
-o attr_timeout=240 -o entry_timeout=240 -o negative_timeout=120 --config-file=<-path of your connection.cfg file-> --log-level=LOG_DEBUG --file-cache-timeout-in-seconds=120
In my case:
blobfuse /testcontainer --tmp-path=/mnt/blobfusetmp -o attr_timeout=240 -o entry_timeout=240 -o negative_timeout=120 --config-file=../connection.cfg --log-level=LOG_DEBUG --file-cache-timeout-in-seconds=120
As you can see I mounted a container which named: testcontainer, and there is only one file in this container:
And this is the result of mount command:
Let me know if it works as excepted or if you need any more assistances.

Mount Azure File share using cifs-utils and SAS Token

Is it possible to mount to Azure File share using mount.cifs and SAS token instead of Storage key? I tried this out but I got a Permission Denied, so I was wondering if this is possible.
sudo mount -t cifs //<storage account>.file.core.windows.net/<file share> <local path> -o vers=3.0,username=<storage account>,password="<sas token>",dir_mode=0777,file_mode=0777,serverino
Unfortunately, it's impossible to do that. The SAS token is not supported in mounting Azure File share currently, it just supports the Azure storage account key. You can take a look at the feedback.

Unable to provision OpenEBS volume on RancherOS

I am using Rancher v2 as the k8s management platform and running RancherOS nodes on VMware vSphere. I manually installed open-iSCSI and mounted a 50GB volumes on the worker nodes for use by OpenEBS (will have to figure out how to automate that on node creation). I also created a cStor storage class and that all looks good. However, I have not been able to get a container to provision a pv using a pvc.
Warning FailedMount Unable to mount volumes for pod "web-test-54d9845456-bc8fc_infra-test(10f856c1-6882-11e9-87a2-0050568eb63d)": timeout expired waiting for volumes to attach or mount for pod "infra-test"/"web-test-54d9845456-bc8fc". list of unmounted volumes=[cstor-vol-01]. list of unattached volumes=[web-test-kube-pvc vol1 man-volmnt-01 cstor-vol-01 default-token-lxffz]
Warning FailedMount MountVolume.WaitForAttach failed for volume "pvc-b59c9b5d-6857-11e9-87a2-0050568eb63d" : failed to get any path for iscsi disk, last err seen: iscsi: failed to sendtargets to portal 10.43.48.95:3260 output: iscsiadm: Could not open /run/lock/iscsi: No such file or directory iscsiadm: Could not open /run/lock/iscsi: No such file or directory iscsiadm: Could not open /run/lock/iscsi: No such file or directory iscsiadm: Could not add new discovery record. , err exit status
I have followed below steps to enable iSCSI on RancherOS from Prerquisitie section for RancherOS from OpenEBS documentation.
sudo ros s up open-iscsi
sudo ros config set rancher.services.user-volumes.volumes [/home:/home,/opt:/opt,/var/lib/kubelet:/var/lib/kubelet,/etc/kubernetes:/etc/kubernetes,/var/openebs]
sudo system-docker rm all-volumes
sudo reboot
From the github repository of Rancher OS, found that we need to create a lock directory, and make sure to create this directory every boot using the following way
$ mkdir /run/lock
# update cloud-config
#cloud-config
runcmd:
- [mkdir, /run/lock]
Reference path: github repo of rancher. Then find issue number 2435 under rancher/OS

Resources