Azure PowerShell 创建虚拟机
# 指定订阅名称
$subscriptionName=“订阅名称"
# 指定云服务名称
$serviceName="云服务名称"
# 指定用来保存虚拟机VHD的存储
$storageAccount=“存储账号"
# 指定网络名称
$vnetName=“虚拟网络名称"
# 指定虚拟网络
$subnetNames="SubNetwork01"
# 指定虚拟机名称
$name=“虚拟机名称"
# 指定有效性集
$availabilitysetName=“有效性集"
# 指定虚拟机大小
$instanceSize="Large"
# 指定镜像名称
$imageName="f1179221e23b4dbb89e39d70e5bc9e72__OpenLogic-CentOS-72-20160617"
# 指定Linux管理员名称
$linuxUser=“管理员名称"
# 指定Windows管理员名称
$adminssername=“管理员名称"
# 指定密码
$password="密码"
# 指定时区
$timeZone="China Standard Time"
# 登录资源
# Login-AzureRmAccount -EnvironmentName "AzureChinaCloud"
# Select-AzureRmSubscription -SubscriptionName $subscriptionName
# Add-AzureAccount -Environment AzureChinaCloud
# Select-AzureSubscription -SubscriptionName $subscriptionName
# 获取订阅
# Get-AzureSubscription | where {$_.SubscriptionName -eq $subscriptionName} | select SubscriptionName, IsCurrent | Format-Table -AutoSize
# 获取云服务
# Get-AzureService -ServiceName $serviceName | select Location, Status | Format-Table -AutoSize
# 获取存储账号
# Get-AzureStorageAccount | where {$_.StorageAccountName -eq $storageAccount} | select StorageAccountName, StorageAccountStatus, StatusOfPrimary| Format-Table -AutoSize
# 获取网络设置
# Get-AzureVNetSite -VNetName $vnetName | select Subnets | Format-Table -AutoSize
# 获取镜像名称
# Get-AzureVMImage | where {$_.ImageName -like "*CentOS-72*"} | SELECT ImageName | Format-Table -AutoSize
# 55bc2b193643443bb879a78bda516fc8__Windows-Server-2012-R2-20160721-zh.cn-127GB.vhd
# f1179221e23b4dbb89e39d70e5bc9e72__OpenLogic-CentOS-72-20160617
# Get-AzureVMImage | where {$_.ImageName -like "*Windows-Server-2012-R2*" -and $_.ImageName -like "*zh.cn*"} | SELECT ImageName | Format-Table -AutoSize
# 设定当前订阅的存储账号
Select-AzureSubscription -SubscriptionName $subscriptionName
Set-AzureSubscription -SubscriptionName $subscriptionName -CurrentStorageAccountName $storageAccount
# New-AzureVMConfig -Name $name -InstanceSize $instanceSize -AvailabilitySetName $availabilitysetName -ImageName $imageName | Add-AzureProvisioningConfig -Windows -AdminUsername $adminssername -Password $password -DisableAutomaticUpdates -TimeZone $timeZone | Set-AzureSubnet -SubnetNames $subnetNames | New-AzureVM -ServiceName $serviceName -VNetName $vnetName
New-AzureVMConfig -Name $name -InstanceSize $instanceSize -AvailabilitySetName $availabilitysetName -ImageName $imageName | Add-AzureProvisioningConfig –Linux -LinuxUser $linuxUser -Password $password | Set-AzureSubnet -SubnetNames $subnetNames | New-AzureVM -ServiceName $serviceName -VNetName $vnetName
Azure PowerShell 创建虚拟机的更多相关文章
- Azure China (8) 使用Azure PowerShell创建虚拟机,并设置固定Virtual IP Address和Private IP
<Windows Azure Platform 系列文章目录> 本文介绍的是由世纪互联运维的Windows Azure China. 相比于Global Azure (http://www ...
- Azure PowerShell (5) 使用Azure PowerShell创建简单的Azure虚拟机和Linux虚拟机
<Windows Azure Platform 系列文章目录> 本文介绍的是国外的Azure Global.如果是国内由世纪互联运维的Azure China,请参考这篇文档: Azure ...
- Azure 基础:使用 powershell 创建虚拟机
在进行与 azure 相关的自动化过程中,创建虚拟主机是避不开的操作.由于系统本身的复杂性,很难用一两条简单的命令完成虚拟主机的创建.所以专门写一篇文章来记录使用 PowerShell 在 azure ...
- Azure PowerShell (12) 通过Azure PowerShell创建SSH登录的Linux VM
<Windows Azure Platform 系列文章目录> 本章将介绍如何使用Azure PowerShell,创建SSH登录的Linux VM 前提要求: 1.安装Azure Pow ...
- Windows 上安装 Azure PowerShell及Azure PowerShell部署虚拟机
一.Azure PowerShell部署 1.使用 PowerShellGet 在 Windows 上安装 Azure PowerShell 从 Azure PowerShell 版本 6.0 开 ...
- [New Portal]Windows Azure Virtual Machine (16) 使用Azure PowerShell创建Azure Virtual Machine
<Windows Azure Platform 系列文章目录> 注:本章内容和之前的[New Portal]Windows Azure Virtual Machine (12) 在本地制作 ...
- Azure ARM (22) 使用Azure PowerShell创建Azure RM VM
<Windows Azure Platform 系列文章目录> 在Azure China获得VM Image,可以执行下面的脚本. Get-AzureRmVMImagePublisher ...
- 使用 Azure CLI 创建虚拟机
使用 az vm create 命令创建虚拟机. 创建虚拟机时,可使用多个选项,例如操作系统映像.磁盘大小调整和管理凭据. 在此示例中,创建了一个名为“myVM”的运行 Ubuntu Server 的 ...
- Azure Powershell 创建 Internal Load Balancer
Select-AzureSubscription -SubscriptionName "订阅名称" $serviceName="云服务名称" $ilbName= ...
随机推荐
- 判断A树是否包含B树结构
题目:输入两棵二叉树A和B,判断B是不是A的子结构 分析:根据数的遍历方法,首先想到的是采用递归的方式要更简单些,树A从根节点进行遍历,首先判断与B的根节点值是否相等,如果相等则进行递归遍历验证,否则 ...
- RAM, SDRAM ,ROM, NAND FLASH, NOR FLASH
在看上面2440的内存映射的时候,对其中的有些名字,不是完全太懂,所以到网上找了相关的信息. 对于mini2440来说,SDRAM,即内存,程序运行时的地方.选择连接SDRAM的为bank6. 1)S ...
- NOIP2005 谁拿了最多奖学金
1谁拿了最多奖学金 (scholar.pas/c/cpp) [问题描述] 某校的惯例是在每学期的期末考试之后发放奖学金.发放的奖学金共有五种,获取的条件各自不同: 1) 院士奖学金,每人800 ...
- Spark常用RDD操作总结
aggregate 函数原型:aggregate(zeroValue, seqOp, combOp) seqOp相当于Map combOp相当于Reduce zeroValue是seqOp每一个par ...
- HW5.29
public class Solution { public static void main(String[] args) { int n1 = (int)(Math.random() * 5 + ...
- HDU-4665 Unshuffle 搜索 | 2-SAT
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4665 本题的2-SAT建图颇为复杂,有时间再来填坑(自己写的一直挂着,标程建图太复杂了)...然后用暴 ...
- acm-字符串整理
一.后缀数组 #define maxn 200015 int wa[maxn],wb[maxn],wv[maxn],WS[maxn]; int len, sa[maxn] ; inline void ...
- linux之C编程实战小例
人生匆匆一趟,打不打酱油?怎么打?怎么打"质量好点的酱油"?由你决定.打酱油是一种态度,更是一种生活! 哈哈,事不关己不开口,专心一意打酱油! 请记住下面些许话: 不要一味的说别人 ...
- hdu1150-Machine Schedule(最小点覆盖)
二分图的最小顶点覆盖:用最少的点,让每条边都至少和其中一个点关联. 最大匹配数 = 最小点覆盖数(Konig 定理) 水题…… 突然发现我以前的匈牙利算法模版有问题……因为这里左边的点时1~n ...
- elecworks 报表----按线类型的电线清单
按线类型的电线清单中:列Wire number指的是线标注,不是电位标注 section:截面积