diff --git a/src/HPCCache/HPCCache/ChangeLog.md b/src/HPCCache/HPCCache/ChangeLog.md index 839701ab9e13..c59adddb3efb 100644 --- a/src/HPCCache/HPCCache/ChangeLog.md +++ b/src/HPCCache/HPCCache/ChangeLog.md @@ -18,6 +18,7 @@ - Additional information about change #1 --> ## Upcoming Release +* Fixed bug for `New-AzHpcCacheStorageTarget` and help text. ## Version 0.1.0 * Preview of `Az.HPCCache` module diff --git a/src/HPCCache/HPCCache/Commands/NewAzHpcStorageTarget.cs b/src/HPCCache/HPCCache/Commands/NewAzHpcStorageTarget.cs index 8a164381947b..53f21e082d54 100644 --- a/src/HPCCache/HPCCache/Commands/NewAzHpcStorageTarget.cs +++ b/src/HPCCache/HPCCache/Commands/NewAzHpcStorageTarget.cs @@ -130,7 +130,18 @@ public override void ExecuteCmdlet() this.Name, () => { - this.storageTarget = this.CLFS.IsPresent ? this.CreateClfsStorageTargetParameters() : this.CreateNfsStorageTargetParameters(); + if (this.CLFS.IsPresent) + { + this.storageTarget = this.CreateClfsStorageTargetParameters(); + } + else if (this.NFS.IsPresent) + { + this.storageTarget = this.CreateNfsStorageTargetParameters(); + } + else + { + throw new Exception(string.Format(Resources.CLFSorNFS)); + } if (this.IsParameterBound(c => c.Junction)) { this.storageTarget.Junctions = new List(); @@ -170,7 +181,7 @@ private bool DoesStorageTargetExists() this.CacheName, this.Name); - throw new Exception(string.Format(Resources.UpgradeHpcCache, this.Name, this.CacheName)); + throw new Exception(string.Format(Resources.StorageTargetAlreadyExist, this.Name, this.CacheName)); } catch (CloudErrorException e) { diff --git a/src/HPCCache/HPCCache/Properties/Resources.Designer.cs b/src/HPCCache/HPCCache/Properties/Resources.Designer.cs index c64ef6aba0f2..23ef6c634698 100644 --- a/src/HPCCache/HPCCache/Properties/Resources.Designer.cs +++ b/src/HPCCache/HPCCache/Properties/Resources.Designer.cs @@ -60,6 +60,15 @@ internal Resources() { } } + /// + /// Looks up a localized string similar to Need CLFS or NFS flag.. + /// + internal static string CLFSorNFS { + get { + return ResourceManager.GetString("CLFSorNFS", resourceCulture); + } + } + /// /// Looks up a localized string similar to Are you sure you want to create HPC cache storage target '{0}'?. /// diff --git a/src/HPCCache/HPCCache/Properties/Resources.resx b/src/HPCCache/HPCCache/Properties/Resources.resx index 165da598f94a..822b2ffc6532 100644 --- a/src/HPCCache/HPCCache/Properties/Resources.resx +++ b/src/HPCCache/HPCCache/Properties/Resources.resx @@ -117,6 +117,9 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + Need CLFS or NFS flag. + Are you sure you want to create HPC cache storage target '{0}'? diff --git a/src/HPCCache/HPCCache/help/New-AzHpcCacheStorageTarget.md b/src/HPCCache/HPCCache/help/New-AzHpcCacheStorageTarget.md index 6f2c3bb797f2..0ab5cd220ee9 100644 --- a/src/HPCCache/HPCCache/help/New-AzHpcCacheStorageTarget.md +++ b/src/HPCCache/HPCCache/help/New-AzHpcCacheStorageTarget.md @@ -33,12 +33,12 @@ The **New-AzHpcCacheStorageTarget** cmdlet adds a Storage Target to Azure HPC Ca ### Example 1 ```powershell -PS C:\> New-AzHpcCacheStorageTarget -ResourceGroupName testRG -CacheName testCache -StorageTargetName testST -CLFS -StorageContainerID "/subscriptions/testsub/resourceGroups/testRG/providers/Microsoft.Storage/storageAccounts/testdstorageaccount/blobServices/default/containers/testcontainer" -Junctions @(@{"namespacePath"="/msazure";"targetPath"="/";"nfsExport"="/"}) +PS C:\> New-AzHpcCacheStorageTarget -ResourceGroupName testRG -CacheName testCache -StorageTargetName testST -CLFS -StorageContainerID "/subscriptions/testsub/resourceGroups/testRG/providers/Microsoft.Storage/storageAccounts/testdstorageaccount/blobServices/default/containers/testcontainer" -Junction @(@{"namespacePath"="/msazure";"targetPath"="/";"nfsExport"="/"}) ``` ### Example 2 ```powershell -PS C:\> New-AzHpcCacheStorageTarget -ResourceGroupName testRG -CacheName testCache -StorageTargetName testST -NFS -UsageModel "READ_HEAVY_INFREQ" -Junctions @(@{"namespacePath"="/msazure";"targetPath"="/";"nfsExport"="/"}) +PS C:\> New-AzHpcCacheStorageTarget -ResourceGroupName testRG -CacheName testCache -StorageTargetName testST -NFS -UsageModel "READ_HEAVY_INFREQ" -Junction @(@{"namespacePath"="/msazure";"targetPath"="/";"nfsExport"="/"}) ``` ## PARAMETERS diff --git a/src/HPCCache/HPCCache/help/Set-AzHpcCacheStorageTarget.md b/src/HPCCache/HPCCache/help/Set-AzHpcCacheStorageTarget.md index c63d7e6fa3fa..8436807a6f6f 100644 --- a/src/HPCCache/HPCCache/help/Set-AzHpcCacheStorageTarget.md +++ b/src/HPCCache/HPCCache/help/Set-AzHpcCacheStorageTarget.md @@ -33,12 +33,12 @@ The **Set-AzHpcCacheStorageTarget** cmdlet updates a Storage Target attached to ### Example 1 ```powershell -PS C:\> Set-AzHpcCacheStorageTarget -ResourceGroupName testRG -CacheName testCache -StorageTargetName testST -CLFS -Junctions @(@{"namespacePath"="/msazure";"targetPath"="/";"nfsExport"="/"}) +PS C:\> Set-AzHpcCacheStorageTarget -ResourceGroupName testRG -CacheName testCache -StorageTargetName testST -CLFS -Junction @(@{"namespacePath"="/msazure";"targetPath"="/";"nfsExport"="/"}) ``` ### Example 2 ```powershell -PS C:\> Set-AzHpcCacheStorageTarget -ResourceGroupName testRG -CacheName testCache -StorageTargetName testST -NFS -Junctions @(@{"namespacePath"="/msazure";"targetPath"="/";"nfsExport"="/export"}) +PS C:\> Set-AzHpcCacheStorageTarget -ResourceGroupName testRG -CacheName testCache -StorageTargetName testST -NFS -Junction @(@{"namespacePath"="/msazure";"targetPath"="/";"nfsExport"="/export"}) ``` ## PARAMETERS