您的位置:首页 > 博客中心 > 网络系统 >

使用Powershell在Microsoft Azure中创建Virtual Machine

时间:2022-04-03 09:41

获取虚拟机镜像

PS C:\WINDOWS\system32> Get-AzureVMImage

仅获得虚拟机名

PS C:\WINDOWS\system32> (Get-AzureVMImage).ImageName
0c5c79005aae478e8883bf950a861ce0__Windows-Server-2012-Essentials-20131018-enus
0c5c79005aae478e8883bf950a861ce0__Windows-Server-2012-Essentials-20131018-zhcn
0c5c79005aae478e8883bf950a861ce0__Windows-Server-2012-Essentials-20140115-enus
0c5c79005aae478e8883bf950a861ce0__Windows-Server-2012-Essentials-20140115-zhcn
0c5c79005aae478e8883bf950a861ce0__Windows-Server-2012-Essentials-20140213-enus
0c5c79005aae478e8883bf950a861ce0__Windows-Server-2012-Essentials-20140213-zhcn
0c5c79005aae478e8883bf950a861ce0__Windows-Server-2012-Essentials-20140306-enus
0c5c79005aae478e8883bf950a861ce0__Windows-Server-2012-Essentials-20140306-zhcn
0c5c79005aae478e8883bf950a861ce0__Windows-Server-2012-Essentials-20140327-enus
0c5c79005aae478e8883bf950a861ce0__Windows-Server-2012-Essentials-20140327-zhcn
0c5c79005aae478e8883bf950a861ce0__Windows-Server-2012-Essentials-20140618-enus
0c5c79005aae478e8883bf950a861ce0__Windows-Server-2012-Essentials-20140618-zhcn
0c5c79005aae478e8883bf950a861ce0__Windows-Server-2012-Essentials-20140715-enus
0c5c79005aae478e8883bf950a861ce0__Windows-Server-2012-Essentials-20140715-zhcn
250d269906be4694a10aee49a3385f2d__SUSE-Linux-Enterprise-Server-11-SP3-SAP-CAL-v103
250d269906be4694a10aee49a3385f2d__SUSE-Linux-Enterprise-Server-11-SP3-SAP-CAL-v108
250d269906be4694a10aee49a3385f2d__SUSE-Linux-Enterprise-Server-11-SP3-v203
250d269906be4694a10aee49a3385f2d__SUSE-Linux-Enterprise-Server-11-SP3-v206
250d269906be4694a10aee49a3385f2d__openSUSE-13.1-v102
250d269906be4694a10aee49a3385f2d__openSUSE-13.1-v105
55bc2b193643443bb879a78bda516fc8__Win2K8R2SP1-Datacenter-201408.01-en.us-127GB.vhd
55bc2b193643443bb879a78bda516fc8__Win2K8R2SP1-Datacenter-201408.01-zh.cn-127GB.vhd
55bc2b193643443bb879a78bda516fc8__Win2K8R2SP1-Datacenter-201409.01-en.us-127GB.vhd
55bc2b193643443bb879a78bda516fc8__Win2K8R2SP1-Datacenter-201409.01-zh.cn-127GB.vhd
55bc2b193643443bb879a78bda516fc8__Win2K8R2SP1-Datacenter-201410.01-en.us-127GB.vhd
55bc2b193643443bb879a78bda516fc8__Win2K8R2SP1-Datacenter-201410.01-zh.cn-127GB.vhd
55bc2b193643443bb879a78bda516fc8__Windows-Server-2012-Datacenter-201408.01-en.us-127GB.vhd
55bc2b193643443bb879a78bda516fc8__Windows-Server-2012-Datacenter-201408.01-zh.cn-127GB.vhd
55bc2b193643443bb879a78bda516fc8__Windows-Server-2012-Datacenter-201409.01-en.us-127GB.vhd
55bc2b193643443bb879a78bda516fc8__Windows-Server-2012-Datacenter-201409.01-zh.cn-127GB.vhd
55bc2b193643443bb879a78bda516fc8__Windows-Server-2012-Datacenter-201410.01-en.us-127GB.vhd
55bc2b193643443bb879a78bda516fc8__Windows-Server-2012-Datacenter-201410.01-zh.cn-127GB.vhd
。。。。

需要0.8.7 版本为 the Microsoft Azure PowerShell module,如何安装请参考

使用 Windows PowerShell 管理映像

 

需要的事先绑定的存储账号,参考

密码请自行符合复杂程度

创建单台虚拟机

PS C:\WINDOWS\system32> New-AzureVMConfig -Name ‘WinSerEss-1‘ -InstanceSize ‘ExtraSmall‘ -ImageName (Get-AzureVMImage)[1
2].ImageName ` | Add-AzureProvisioningConfig -Windows -AdminUsername ‘Anderson‘ -Password ‘‘ ` | New-AzureVM -
ServiceName ‘AndersonService‘ -Location ‘China East‘

OperationDescription                    OperationId                             OperationStatus
--------------------                    -----------                             ---------------
New-AzureVM                             57c11fda-7545-4d0c-b3e2-67d461f23d3f    Succeeded

PowerShell中看到Create Succeeded,其实虚拟机没有完全创建,可以去Portal上查看

 

New-AzureVMConfig

 

 

Azure 虚拟机常见问题 更新时间: 2014年9月

How to Configure An Availability Set for Virtual Machines

Manage the availability of virtual machines Understand planned versus unplanned maintenance

 

热门排行

今日推荐

热门手游