目前创建的Azure Linux虚拟机默认安装的是LAD 3.0,如果客户有特殊需求,可以通过如下方法安装LAD 2.3

1.在Azure Portal卸载LAD 3.0

2.使用Azure Powershell登陆Azure Account

PS C:\Users\he.liming> Add-AzureRmAccount -EnvironmentName AzureChinaCloud
Account : heliming@***.partner.onmschina.cn
SubscriptionName : He Liming (SHULIANG)
SubscriptionId : 0b4b20c5-******
TenantId : b388b808-******
Environment : AzureChinaCloud

3.获取虚拟机资源ID

PS C:\Users\he.liming> $RGName='hlmrgn1'
PS C:\Users\he.liming> $VMName='hlmcen75n1-t1'
PS C:\Users\he.liming> $Location='china north'
PS C:\Users\he.liming> Get-AzureRmVM -ResourceGroupName $RGName -Name $VMName
ResourceGroupName : hlmrgn1
Id : /subscriptions/0b4b20c5-******/resourceGroups/hlmrgn1/providers/Microsoft.Compute/virtualMachines/hlmcen75n1-t1
VmId : eeeeb1e5-d5f4-4440-ac98-5f88f0c1fc81
Name : hlmcen75n1-t1
Type : Microsoft.Compute/virtualMachines
Location : chinanorth
Tags : {}
DiagnosticsProfile : {BootDiagnostics}
Extensions : {OmsAgentForLinux}
HardwareProfile : {VmSize}
NetworkProfile : {NetworkInterfaces}
OSProfile : {ComputerName, AdminUsername, LinuxConfiguration, Secrets}
ProvisioningState : Succeeded
StorageProfile : {ImageReference, OsDisk, DataDisks}

4.在本地创建ProtectSetting_Linux_Mooncake.json文件(需要替换为自己的存储账号及密钥)

{
"storageAccountName": "hlmstodiagn1",
"storageAccountKey": "MbOgNmtkjpQ5aImGOLjQkrge70KfKy******",
"storageAccountEndPoint": "https://core.chinacloudapi.cn"
}

5.在本地创建PublicConfig_Linux_Mooncake_base64code.json文件,文件的最终内容为如下

{
"xmlCfg": "PFdhZENmZz48RGlhZ25vc3RpY01vbml0b3JDb25maWd1cmF0aW9uIG92ZXJhbGxRdW90YUluTUI9IjQwOTYiPjxEaWFnbm9zdGljSW5mcmFzdHJ1Y3R1cmVMb2dzIHNjaGVkdWxlZFRyYW5zZmVyU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Glvbj48L1BlcmZvcm1hbmNlQ291bnRlcnM+PE1ldHJpY3MgcmVzb3VyY2VJZD0iL3N1YnNjcmlwdGlvbnMvMGI0YjIwYzUtMjliMy00ZGQ5LWJmZGMtNDBiNzVmMWRjNGM5L3Jlc291cmNlR3JvdXBzL2hsbXJnb******",
"StorageAccount": "hlmstodiagn1"
}

