Uploading and downloading files from MU mode fileset
The files can be uploaded and downloaded from cloud object storage by using AFM Manual Update (MU) mode.
MU mode fileset depends on mmafmcosctl upload and download commands to upload and download data to and from cloud object storage respectively.
Administrators can determine the files to upload and download from cloud object storage (COS). Files on AFM to cloud object storage MU fileset can be determined manually or by using policies and can be uploaded to the cloud object storage. Whereas, MU mode is not capable of automatically recognizing the new files that are added on COS by third-party interface or API. Therefore, administrators need to determine these files to download them into the MU fileset. To create and manage policies, see Policies for automating file management.
For upload and download, mmafmcosctl upload/download –object-list command needs to be used. The –object list can be created by using the absolute path of the objects with respect to the MU fileset.
- Example 1: Upload
-
- Create a new MU mode relation with COS bucket:
- Set keys from cloud for the new
bucket.
Node1] mmafmcoskeys demobucket-mu:s3.us-east.cloud-object-storage.appdomain.cloud set 779c2178d4key497de8d6cdc72 ef08ac5bcc1c79f4key5a293a7fe24c2ef fe54d2beba0 Node1]
- Create MU
fileset.
Node1] mmafmcosconfig fs1 demo_mu --endpoint http://s3.us-east.cloud-object-storage.appdomain.cloud --new-bucket demobucket-mu --object-fs --mode mu
- Set keys from cloud for the new
bucket.
- Create files in MU mode fileset by using dd.
Node1] dd if=/dev/urandom of=/gpfs/fs1/demo_mu/file1 bs=256K count=4 4+0 records in 4+0 records out 1048576 bytes (1.0 MB, 1.0 MiB) copied, 0.0110485 s, 94.9 MB/s Node1] dd if=/dev/urandom of=/gpfs/fs1/demo_mu/file2 bs=256K count=8 8+0 records in 8+0 records out 2097152 bytes (2.1 MB, 2.0 MiB) copied, 0.0124402 s, 169 MB/s Node1] dd if=/dev/urandom of=/gpfs/fs1/demo_mu/file3 bs=256K count=12 12+0 records in 12+0 records out 3145728 bytes (3.1 MB, 3.0 MiB) copied, 0.0153719 s, 205 MB/s Node1] Node1] dd if=/dev/urandom of=/gpfs/fs1/demo_mu/file4 bs=256K count=16 16+0 records in 16+0 records out 4194304 bytes (4.2 MB, 4.0 MiB) copied, 0.0223167 s, 188 MB/s Node1] dd if=/dev/urandom of=/gpfs/fs1/demo_mu/file5 bs=256K count=20 20+0 records in 20+0 records out 5242880 bytes (5.2 MB, 5.0 MiB) copied, 0.0268569 s, 195 MB/s Node1]
- List the files in MU fileset.
Node1] ls -shl /gpfs/fs1/demo_mu/ total 14M 1.0M -rw-r--r-- 1 root root 1.0M Jan 12 03:28 file1 2.0M -rw-r--r-- 1 root root 2.0M Jan 12 03:28 file2 3.0M -rw-r--r-- 1 root root 3.0M Jan 12 03:29 file3 4.0M -rw-r--r-- 1 root root 4.0M Jan 12 04:30 file4 4.0M -rw-r--r-- 1 root root 5.0M Jan 12 04:30 file5 Node1]
- Now upload the specific files to COS by using upload command object-list.
- Create an object list. The files determined to upload are file1, file3, and file5 as shown in
the following sample:
Node1] cat /root/objectlist1 /gpfs/fs1/demo_mu/file1 /gpfs/fs1/demo_mu/file3 /gpfs/fs1/demo_mu/file5 Node1]
- Issue upload command by using the following object
list:
Object Upload successfully queued at the gateway.Node1] mmafmcosctl fs1 demo_mu /gpfs/fs1/demo_mu/ upload --object-list /root/objectlist1 Queued (Total) Failed TotalData (approx in Bytes) 3 (3) 0 9437184
- Issue the following command to check the upload
stats:
Node1] mmafmcosctl fs1 demo_mu --upload-stats
mmafmcosctl: Statistics of last or currently running upload are as follows: Fileset Name Pending Failed Total Total data(Bytes) Throughput(KB/s) ------------ ------------ ------------ ------------ -------------------- --------------- demo_mu 0 0 3 9437184 0 Node1 12Jan04:58:46 4]
- Create an object list. The files determined to upload are file1, file3, and file5 as shown in
the following sample:
- Check that the files are pushed to COS by using COS CLI. The following files are transferred to
COS by using COS command-line tool as shown in the sample output:
[2022-01-12 04:58:16 EST] 1.0MiB file1 [2022-01-12 04:58:16 EST] 3.0MiB file3 [2022-01-12 04:58:16 EST] 5.0MiB file5
- Create a new MU mode relation with COS bucket:
- Example 2: Download
-
Note:
- Manual updates mode fileset does not expect file data changes on the cloud object storage. When the file is downloaded from COS the file is marked as cached and then the file is not downloaded again.
- For downloading files from COS to MU mode, --object-list must be used. Download --all option is not relevant to MU mode as this mode is not aware of the data that are created on the COS by the third-party services.