📝
CloudShell から FSx for NetApp ONTAP にマウントしてみた
Using AWS CloudShell in Amazon VPC - AWS CloudShell
Public IP addresses are not allocated to CloudShell VPC environments by default. VPC environments created in public subnets with routing tables configured to route all traffic to Internet Gateway will not have access to public internet, but private subnets configured with Network Address Translation (NAT) have access to public internet. VPC environments created in such private subnets will have access to public internet.
CloudShell からマウントする場合には VPC CloudShell のプライベートサブネットを使用する方法で実現できました。
なお、非 VPC の CloudShell からは以下のエラーでマウントできませんでした。
mount.nfs: Failed to resolve server svm-0d334eed92e246746.fs-0fe3b9e8187f8f707.fsx.ap-northeast-1.amazonaws.com: Name or service not known
前提
- プライベートサブネットを作成済み
- NAT ゲートウェイを作パブリックサブネットに成済み
- プライベートサブネットのデフォルトルートに NAT ゲートウェイへのルートを追加済み
- FSx for NetApp ONTAP ファイルシステムを作成済み
手順
- VPC CloudShell を FSx for NetApp ONTAP と同じサブネットで作成します。
- 以下のコマンドを実行してマウントします。
$ sudo yum install -y nfs-utils
$ mkdir -p ~/fsx_mount
$ sudo mount -t nfs -o <SVM の NFS DNS 名>:<ボリューム名> ~/fsx_mount
- 以下のようなコマンドでマウントできたことを確認します。
$ ls ~/fsx_mount
$ df -h | grep fsx_mount
svm-0700b7a1fc9760287.fs-0814f57fee72ab469.fsx.ap-northeast-1.amazonaws.com:/vol1 973G 113G 861G 12% /home/cloudshell-user/fsx_mount
$ mount | grep fsx_mount
svm-0700b7a1fc9760287.fs-0814f57fee72ab469.fsx.ap-northeast-1.amazonaws.com:/vol1 on /home/cloudshell-user/fsx_mount type nfs4 (rw,relatime,vers=4.1,rsize=65536,wsize=65536,namlen=255,hard,proto=tcp,timeo=600,retrans=2,sec=sys,clientaddr=10.0.10.64,local_lock=none,addr=10.0.10.95)
- 以下のようなコマンドでファイルの作成をテストします。
$ sudo touch ~/fsx_mount/testfile.txt
$ ls ~/fsx_mount
testfile.txt
まとめ
今回は CloudShell から FSx for NetApp ONTAP にマウントしてみてみました。
どなたかの参考になれば幸いです。
Discussion