You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/lab-services/how-to-attach-external-storage.md
+10-19Lines changed: 10 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,9 +12,6 @@ ms.date: 04/25/2023
12
12
13
13
# Use external file storage in Azure Lab Services
14
14
15
-
> [!CAUTION]
16
-
> This article references CentOS, a Linux distribution that is nearing End Of Life (EOL) status. Please consider your use and planning accordingly. For more information, see the [CentOS End Of Life guidance](~/articles/virtual-machines/workloads/centos/centos-end-of-life.md).
17
-
18
15
This article covers some of the options for using external file storage in Azure Lab Services. [Azure Files](https://azure.microsoft.com/services/storage/files/) offers fully managed file shares in the cloud, [accessible via SMB 2.1 and SMB 3.0](/azure/storage/files/storage-how-to-use-files-windows). An Azure Files share can be connected either publicly or privately within a virtual network. You can also configure the share to use a lab user’s Active Directory credentials for connecting to the file share. If you're on a Linux machine, you can also use Azure NetApp Files with NFS volumes for external file storage with Azure Lab Services.
19
16
20
17
## Which solution to use
@@ -27,7 +24,7 @@ The following table lists important considerations for each external storage sol
27
24
|[Azure Files share with private endpoint](#azure-files-share)| <ul><li>Everyone has read/write access.</li><li>Virtual network peering is required.</li><li>Accessible only to VMs on the same network (or a peered network) as the storage account.</li><li>If you're using Linux, lab users have access to the storage account key.</li></ul> |
28
25
| [Azure NetApp Files with NFS volumes](#azure-netapp-files-with-nfs-volumes) | <ul><li>Either read or read/write access can be set for volumes.</li><li>Permissions are set by using a lab VM’s IP address.</li><li>Virtual network peering is required.</li><li>You might need to register to use the Azure NetApp Files service.</li><li>Linux only.</li></ul>
29
26
30
-
The cost of using external storage isn't included in the cost of using Azure Lab Services. For more information about pricing, see [Azure Files pricing](https://azure.microsoft.com/pricing/details/storage/files/) and [Azure NetApp Files pricing](https://azure.microsoft.com/pricing/details/netapp/).
27
+
The cost of using external storage isn't included in the cost of using Azure Lab Services. For more information about pricing, see [Azure Files pricing](https://azure.microsoft.com/pricing/details/storage/files/) and [Azure NetApp Files pricing](https://azure.microsoft.com/pricing/details/netapp/).
31
28
32
29
## Azure Files share
33
30
@@ -39,23 +36,23 @@ By default, standard file shares can span up to 5 TiB. See [Create an Azure file
39
36
40
37
- The virtual network for the storage account doesn't have to be connected to the lab virtual network. You can create the file share anytime before the template VM is published.
41
38
- The file share can be accessed from any machine if a user has the storage account key.
42
-
- Linux lab users can see the storage account key. Credentials for mounting an Azure Files share are stored in `{file-share-name}.cred` on Linux VMs, and are readable by *sudo*. Because lab users are given sudo access by default in Azure Lab Services VMs, they can read the storage account key. If the storage account endpoint is public, lab users can get access to the file share outside of their lab VM. Consider rotating the storage account key after class has ended, or using private file shares.
39
+
- Linux lab users can see the storage account key. Credentials for mounting an Azure Files share are stored in `{file-share-name}.cred` on Linux VMs, and are readable by *sudo*. Because lab users are given sudo access by default in Azure Lab Services VMs, they can read the storage account key. If the storage account endpoint is public, lab users can get access to the file share outside of their lab VM. Consider rotating the storage account key after class ends, or using private file shares.
43
40
44
41
### Considerations for using a private endpoint
45
42
46
-
- This approach requires the file share virtual network to be connected to the lab. To enable advanced networking for labs, see [Connect to your virtual network in Azure Lab Services using vnet injection](how-to-connect-vnet-injection.md). VNet injection must be done during lab plan creation.
43
+
- This approach requires the file share virtual network to be connected to the lab. To enable advanced networking for labs, see [Connect to your virtual network in Azure Lab Services using virtual network injection](how-to-connect-vnet-injection.md). Virtual network injection must be done during lab plan creation.
47
44
- Access is restricted to traffic originating from the private network, and can’t be accessed through the public internet. Only VMs in the private virtual network, VMs in a network peered to the private virtual network, or machines connected to a VPN for the private network, can access the file share.
48
-
- Linux lab users can see the storage account key. Credentials for mounting an Azure Files share are stored in `{file-share-name}.cred` on Linux VMs, and are readable by *sudo*. Because lab users are given sudo access by default in Azure Lab Services VMs, they can read the storage account key. Consider rotating the storage account key after class has ended.
45
+
- Linux lab users can see the storage account key. Credentials for mounting an Azure Files share are stored in `{file-share-name}.cred` on Linux VMs, and are readable by *sudo*. Because lab users are given sudo access by default in Azure Lab Services VMs, they can read the storage account key. Consider rotating the storage account key after class ends.
49
46
50
47
### Connect a lab VM to an Azure file share
51
48
52
49
Follow these steps to create a VM connected to an Azure file share.
53
50
54
51
1. Create an [Azure Storage account](/azure/storage/files/storage-how-to-create-file-share). On the **Connectivity method** page, choose **public endpoint** or **private endpoint**.
55
52
56
-
1. If you've chosen the private method, create a [private endpoint](/azure/private-link/tutorial-private-endpoint-storage-portal) in order for the file shares to be accessible from the virtual network.
53
+
1. If using the private method, create a [private endpoint](/azure/private-link/tutorial-private-endpoint-storage-portal) in order for the file shares to be accessible from the virtual network.
57
54
58
-
1. Create an [Azure file share](/azure/storage/files/storage-how-to-create-file-share). The file share is reachable by the public host name of the storage account if using a public endpoint. The file share is reachable by private IP address if using a private endpoint.
55
+
1. Create an [Azure file share](/azure/storage/files/storage-how-to-create-file-share). The file share is reachable by the public host name of the storage account if using a public endpoint. The file share is reachable by private IP address if using a private endpoint.
59
56
60
57
1. Mount the Azure file share in the template VM:
61
58
@@ -130,7 +127,7 @@ sudo mount -t cifs //$STORAGE_ACCOUNT_NAME.file.core.windows.net/$FILESHARE_NAME
130
127
131
128
If the template VM that mounts the Azure Files share to the `/mnt` directory is already published, the lab user can either:
132
129
133
-
- Move the instruction to mount `/mnt` to the top of the `/etc/fstab` file.
130
+
- Move the instruction to mount `/mnt` to the top of the `/etc/fstab` file.
134
131
- Modify the instruction to mount `/mnt/{file-share-name}` to a different directory, like `/prm-mnt/{file-share-name}`.
135
132
136
133
Lab users should run `mount -a` to remount directories.
@@ -145,7 +142,7 @@ For more general information, see [Use Azure Files with Linux](/azure/storage/fi
145
142
- Permission policies are IP-based for each volume
146
143
- If lab users need their own volume that other lab users don't have access to, permission policies must be assigned after the lab is published
147
144
- Azure Lab Services only supports Linux-based lab virtual machines to connect to Azure NetApp Files
148
-
- The virtual network for the Azure NetApp Files capacity pool must be connected to the lab. To enable advanced networking for labs, see [Connect to your virtual network in Azure Lab Services using vnet injection](how-to-connect-vnet-injection.md). VNet injection must be done during lab plan creation.
145
+
- The virtual network for the Azure NetApp Files capacity pool must be connected to the lab. To enable advanced networking for labs, see [Connect to your virtual network in Azure Lab Services using virtual network injection](how-to-connect-vnet-injection.md). Virtual network injection must be done during lab plan creation.
149
146
150
147
To use an Azure NetApp Files share in Azure Lab Services:
151
148
@@ -166,12 +163,6 @@ To use an Azure NetApp Files share in Azure Lab Services:
166
163
sudo apt install nfs-common
167
164
```
168
165
169
-
- CentOS:
170
-
171
-
```bash
172
-
sudo yum install nfs-utils
173
-
```
174
-
175
166
1. On the template VM, save the following script as `mount_fileshare.sh` to [mount the Azure NetApp Files share](/azure/azure-netapp-files/azure-netapp-files-mount-unmount-volumes-for-virtual-machines).
176
167
177
168
Assign the `capacity_pool_ipaddress` variable the mount target IP address for the capacity pool. Get the mount instructions for the volume to find the appropriate value. The script expects the path name of the Azure NetApp Files volume.
@@ -200,7 +191,7 @@ To use an Azure NetApp Files share in Azure Lab Services:
1. If all lab users are sharing access to the same Azure NetApp Files volume, you can run the `mount_fileshare.sh` script on the template machine before publishing. If lab users each get their own volume, save the script to be run later by the lab user.
194
+
1. If all lab users are sharing access to the same Azure NetApp Files volume, you can run the `mount_fileshare.sh` script on the template machine before publishing. If lab users each get their own volume, save the script so each lab user can run it later.
204
195
205
196
1. [Publish](how-to-create-manage-template.md#publish-the-template-vm) the template VM.
206
197
@@ -210,7 +201,7 @@ To use an Azure NetApp Files share in Azure Lab Services:
210
201
211
202
1. Lab users must start their VM and run the script to mount the file share. They have to run the script only once.
212
203
213
-
The command looks like the following: `./mount_fileshare.sh myvolumename`.
204
+
Use the command: `./mount_fileshare.sh myvolumename`.
| Ubuntu Server | - Ubuntu Server 18.04 LTS (Gen2)<br/>- Ubuntu Server 20.04 LTS<br/>- Ubuntu Server 20.04 LTS (Gen2)<br/>- Ubuntu Server 22.04<br/>- Ubuntu Server 22.04 (Gen2)<br/>- Ubuntu Server 22.10<br/>- Ubuntu Server 22.10 (Gen2) |
0 commit comments