Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Gelencsér Szabolcs
/
vmdriver
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Wiki
Members
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
97862831
authored
Nov 01, 2016
by
Szabolcs Gelencser
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove install diagnostics task.
parent
f2688b1f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
0 additions
and
95 deletions
+0
-95
miscellaneous/linux_diagnostics.xml
+0
-29
vmdriver.py
+0
-66
No files found.
miscellaneous/linux_diagnostics.xml
deleted
100644 → 0
View file @
f2688b1f
<WadCfg>
<DiagnosticMonitorConfiguration
overallQuotaInMB=
"4096"
>
<DiagnosticInfrastructureLogs
scheduledTransferLogLevelFilter=
"Warning"
scheduledTransferPeriod=
"PT1M"
/>
<PerformanceCounters
scheduledTransferPeriod=
"PT1M"
>
<PerformanceCounterConfiguration
counterSpecifier=
"\Memory\PercentUsedMemory"
sampleRate=
"PT15S"
unit=
"Percent"
>
<annotation
displayName=
"Memory percentage"
locale=
"en-us"
/>
</PerformanceCounterConfiguration>
<PerformanceCounterConfiguration
counterSpecifier=
"\Processor\PercentProcessorTime"
sampleRate=
"PT15S"
unit=
"Percent"
>
<annotation
displayName=
"CPU percentage guest OS"
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>
</PerformanceCounters>
<Metrics
resourceId=
"/subscriptions/$SUBSCRIPTION_ID/resourceGroups/$GROUP_NAME/providers/Microsoft.Compute/virtualMachines/$VM_NAME"
>
<MetricAggregation
scheduledTransferPeriod=
"PT1H"
/>
<MetricAggregation
scheduledTransferPeriod=
"PT1M"
/>
</Metrics>
</DiagnosticMonitorConfiguration>
</WadCfg>
vmdriver.py
View file @
97862831
...
...
@@ -7,7 +7,6 @@ import socket
import
json
from
decorator
import
decorator
import
lxml.etree
as
ET
import
base64
from
psutil
import
NUM_CPUS
,
virtual_memory
,
cpu_percent
...
...
@@ -309,71 +308,6 @@ def resume(vm_name):
return
None
@celery.task
def
install_diagnostics_extension
(
vm_name
):
"""
Install diagnostics extension on already running vm
"""
with
open
(
"miscellaneous/linux_diagnostics.xml"
,
"rt"
)
as
linuxdf
:
XmlCfg
=
linuxdf
.
read
()
b64encodedXmlCfg
=
base64
.
b64encode
(
XmlCfg
.
replace
(
"$SUBSCRIPTION_ID"
,
SUBSCRIPTION_ID
,
)
.
replace
(
"$GROUP_NAME"
,
GROUP_NAME
,
)
.
replace
(
"$VM_NAME"
,
vm_name
,
)
)
storage_client
=
azure
.
mgmt
.
storage
.
StorageManagementClient
(
credentials
,
SUBSCRIPTION_ID
,
)
key_result
=
storage_client
.
storage_accounts
.
list_keys
(
GROUP_NAME
,
STORAGE_NAME
,
)
settings
=
{
'StorageAccount'
:
STORAGE_NAME
,
'xmlCfg'
:
b64encodedXmlCfg
,
}
protected_settings
=
{
'storageAccountName'
:
STORAGE_NAME
,
'storageAccountKey'
:
key_result
.
keys
[
0
]
.
value
,
'storageAccountEndPoint'
:
'https://core.windows.net'
,
}
poller
=
compute_client
.
virtual_machine_extensions
.
create_or_update
(
GROUP_NAME
,
vm_name
,
"LinuxDiagnostic"
,
azure
.
mgmt
.
compute
.
models
.
VirtualMachineExtension
(
location
=
REGION
,
publisher
=
"Microsoft.OSTCExtensions"
,
virtual_machine_extension_type
=
"LinuxDiagnostic"
,
type_handler_version
=
"2.3"
,
auto_upgrade_minor_version
=
True
,
protected_settings
=
protected_settings
,
settings
=
settings
,
),
)
try
:
poller
.
wait
()
logging
.
info
(
"installed diagnostics on: '
%
s'"
%
vm_name
)
except
Exception
,
e
:
logging
.
error
(
"cloud not install diagnostics on '
%
s'"
%
vm_name
)
raise
e
@celery.task
def
start
(
params
):
pass
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment