Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/reporting-services/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Linux 尝试使用静态IP创建VM时,无法访问获取CurrentStorageAccountName_Linux_Azure_Virtual Machine_Powershell 3.0 - Fatal编程技术网

Linux 尝试使用静态IP创建VM时,无法访问获取CurrentStorageAccountName

Linux 尝试使用静态IP创建VM时,无法访问获取CurrentStorageAccountName,linux,azure,virtual-machine,powershell-3.0,Linux,Azure,Virtual Machine,Powershell 3.0,我有一个Azure PowerShell挑战 我正在尝试创建一个基于现有磁盘的具有静态IP的VM 我已经运行了以下程序,可以在VM磁盘列表中看到我的磁盘 Add-AzureDisk -DiskName $diskname -MediaLocation $medialocation -Label "bootdisk" -OS "Linux" 但是,当我运行以下脚本时: Set-AzureSubscription -SubscriptionName "my subscrption" -Curre

我有一个Azure PowerShell挑战

我正在尝试创建一个基于现有磁盘的具有静态IP的VM

我已经运行了以下程序,可以在VM磁盘列表中看到我的磁盘

Add-AzureDisk -DiskName $diskname -MediaLocation $medialocation -Label "bootdisk" -OS "Linux"
但是,当我运行以下脚本时:

Set-AzureSubscription -SubscriptionName "my subscrption"  -CurrentStorageAccountName "my storage account"


$vmImg = New-AzureVMConfig -Name $vmname -InstanceSize Large -DiskName $diskname -Verbose |
         Set-AzureSubnet -SubnetNames "my subnet" |
         Set-AzureStaticVNetIP -IPAddress "192.168.58.101" 


  New-AzureVM -ServiceName $cloudservicename  -VMs $vmImg 
我得到这个错误

New AzureVM:CurrentStorageAccountName不可访问。确保 当前存储帐户可访问且位于同一位置或 关联组作为您的云服务

我做了一些研究,发现当云服务已经存在时,这是一个问题。然而,我已经尝试了所有建议的解决方法,包括允许新的AzureVM创建云服务和手动创建云服务

你见过这个吗?我需要静态IP的原因是,如果我允许动态IP,VM中的所有内容都会中断


如果您有任何建议,我们将不胜感激。

尝试以下方法,看看是否能解决您的问题

清理:-

清除%appdata%\Windows Azure Powershell。 关闭所有powershell实例 添加azureaccount

步骤1:

设置AzureSubscription-SubscriptionName“Visual Studio Ultimate with MSDN”-CurrentStorageAccount$storageAccountName

步骤2: 检查IP地址是否可用

Test AzureStaticVNetIP–VNetName$VNetName–IP地址10.0.0.9

步骤3:


新AzureVMConfig-名称“testvmkv21”-实例化基本_A2-标签“testvmkv1”-图像名称(获取AzureVMImage)[88]。图像名称|设置AzureSubnet“subnet-1”|设置AzureStaticVNetIP-IP地址10.0.0.9 |添加azureprovisioningconfig-管理员用户名“myuser”-windows-密码”!!abc039“|添加AzureEndpoint-LocalPort 80-名称“HTTP”-协议tcp-公共端口80 |添加AzureEndpoint-LocalPort 443-名称“HTTPS”-协议tcp-公共端口443 |新AzureVM-服务名称“testvmkv21”-位置“East US”-VNetName“eastusvnet”

我遵循步骤1、2。删除存储,重新创建一个新存储。然后,一步一步地回到:它对我有效。