上述xmlCfg内容是由base64转码(base64转码工具请参考:http://tool.oschina.net/encrypt?type=3)生成的,转码之前的文件如下(需要将3中获取到的虚拟机资源ID在如下标黄位置处进行替换)

<WadCfg><DiagnosticMonitorConfiguration overallQuotaInMB=""><DiagnosticInfrastructureLogs scheduledTransferPeriod="PT1M" scheduledTransferLogLevelFilter="Warning"/><PerformanceCounters scheduledTransferPeriod="PT1M"><PerformanceCounterConfiguration counterSpecifier="\Memory\AvailableMemory" sampleRate="PT15S" unit="Bytes"><annotation displayName="Memory available" locale="en-us"/></PerformanceCounterConfiguration><PerformanceCounterConfiguration counterSpecifier="\Memory\PercentAvailableMemory" sampleRate="PT15S" unit="Percent"><annotation displayName="Mem. percent available" locale="en-us"/></PerformanceCounterConfiguration><PerformanceCounterConfiguration counterSpecifier="\Memory\UsedMemory" sampleRate="PT15S" unit="Bytes"><annotation displayName="Memory used" locale="en-us"/></PerformanceCounterConfiguration><PerformanceCounterConfiguration counterSpecifier="\Memory\PercentUsedMemory" sampleRate="PT15S" unit="Percent"><annotation displayName="Memory percentage" locale="en-us"/></PerformanceCounterConfiguration><PerformanceCounterConfiguration counterSpecifier="\Memory\PercentUsedByCache" sampleRate="PT15S" unit="Percent"><annotation displayName="Mem. used by cache" locale="en-us"/></PerformanceCounterConfiguration><PerformanceCounterConfiguration counterSpecifier="\Memory\PagesPerSec" sampleRate="PT15S" unit="CountPerSecond"><annotation displayName="Pages" locale="en-us"/></PerformanceCounterConfiguration><PerformanceCounterConfiguration counterSpecifier="\Memory\PagesReadPerSec" sampleRate="PT15S" unit="CountPerSecond"><annotation displayName="Page reads" locale="en-us"/></PerformanceCounterConfiguration><PerformanceCounterConfiguration counterSpecifier="\Memory\PagesWrittenPerSec" sampleRate="PT15S" unit="CountPerSecond"><annotation displayName="Page writes" locale="en-us"/></PerformanceCounterConfiguration><PerformanceCounterConfiguration counterSpecifier="\Memory\AvailableSwap" sampleRate="PT15S" unit="Bytes"><annotation displayName="Swap available" locale="en-us"/></PerformanceCounterConfiguration><PerformanceCounterConfiguration counterSpecifier="\Memory\PercentAvailableSwap" sampleRate="PT15S" unit="Percent"><annotation displayName="Swap percent available" locale="en-us"/></PerformanceCounterConfiguration><PerformanceCounterConfiguration counterSpecifier="\Memory\UsedSwap" sampleRate="PT15S" unit="Bytes"><annotation displayName="Swap used" locale="en-us"/></PerformanceCounterConfiguration><PerformanceCounterConfiguration counterSpecifier="\Memory\PercentUsedSwap" sampleRate="PT15S" unit="Percent"><annotation displayName="Swap percent used" locale="en-us"/></PerformanceCounterConfiguration><PerformanceCounterConfiguration counterSpecifier="\Processor\PercentIdleTime" sampleRate="PT15S" unit="Percent"><annotation displayName="CPU idle time" locale="en-us"/></PerformanceCounterConfiguration><PerformanceCounterConfiguration counterSpecifier="\Processor\PercentUserTime" sampleRate="PT15S" unit="Percent"><annotation displayName="CPU user time" locale="en-us"/></PerformanceCounterConfiguration><PerformanceCounterConfiguration counterSpecifier="\Processor\PercentNiceTime" sampleRate="PT15S" unit="Percent"><annotation displayName="CPU nice time" locale="en-us"/></PerformanceCounterConfiguration><PerformanceCounterConfiguration counterSpecifier="\Processor\PercentPrivilegedTime" sampleRate="PT15S" unit="Percent"><annotation displayName="CPU privileged time" locale="en-us"/></PerformanceCounterConfiguration><PerformanceCounterConfiguration counterSpecifier="\Processor\PercentInterruptTime" sampleRate="PT15S" unit="Percent"><annotation displayName="CPU interrupt time" locale="en-us"/></PerformanceCounterConfiguration><PerformanceCounterConfiguration counterSpecifier="\Processor\PercentDPCTime" sampleRate="PT15S" unit="Percent"><annotation displayName="CPU DPC time" locale="en-us"/></PerformanceCounterConfiguration><PerformanceCounterConfiguration counterSpecifier="\Processor\PercentProcessorTime" sampleRate="PT15S" unit="Percent"><annotation displayName="CPU percentage guest OS" locale="en-us"/></PerformanceCounterConfiguration><PerformanceCounterConfiguration counterSpecifier="\Processor\PercentIOWaitTime" sampleRate="PT15S" unit="Percent"><annotation displayName="CPU IO wait time" locale="en-us"/></PerformanceCounterConfiguration><PerformanceCounterConfiguration counterSpecifier="\PhysicalDisk\BytesPerSecond" sampleRate="PT15S" unit="BytesPerSecond"><annotation displayName="Disk total bytes" locale="en-us"/></PerformanceCounterConfiguration><PerformanceCounterConfiguration counterSpecifier="\PhysicalDisk\ReadBytesPerSecond" sampleRate="PT15S" unit="BytesPerSecond"><annotation displayName="Disk read guest OS" locale="en-us"/></PerformanceCounterConfiguration><PerformanceCounterConfiguration counterSpecifier="\PhysicalDisk\WriteBytesPerSecond" sampleRate="PT15S" unit="BytesPerSecond"><annotation displayName="Disk write guest OS" locale="en-us"/></PerformanceCounterConfiguration><PerformanceCounterConfiguration counterSpecifier="\PhysicalDisk\TransfersPerSecond" sampleRate="PT15S" unit="CountPerSecond"><annotation displayName="Disk transfers" locale="en-us"/></PerformanceCounterConfiguration><PerformanceCounterConfiguration counterSpecifier="\PhysicalDisk\ReadsPerSecond" sampleRate="PT15S" unit="CountPerSecond"><annotation displayName="Disk reads" locale="en-us"/></PerformanceCounterConfiguration><PerformanceCounterConfiguration counterSpecifier="\PhysicalDisk\WritesPerSecond" sampleRate="PT15S" unit="CountPerSecond"><annotation displayName="Disk writes" locale="en-us"/></PerformanceCounterConfiguration><PerformanceCounterConfiguration counterSpecifier="\PhysicalDisk\AverageReadTime" sampleRate="PT15S" unit="Seconds"><annotation displayName="Disk read time" locale="en-us"/></PerformanceCounterConfiguration><PerformanceCounterConfiguration counterSpecifier="\PhysicalDisk\AverageWriteTime" sampleRate="PT15S" unit="Seconds"><annotation displayName="Disk write time" locale="en-us"/></PerformanceCounterConfiguration><PerformanceCounterConfiguration counterSpecifier="\PhysicalDisk\AverageTransferTime" sampleRate="PT15S" unit="Seconds"><annotation displayName="Disk transfer time" locale="en-us"/></PerformanceCounterConfiguration><PerformanceCounterConfiguration counterSpecifier="\PhysicalDisk\AverageDiskQueueLength" sampleRate="PT15S" unit="Count"><annotation displayName="Disk queue length" locale="en-us"/></PerformanceCounterConfiguration><PerformanceCounterConfiguration counterSpecifier="\NetworkInterface\BytesTransmitted" sampleRate="PT15S" unit="Bytes"><annotation displayName="Network out guest OS" locale="en-us"/></PerformanceCounterConfiguration><PerformanceCounterConfiguration counterSpecifier="\NetworkInterface\BytesReceived" sampleRate="PT15S" unit="Bytes"><annotation displayName="Network in guest OS" locale="en-us"/></PerformanceCounterConfiguration><PerformanceCounterConfiguration counterSpecifier="\NetworkInterface\PacketsTransmitted" sampleRate="PT15S" unit="Count"><annotation displayName="Packets sent" locale="en-us"/></PerformanceCounterConfiguration><PerformanceCounterConfiguration counterSpecifier="\NetworkInterface\PacketsReceived" sampleRate="PT15S" unit="Count"><annotation displayName="Packets received" locale="en-us"/></PerformanceCounterConfiguration><PerformanceCounterConfiguration counterSpecifier="\NetworkInterface\BytesTotal" sampleRate="PT15S" unit="Bytes"><annotation displayName="Network total bytes" locale="en-us"/></PerformanceCounterConfiguration><PerformanceCounterConfiguration counterSpecifier="\NetworkInterface\TotalRxErrors" sampleRate="PT15S" unit="Count"><annotation displayName="Packets received errors" locale="en-us"/></PerformanceCounterConfiguration><PerformanceCounterConfiguration counterSpecifier="\NetworkInterface\TotalTxErrors" sampleRate="PT15S" unit="Count"><annotation displayName="Packets sent errors" locale="en-us"/></PerformanceCounterConfiguration><PerformanceCounterConfiguration counterSpecifier="\NetworkInterface\TotalCollisions" sampleRate="PT15S" unit="Count"><annotation displayName="Network collisions" locale="en-us"/></PerformanceCounterConfiguration></PerformanceCounters><Metrics resourceId="/subscriptions/0b4b20c5-******/resourceGroups/hlmrgn1/providers/Microsoft.Compute/virtualMachines/hlmcen75n1-t1"><MetricAggregation scheduledTransferPeriod="PT1H"/><MetricAggregation scheduledTransferPeriod="PT1M"/></Metrics></DiagnosticMonitorConfiguration></WadCfg>

6.为虚拟机安装LAD2.3

PS C:\Users\he.liming> $LAD='LinuxDiagnostic'
PS C:\Users\he.liming> $Publisher='Microsoft.OSTCExtensions'
PS C:\Users\he.liming> $Ver=2.3
PS C:\Users\he.liming> $PrivateSettings = -join @(Get-Content 'C:\Users\he.liming\Desktop\ProtectSetting_Linux_Mooncake.json')
PS C:\Users\he.liming> $Settings = -join @(Get-Content 'C:\Users\he.liming\Desktop\PublicConfig_Linux_Mooncake_base64code.json')
PS C:\Users\he.liming> Set-AzureRmVMExtension -ResourceGroupName $RGName -VMName $VMName -Location $Location -Name $LAD -Publisher $Publisher -ExtensionType $LAD -TypeHandlerVersion $Ver -Se
ttingString $Settings -ProtectedSettingString $PrivateSettings
RequestId IsSuccessStatusCode StatusCode ReasonPhrase
--------- ------------------- ---------- ------------
True OK OK

ARM VM安装Linux Diagnostic 2.3扩展的更多相关文章

  1. VM 安装 linux Enterprise_R5_U4_Server_I386_DVD教程图解

    ocp 学习笔记 20161126--------linux 笔记整理 一:安装linux系统环境: 1:linux 系统安装包下载路径:链接:链接: https://pan.baidu.com/s/ ...

  2. VM安装linux操作系统详细教程

    1.首先我们新建一个虚拟机,先不安装操作系统,稍后再对其安装Linux系统. 新建虚拟机步骤如下: 打开VMware软件,菜单栏点击“文件(F)”–>选择“新建虚拟机(N)”,如下图1,(或者直 ...

  3. 虚拟机VM安装linux系统

    废话不多说,直接上图文过程: 1.首先是下载linux镜像文件了(CentOS,Ubuntu等,根据自己的实际需求下载) linux镜像下载(提供几个32位的linux镜像下载,如有其他需求请自行百度 ...

  4. 虚拟机VM安装Linux系统CentOS7

    第一步:安装一个VM虚拟机: 百度VM,使用普通下载,一路Next即可 如果需要输入序列号,可以网上随意找一个,目前是个人可以随意激活,但如果做商业用途的话,还是最好买一个序列号,我在网上搜到的:5A ...

  5. Linux 发展史与vm安装linux centos 6.9

    操作系统 是一个人与计算机硬件的中介. Linux操作系统 开源代码的.自由传播的类Unix操作系系统软件: 多用户.多任务.多线程.多CPU的操作系统. 服务器端.嵌入式开发.个人pc桌面,服务器领 ...

  6. GNU ARM eclipse 安装--Linux 版本

    官方网站:https://gnu-mcu-eclipse.github.io/ 1. 工具链安装 1.1 xpm 安装 安装 nodejs: sudo apt-get install nodejs s ...

  7. VM安装Linux Centos7.0虚拟机

    一.准备工作 1.安装VMware 官网https://www.vmware.com/cn.html 2.准备centos7的镜像文件 官网下载链接:http://isoredirect.centos ...

  8. VM安装linux

      看图简单流程即可.注意磁盘空间至少30G,实用oracle数据库时需要更大,可以后期增加.   静待安装完成即可.一定记得创建的用户名及密码,及root用户的密码.

  9. Windows Azure Virtual Machine (36) 扩展Azure ARM VM的磁盘大小

    <Windows Azure Platform 系列文章目录> 在默认情况下,Azure ARM VM的操作系统磁盘(OS Disk),容量为: (1)Windows VM OS Disk ...

随机推荐

  1. Plan & Future

    以下是OI省选前的数据结构与算法整理,可能还不是很全面.但是已经是全网相对比较全面的了.所有标记为“基础”“进阶”“中级”“提高”的知识为近些年来NOIp考察的内容,需重点掌握. 所有“高级”部分为N ...

  2. UVA - 1374 Power Calculus (dfs迭代加深搜索)

    题目: 输入正整数n(1≤n≤1000),问最少需要几次乘除法可以从x得到xn ?在计算过程中x的指数应当总是正整数. 思路: dfs枚举次数深搜 注意: 1.指数如果小于0,就退出当前的搜索 2.n ...

  3. Moving Tables POJ - 1083 (思维)

    题目大意 在一层楼上推桌子,每个空间一次只能推1种桌子,且消耗十分钟.可以同时推多个桌子,但是他们所占的空间不能是相交的如图 解法 真的很考验思维能力,首先考虑到这个走廊是有两排的,我瞬间想到了宿舍楼 ...

  4. Ajax_数据格式_XML

    [XML] 优点: --XML是一种通用的数据格式. --不必把数据强加到已经定义好的格式中,而是要为数据自定义合适的标记. --利用DOM可以完全掌控文档. 缺点: --如果文档来自于服务器,就必须 ...

  5. 【Codeforces 1038D】Slime

    [链接] 我是链接,点我呀:) [题意] 题意 [题解] 相当于让你确定每个数字前面的系数是-1还是+1 有个结论是这样每次和相邻的减的话, 任何出除了全"-1"和全"+ ...

  6. 【codeforces 709C】Letters Cyclic Shift

    [题目链接]:http://codeforces.com/contest/709/problem/C [题意] 让你改变一个字符串的子集(连续的一段); ->这一段的每个字符的字母都变成之前的一 ...

  7. hdu2852 KiKi's K-Number

    题意:给定三个操作添加删除查询大于a的的第k大值----树状数组的逆向操作 给定a利用BIT查询有多少值比a小,这样比a大的k大值就应该有k+sum(a)个小于他的值 因此可以二分枚举k大值看看是不是 ...

  8. 15、Java并发性和多线程-线程通讯

    以下内容转自http://ifeve.com/thread-signaling/: 线程通信的目标是使线程间能够互相发送信号.另一方面,线程通信使线程能够等待其他线程的信号. 例如,线程B可以等待线程 ...

  9. Spring/Maven/MyBatis配置文件结合properties文件使用

    使用properties文件也叫注入,比如把一些常用的配置项写入到这个文件,然后在Spring的XML配置文件中使用EL表达式去获取. 这种方式不只Spring可以使用,同样MyBatis也可以使用, ...

  10. ASPNET Razor 使用 @Ajax.BeginForm 需要注意到的细节

    创建空的web项目,通过Nuget引用mvc组件来搭建空的MVC项目时, 在视图页面中无法使用@Ajax.BegForm来进行异步提交数据, 而新建默认的MVC模板项目却能够正常使用@Ajax.Beg ...