Azure Powershell获取Azure虚拟机的操作系统型号及具体版本
Azure ARM 模式虚拟机:
1.登陆Azure账号
Add-AzureRmAccount -EnvironmentName AzurechinaCloud
2.选择指定订阅
Select-AzureRmSubscription -Subscription ******
3.获取指定虚拟机信息
$vm = Get-AzureRmVM -ResourceGroupName ****** -Name ******
4.获取虚拟机操作系统型号及具体版本
Windows VM: PS C:\Users\he.liming> $vm = Get-AzureRmVM -ResourceGroupName hlmrgn -Name hlmwin12test
PS C:\Users\he.liming> $vm.StorageProfile.OsDisk.OsType
Windows
PS C:\Users\he.liming> $vm.StorageProfile.ImageReference
Publisher : MicrosoftWindowsServer
Offer : WindowsServer
Sku : 2012-R2-Datacenter
Version : latest
Id : Linux VM:
PS C:\Users\he.liming> $vm = Get-AzureRmVM -ResourceGroupName hlmrgn -Name hlmcent74n
PS C:\Users\he.liming> $vm.StorageProfile.OsDisk.OsType
Linux
PS C:\Users\he.liming> $vm.StorageProfile.ImageReference
Publisher : OpenLogic
Offer : CentOS
Sku : 7.4
Version : latest
Id :
5.上述4获取的虚拟机版本信息仅限于通过Azure镜像库创建的虚拟机,如果自定义上传VHD创建的虚拟机或使用捕获的Image创建的虚拟机无法获取到具体版本信息,只能获取到版本型号
PS C:\Users\he.liming> $vm = Get-AzureRmVM -ResourceGroupName hlmrgn -Name hlmtestn
PS C:\Users\he.liming> $vm.StorageProfile.OsDisk.OsType
Linux
PS C:\Users\he.liming> $vm.StorageProfile.ImageReference
Publisher :
Offer :
Sku :
Version :
Id : /subscriptions/6c87a588-88df-48ee-9e52-d04b06a8601f/resourceGroups/hlmrgn/providers/Microsoft.Compute/images/capture-hlmma69n2
Azure ASM 模式虚拟机:
1.登陆Azure账号
Add-AzureAccount -Environment AzureChinaCloud
2.获取当前操作的订阅信息
Get-AzureSubscription -Default
3.获取指定虚拟机信息
$vm = Get-AzureVM -ServiceName ****** -Name ******
4.获取虚拟机操作系统型号及具体版本
PS C:\Users\he.liming> $vm = Get-AzureVM -ServiceName hlmtest1 -Name hlmsct2
PS C:\Users\he.liming> $vm.VM.OSVirtualHardDisk.os
Linux
PS C:\Users\he.liming> $vm.VM.OSVirtualHardDisk.SourceImageName
f1179221e23b4dbb89e39d70e5bc9e72__OpenLogic-CentOS-73-20170925
Azure Powershell获取Azure虚拟机的操作系统型号及具体版本的更多相关文章
- Windows 上安装 Azure PowerShell及Azure PowerShell部署虚拟机
一.Azure PowerShell部署 1.使用 PowerShellGet 在 Windows 上安装 Azure PowerShell 从 Azure PowerShell 版本 6.0 开 ...
- 使用PowerShell 获取azure image publisher offer sku 信息
使用azure powershell 获取指定区域的可用镜像 publisher offer sku信息 param ( [parameter(Mandatory = $false)] $Locati ...
- 如何使用 Azure PowerShell 在 Azure Marketplace 中查找 Windows VM 映像
本主题介绍如何使用 Azure PowerShell 在 Azure Marketplace 中查找 VM 映像. 创建 Windows VM 时使用此信息来指定 Marketplace 映像. 确保 ...
- 通过Azure Powershell获取asm及arm虚拟机的配置信息
1.asm虚拟机可以使用类似如下Azure Powershell命令获取虚拟机的基本信息,包括发行版本,虚拟机名称及size[备注:虚拟机需要是使用平台image创建的] PS C:\Users\he ...
- 使用 Azure PowerShell 管理 Azure 虚拟网络和 Windows 虚拟机
Azure 虚拟机使用 Azure 网络进行内部和外部网络通信. 本教程介绍了如何在虚拟网络中创建多个虚拟机 (VM),以及如何在虚拟机之间配置网络连接. 你将学习如何执行以下操作: 创建虚拟网络 创 ...
- azure powershell 获取可用镜像列表
通过Azure Powershell 指定location和Pbulishername 获取所有可用镜像的 publisherName,Offer,Skus,Version,location信息列表 ...
- [New Portal]Windows Azure Virtual Machine (16) 使用Azure PowerShell创建Azure Virtual Machine
<Windows Azure Platform 系列文章目录> 注:本章内容和之前的[New Portal]Windows Azure Virtual Machine (12) 在本地制作 ...
- Azure Powershell获取指定订阅下的虚拟机信息(ARM)
为方便Azure用户导出已创建虚拟机的相关信息,特编写如下脚本: 详情脚本: # 登陆Azure Account Add-AzureRmAccount -EnvironmentName AzureCh ...
- Azure Powershell获取指定订阅下的虚拟机信息(ASM)
为方便Azure用户导出已创建虚拟机的相关信息,特编写如下脚本: 详情脚本: # 登陆Azure Account Add-AzureAccount -Environment AzureChinaClo ...
随机推荐
- th:onclik()传参问题(前端使用了bootstrap)
网上大多帖子是这么写的 onclick调javascript函数时,不能直接使用onclick=“editUser(${prod.id})”,这样会报错,需要修改成如下的格式. <a href= ...
- Redhat Cluster Suite原理介绍
RedHat Cluster Suite简称RHCS,是一个能够提供高可用性.高可靠性.负载均衡.存储共享且经济廉价的集群工具集合,基于RHCS可以搭建高可用性集群.负载均衡集群.存储集群和高性能 ...
- SVO详细解读
SVO详细解读 极品巧克力 前言 接上一篇文章<深度滤波器详细解读>. SVO(Semi-Direct Monocular Visual Odometry)是苏黎世大学Scaramuzza ...
- 常用工具类——DatetimeUtil
import java.text.DateFormat; import java.text.ParseException; import java.text.SimpleDateFormat; imp ...
- [欣赏代码片段] (JavaScript) Responsive jQuery
jQuery(document).ready(function($) { /* getting viewport width*/ var responsive_viewport = $(window) ...
- ceph卸载
1.正常卸载 ceph-deploy purge ceph01 ceph-deploy purgedata ceph01 rm -rf /var/lib/ceph rm -rf /etc/ceph r ...
- centos7用fdisk进行分区
1.查看分区信息:fdisk -l 从上面可以看到,/dev/sdb分区还没有使用,现在将其划分成2个10G的分区. 2.执行:fdisk /dev/sdb 1):fdisk命令参数 p:打印分区表. ...
- 【转载】redis优化配置和redis.conf说明
转载地址:http://blog.csdn.net/luozhonghua2014/article/details/40568707?utm_source=tuicool&utm_medium ...
- 使用火蜘蛛采集器Firespider采集天猫商品数据并上传到微店
有很多朋友都需要把天猫的商品迁移到微店上去.可在天猫上的商品数据非常复杂,淘宝开放接口禁止向外提供数据,一般的采集器对ajax数据采集的支持又不太好. 还有现在有了火蜘蛛采集器,经过一定的配置,终于把 ...
- 启动Hadoop HDFS时的“Incompatible clusterIDs”错误原因分析
"Incompatible clusterIDs"的错误原因是在执行"hdfs namenode -format"之前,没有清空DataNode节点的data目 ...