|Slideshow ^ |< << Slide 4 of 8 >> >||
1. Create a WRF Virtual Hard Drive (VHD)
To demonstrate some of the features of Windows Azure storage accounts, we will create a Virtual Hard Drive (VHD) file containing our newly compiled WRF files and the supporting data files. Windows Azure service instances (e.g. the nodes in our compute cluster service) can mount VHD files directly from a Windows Azure storage account. This is a great way to provide persistent storage for your projects and share large static files among compute nodes.
Before you continue, make sure you have these software prerequisites:
1.2. Create a 20GB NTFS-formated VHD File
- Open a command line in your HPC Linux distro and load the PToolsWin module:
- Navigate to the directory you created for WRF:
Use the dd command to create a new fixed-size raw disk image file:
1 dd if=/dev/zero of=image.raw bs=1G count=20
You can set "bs" to be any block size you like in kilobytes (K), megabytes (M), gigabytes (B), or terabytes (T). "count" sets the image file size in blocks, so "bs=1G count=1" would create a file of one gigabyte, or "bs=10M count=10" would create a file of 100 megabytes. VHD files may not be larger that two terabytes.
- Create a new NTFS filesystem on the raw disk image: The '-F' flag forces the filesystem creation, even though we're not creating on a regular disk. The '-f' flag causes mkntfs to do a fast format.
1 /sbin/mkntfs -F -f image.raw
Use VirtualBox to convert image.raw to a VHD file named wrf.vhd:If you see this error message:
1 VBoxManage convertfromraw image.raw wrf.vhd --format VHD --variant Fixed
VBoxManage: error: Cannot create the disk image "test.vhd": VERR_INVALID_PARAMETERthen first try creating the file as a standard VHD file and then re-create it as a fixed file:
The VHD file must be in fixed format to be mountable from a Windows Azure storage account.
- We're done with the raw image file, so you can remote it to save space:
1 rm image.raw
1.3. Mount and Populate the VHD File
Create a mountpoint folder and use FUSE to mount the VHD file:
The -o windows_names flag prevents files, directories and extended attributes from being created with a name not allowed by Windows, either because it contains some illegal character (e.g. " * / : < > ? \ |) or because the last character is a space or a dot.
Now any files you create in $WRFDIR/mnt will actually be created on the VHD file. Copy WRF and WPS to the VHD file:
1 cp -R WPS WRFV3 mnt
- Unmount the VHD file:
1 fusermount -u mnt
- Copy your VHD file to a Windows Azure storage account. If you want to copy the VHD file anywhere else, we recommend compressing it first since it is mostly zeros and will compress very well.
You are now ready to proceed to Step 5: Deploy a new Windows Azure compute cluster service. If you'd like to know more about working with VHD files in Linux and Windows Azure, see the VHD Files How-To.
|/Step1 /Step2 /Step3 /Step4 /Step5 /Step6 /Step7 /ViewAll|