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= ...
随机推荐
- tomcat 5 启动过程官方文档
http://tomcat.apache.org/tomcat-7.0-doc/architecture/startup/serverStartup.txt Licensed to the Apach ...
- tomcat Connector 连接器
连接器的核心功能,本文去除非核心功能,留下整个程序的框架,便于理解. 1.接受连接请求 2.创建request,和response. 3.调用容器对应的Invoke方法, 首先看类的依赖结构. 1.C ...
- iOS生命周期
1.application didFinishLaunchingWithOptions:当应用程序启动时执行,应用程序启动入口,只在应用程序启动时执行一次.若用户直接启动,lauchOptions内无 ...
- 自编译安装nginx
1. 下载nginx,并解压 http://nginx.org/ 2. 下载health check模块 p.p1 { margin: 0.0px 0.0px 0.0px 0.0px; font: 1 ...
- Solution for Latex error: "Cannot determine size of graphic"
I'm trying to include graphics in my Latex-file, which I compiled with latex+dvipdf on OS X. Latex h ...
- Linux shell 常用
使用Linux shell是我每天的基本工作,但我经常会忘记一些有用的shell命令和l技巧.当然,命令我能记住,但我不敢说能记得如何用它执行某个特定任务.于是,我开始在一个文本文件里记录这些用法,并 ...
- hdu4812-D Tree (树的点分治)
昨天学了下树分治,今天补这道题,还是太不熟练了,写完之后一直超时.后来查出好多错= =比如v,u写倒了,比如+写成了取最值,比如....爆int...查了两个多小时的错..哭...(没想到进首页了 h ...
- Java快捷键
Ctrl+1 快速修复(最经典的快捷键,就不用多说了)Ctrl+D: 删除当前行 Ctrl+Alt+↓ 复制当前行到下一行(复制增加)Ctrl+Alt+↑ 复制当前行到上一行(复制增加)Alt+↓ 当 ...
- 博客搬家啦。请访问我的新底盘www.boyipark.com
博客搬家啦.请访问我的新底盘 www.boyipark.com
- C#程序实现动态调用DLL的研究
摘 要:在<csdn开发高手>2004年第03期中的<化功大法——将DLL嵌入EXE>一文,介绍了如何把一个动态链接库作为一个资源嵌入到可执行文件,在可执行文件运行时,自动从资 ...