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= ...
随机推荐
- bindService和startService的区别
区别: startService,关闭服务退出activity,service仍然处于后台运行 bindService,关闭服务退出activity直接stopService,停止服务 bindSer ...
- 2015北京网络赛B题 Mission Impossible 6
借用大牛的一张图片:模拟 #include<cstdio> #include<cmath> #include<cstring> #include<algori ...
- Android Activity 生命周期中onStart()和onResume()的区别
首先了解Activity的四种状态 Running状态:一个新的Activity启动入栈后,它在屏幕最前端,处于栈的最顶端,此时它处于可见并可和用户交互的激活状态.Paused状态:当Activity ...
- Esper系列(十三)Splitting and Duplicating Streams
功能:将同一个事件流分发到其它的事件流中. 格式: 1 ; i < events.length; i++) { 78 EventBean event = even ...
- POJ-3744 Scout YYF I 概率DP
题目链接:http://poj.org/problem?id=3744 简单的概率DP,分段处理,遇到mine特殊处理.f[i]=f[i-1]*p+f[i-2]*(1-p),i!=w+1,w为mine ...
- 用Java实现一个通用并发对象池
这篇文章里我们主要讨论下如何在Java里实现一个对象池.最近几年,Java虚拟机的性能在各方面都得到了极大的提升,因此对大多数对象而言,已经没有必要通过对象池来提高性能了.根本的原因是,创建一个新的对 ...
- 转载Entity Framework全面教程
转载原地址:http://www.cnblogs.com/lsxqw2004/archive/2009/05/31/1495240.html#_Toc228672754 预备知识 2 LINQ技 ...
- Integer的缓存机制
Java api 中为了提高效率,减少资源的浪费,对内部的Integer类进行了缓存的优化,通俗的说就是把-127至128这个范围内的数提前加载到内存,当我们需要的时候,如果正好在这个范围之内,就会直 ...
- 命令删除visualstudio.com云端项目(TFS)
1.运行命令行 2.tfsdeleteproject /collection:https://域名.visualstudio.com/DefaultCollection “项目名称”
- JSP九大内置对象分析
JSP九大内置对象分为三类: 1.输入输出对象:out对象.response对象.request对象 2.通信控制对象:pageContext对象.session对象.application对象 3. ...