Comments (23)
Hi,
Can you please rerun using switches . ./az2tf.sh ....... -v yes -d yes .
I need to see the debug output to see what's going on.
from py-az2tf.
I have tried to run this a few times now and keeps failing at same point after a few minutes:
"counterSpecifier": "\Network Interface()\Packets Outbound Errors",
"counterSpecifier": "\Network Interface()\Packets Received Errors",
{"StorageAccount": "access2diag425", "WadCfg": {"DiagnosticMonitorConfiguration": {"overallQuotaInMB": 5120, "Metrics": {"resourceId": "/subscriptions/XXX/resourceGroups/access2/providers/Microsoft.Compute/virtualMachines/vnssrsa2VM1", "MetricAggregation": [{"scheduledTransferPeriod": "PT1H"}, {"scheduledTransferPeriod": "PT1M"}]}, "DiagnosticInfrastructureLogs": {"scheduledTransferLogLevelFilter": "Error"}, "PerformanceCounters": {"scheduledTransferPeriod": "PT1M", "PerformanceCounterConfiguration": [{"counterSpecifier": "\Processor Information(_Total)\% Processor Time", "sampleRate": "PT1M"}, {"counterSpecifier": "\Processor Information(_Total)\% Privileged Time", "sampleRate": "PT1M"}, {"counterSpecifier": "\Processor Information(_Total)\% User Time", "sampleRate": "PT1M"}, {"counterSpecifier": "\Processor Information(_Total)\Processor Frequency", "sampleRate": "PT1M"}, {"counterSpecifier": "\System\Processes", "sampleRate": "PT1M"}, {"counterSpecifier": "\Process(_Total)\Thread Count", "sampleRate": "PT1M"}, {"counterSpecifier": "\Process(_Total)\Handle Count", "sampleRate": "PT1M"}, {"counterSpecifier": "\System\System Up Time", "sampleRate": "PT1M"}, {"counterSpecifier": "\System\Context Switches/sec", "sampleRate": "PT1M"}, {"counterSpecifier": "\System\Processor Queue Length", "sampleRate": "PT1M"}, {"counterSpecifier": "\Memory\% Committed Bytes In Use", "sampleRate": "PT1M"}, {"counterSpecifier": "\Memory\Available Bytes", "sampleRate": "PT1M"}, {"counterSpecifier": "\Memory\Committed Bytes", "sampleRate": "PT1M"}, {"counterSpecifier": "\Memory\Cache Bytes", "sampleRate": "PT1M"}, {"counterSpecifier": "\Memory\Pool Paged Bytes", "sampleRate": "PT1M"}, {"counterSpecifier": "\Memory\Pool Nonpaged Bytes", "sampleRate": "PT1M"}, {"counterSpecifier": "\Memory\Pages/sec", "sampleRate": "PT1M"}, {"counterSpecifier": "\Memory\Page Faults/sec", "sampleRate": "PT1M"}, {"counterSpecifier": "\Process(_Total)\Working Set", "sampleRate": "PT1M"}, {"counterSpecifier": "\Process(_Total)\Working Set - Private", "sampleRate": "PT1M"}, {"counterSpecifier": "\LogicalDisk(_Total)\% Disk Time", "sampleRate": "PT1M"}, {"counterSpecifier": "\LogicalDisk(_Total)\% Disk Read Time", "sampleRate": "PT1M"}, {"counterSpecifier": "\LogicalDisk(_Total)\% Disk Write Time", "sampleRate": "PT1M"}, {"counterSpecifier": "\LogicalDisk(_Total)\% Idle Time", "sampleRate": "PT1M"}, {"counterSpecifier": "\LogicalDisk(_Total)\Disk Bytes/sec", "sampleRate": "PT1M"}, {"counterSpecifier": "\LogicalDisk(_Total)\Disk Read Bytes/sec", "sampleRate": "PT1M"}, {"counterSpecifier": "\LogicalDisk(_Total)\Disk Write Bytes/sec", "sampleRate": "PT1M"}, {"counterSpecifier": "\LogicalDisk(_Total)\Disk Transfers/sec", "sampleRate": "PT1M"}, {"counterSpecifier": "\LogicalDisk(_Total)\Disk Reads/sec", "sampleRate": "PT1M"}, {"counterSpecifier": "\LogicalDisk(_Total)\Disk Writes/sec", "sampleRate": "PT1M"}, {"counterSpecifier": "\LogicalDisk(_Total)\Avg. Disk sec/Transfer", "sampleRate": "PT1M"}, {"counterSpecifier": "\LogicalDisk(_Total)\Avg. Disk sec/Read", "sampleRate": "PT1M"}, {"counterSpecifier": "\LogicalDisk(_Total)\Avg. Disk sec/Write", "sampleRate": "PT1M"}, {"counterSpecifier": "\LogicalDisk(_Total)\Avg. Disk Queue Length", "sampleRate": "PT1M"}, {"counterSpecifier": "\LogicalDisk(_Total)\Avg. Disk Read Queue Length", "sampleRate": "PT1M"}, {"counterSpecifier": "\LogicalDisk(_Total)\Avg. Disk Write Queue Length", "sampleRate": "PT1M"}, {"counterSpecifier": "\LogicalDisk(_Total)\% Free Space", "sampleRate": "PT1M"}, {"counterSpecifier": "\LogicalDisk(_Total)\Free Megabytes", "sampleRate": "PT1M"}, {"counterSpecifier": "\Network Interface()\Bytes Total/sec", "sampleRate": "PT1M"}, {"counterSpecifier": "\Network Interface()\Bytes Sent/sec", "sampleRate": "PT1M"}, {"counterSpecifier": "\Network Interface()\Bytes Received/sec", "sampleRate": "PT1M"}, {"counterSpecifier": "\Network Interface()\Packets/sec", "sampleRate": "PT1M"}, {"counterSpecifier": "\Network Interface()\Packets Sent/sec", "sampleRate": "PT1M"}, {"counterSpecifier": "\Network Interface()\Packets Received/sec", "sampleRate": "PT1M"}, {"counterSpecifier": "\Network Interface()\Packets Outbound Errors", "sampleRate": "PT1M"}, {"counterSpecifier": "\Network Interface()\Packets Received Errors", "sampleRate": "PT1M"}]}, "WindowsEventLog": {"scheduledTransferPeriod": "PT1M", "DataSource": [{"name": "Application![System[(Level = 1 or Level = 2 or Level = 3)]]"}, {"name": "Security![System[band(Keywords,4503599627370496)]]"}, {"name": "System!*[System[(Level = 1 or Level = 2 or Level = 3)]]"}]}}}})
Error in az2tf.py
from py-az2tf.
Hi - just need to see a little more - before/after your posted output
from py-az2tf.
did you post on the wrong issue ? doesn't look like traffic manager related issue
from py-az2tf.
no, this is now a new one for me. Before I was able to reproduce the TM a few times.
from py-az2tf.
sorry i was logged in as another account. user above is me.
from py-az2tf.
Here are a few lines just above, there is nothing at the end as it stops there:
File generated by py-az2tf see: https://github.com/andyt530/py-az2tf
resource azurerm_monitor_autoscale_setting access2__access2serviceplan-access2-Central-US {
name = "access2serviceplan-access2-Central US"
location = "Central US"
resource_group_name = "access2"
enabled = false
target_resource_id = "/subscriptions/XXX/resourcegroups/access2/providers/Microsoft.Web/serverfarms/access2serviceplan"
profile {
name = "Default"
capacity {
default = "2"
minimum = "2"
maximum = "2"
}
}
tags = {
"hidden-link:/subscriptions/XXX/resourcegroups/access2/providers/Microsoft.Web/serverfarms/access2serviceplan"="Resource"
}
}
"scheduledTransferLogLevelFilter": "Error"
"counterSpecifier": "\\Network Interface(*)\\Packets Outbound Errors",
"counterSpecifier": "\\Network Interface(*)\\Packets Received Errors",
from py-az2tf.
possible fix posted - if it fails again please provide even more of the debug (-d yes) output for me
from py-az2tf.
new issue came up now:
File generated by py-az2tf see: https://github.com/andyt530/py-az2tf
resource azurerm_virtual_machine dev-vue__DevSSRS01 {
name = "DevSSRS01"
location = "centralus"
resource_group_name = "DEV-VUE"
vm_size = "Standard_B2s"
network_interface_ids = [
azurerm_network_interface.dev-vue__devssrsnic0.id, ]
primary_network_interface_id = azurerm_network_interface.dev-vue__devssrsnic0.id
delete_data_disks_on_termination = "false"
delete_os_disk_on_termination = "false"
boot_diagnostics {
enabled = true
storage_uri = "XXX"
}
storage_os_disk {
name = "DevSSRS01_OsDisk"
caching = "ReadWrite"
create_option = "Attach"
os_type = "Windows"
disk_size_gb = "127"
managed_disk_type = "Standard_LRS"
managed_disk_id = "/subscriptions/XXX/resourceGroups/Dev-Vue/providers/Microsoft.Compute/disks/DevSSRS01_OsDisk"
}
tags = {
}
}
azurerm_virtual_machine_extension
11
Traceback (most recent call last):
File "../../scripts/az2tf.py", line 382, in
azurerm_virtual_machine_extension.azurerm_virtual_machine_extension(crf,cde,crg,headers,requests,sub,json,az2tfmess,cldurl)
File "/Users/timwillis/Documents/Repos/git/az2tf/py-az2tf/scripts/azurerm_virtual_machine_extension.py", line 51, in azurerm_virtual_machine_extension
print(json.dumps(r2, indent=4, separators=(',', ': ')))
File "/usr/local/Cellar/python/3.7.6_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/json/init.py", line 238, in dumps
**kw).encode(obj)
File "/usr/local/Cellar/python/3.7.6_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/json/encoder.py", line 201, in encode
chunks = list(chunks)
File "/usr/local/Cellar/python/3.7.6_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/json/encoder.py", line 438, in _iterencode
o = _default(o)
File "/usr/local/Cellar/python/3.7.6_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/json/encoder.py", line 179, in default
raise TypeError(f'Object of type {o.class.name} '
TypeError: Object of type Response is not JSON serializable
raise TypeError(f'Object of type {o.class.name} '
TypeError: Object of type Response is not JSON serializable
Error in az2tf.py
from py-az2tf.
sorry - my fault - fixed that - please give it another go.
from py-az2tf.
fix above worked. but still failed at previous spot. Added a few more lines from above:
resource azurerm_api_management access2__QAVueAuthServer {
name = "QAVueAuthServer"
location = "Central US"
resource_group_name = "access2"
publisher_name = "XXX"
publisher_email = "XXX"
sku {
name = "Developer"
capacity = "1"
}
tags = {
}
}
azurerm_monitor_autoscale_setting
1
{
"id": "/subscriptions/XXX/resourceGroups/access2/providers/microsoft.insights/autoscalesettings/access2serviceplan-access2-Central US",
"name": "access2serviceplan-access2-Central US",
"type": "Microsoft.Insights/autoscaleSettings",
"location": "Central US",
"tags": {
"hidden-link:/subscriptions/XXX/resourcegroups/access2/providers/Microsoft.Web/serverfarms/access2serviceplan": "Resource"
},
"properties": {
"profiles": [
{
"name": "Default",
"capacity": {
"minimum": "2",
"maximum": "2",
"default": "2"
},
"rules": []
}
],
"enabled": false,
"name": "access2serviceplan-access2-Central US",
"targetResourceUri": "/subscriptions/XXX/resourcegroups/access2/providers/Microsoft.Web/serverfarms/access2serviceplan",
"targetResourceLocation": "Central US",
"notifications": []
}
}
File generated by py-az2tf see: https://github.com/andyt530/py-az2tf
resource azurerm_monitor_autoscale_setting access2__access2serviceplan-access2-Central-US {
name = "access2serviceplan-access2-Central US"
location = "Central US"
resource_group_name = "access2"
enabled = false
target_resource_id = "/subscriptions/XXX/resourcegroups/access2/providers/Microsoft.Web/serverfarms/access2serviceplan"
profile {
name = "Default"
capacity {
default = "2"
minimum = "2"
maximum = "2"
}
}
tags = {
"hidden-link:/subscriptions/XXX/resourcegroups/access2/providers/Microsoft.Web/serverfarms/access2serviceplan"="Resource"
}
}
"scheduledTransferLogLevelFilter": "Error"
"counterSpecifier": "\\Network Interface(*)\\Packets Outbound Errors",
"counterSpecifier": "\\Network Interface(*)\\Packets Received Errors",
{"StorageAccount": "access2diag425", "WadCfg": {"DiagnosticMonitorConfiguration": {"overallQuotaInMB": 5120, "Metrics": {"resourceId": "/subscriptions/XXX/resourceGroups/access2/providers/Microsoft.Compute/virtualMachines/vnssrsa2VM1", "MetricAggregation": [{"scheduledTransferPeriod": "PT1H"}, {"scheduledTransferPeriod": "PT1M"}]}, "DiagnosticInfrastructureLogs": {"scheduledTransferLogLevelFilter": "Error"}, "PerformanceCounters": {"scheduledTransferPeriod": "PT1M", "PerformanceCounterConfiguration": [{"counterSpecifier": "\Processor Information(_Total)\% Processor Time", "sampleRate": "PT1M"}, {"counterSpecifier": "\Processor Information(_Total)\% Privileged Time", "sampleRate": "PT1M"}, {"counterSpecifier": "\Processor Information(_Total)\% User Time", "sampleRate": "PT1M"}, {"counterSpecifier": "\Processor Information(_Total)\Processor Frequency", "sampleRate": "PT1M"}, {"counterSpecifier": "\System\Processes", "sampleRate": "PT1M"}, {"counterSpecifier": "\Process(_Total)\Thread Count", "sampleRate": "PT1M"}, {"counterSpecifier": "\Process(_Total)\Handle Count", "sampleRate": "PT1M"}, {"counterSpecifier": "\System\System Up Time", "sampleRate": "PT1M"}, {"counterSpecifier": "\System\Context Switches/sec", "sampleRate": "PT1M"}, {"counterSpecifier": "\System\Processor Queue Length", "sampleRate": "PT1M"}, {"counterSpecifier": "\Memory\% Committed Bytes In Use", "sampleRate": "PT1M"}, {"counterSpecifier": "\Memory\Available Bytes", "sampleRate": "PT1M"}, {"counterSpecifier": "\Memory\Committed Bytes", "sampleRate": "PT1M"}, {"counterSpecifier": "\Memory\Cache Bytes", "sampleRate": "PT1M"}, {"counterSpecifier": "\Memory\Pool Paged Bytes", "sampleRate": "PT1M"}, {"counterSpecifier": "\Memory\Pool Nonpaged Bytes", "sampleRate": "PT1M"}, {"counterSpecifier": "\Memory\Pages/sec", "sampleRate": "PT1M"}, {"counterSpecifier": "\Memory\Page Faults/sec", "sampleRate": "PT1M"}, {"counterSpecifier": "\Process(_Total)\Working Set", "sampleRate": "PT1M"}, {"counterSpecifier": "\Process(_Total)\Working Set - Private", "sampleRate": "PT1M"}, {"counterSpecifier": "\LogicalDisk(_Total)\% Disk Time", "sampleRate": "PT1M"}, {"counterSpecifier": "\LogicalDisk(_Total)\% Disk Read Time", "sampleRate": "PT1M"}, {"counterSpecifier": "\LogicalDisk(_Total)\% Disk Write Time", "sampleRate": "PT1M"}, {"counterSpecifier": "\LogicalDisk(_Total)\% Idle Time", "sampleRate": "PT1M"}, {"counterSpecifier": "\LogicalDisk(_Total)\Disk Bytes/sec", "sampleRate": "PT1M"}, {"counterSpecifier": "\LogicalDisk(_Total)\Disk Read Bytes/sec", "sampleRate": "PT1M"}, {"counterSpecifier": "\LogicalDisk(_Total)\Disk Write Bytes/sec", "sampleRate": "PT1M"}, {"counterSpecifier": "\LogicalDisk(_Total)\Disk Transfers/sec", "sampleRate": "PT1M"}, {"counterSpecifier": "\LogicalDisk(_Total)\Disk Reads/sec", "sampleRate": "PT1M"}, {"counterSpecifier": "\LogicalDisk(_Total)\Disk Writes/sec", "sampleRate": "PT1M"}, {"counterSpecifier": "\LogicalDisk(_Total)\Avg. Disk sec/Transfer", "sampleRate": "PT1M"}, {"counterSpecifier": "\LogicalDisk(_Total)\Avg. Disk sec/Read", "sampleRate": "PT1M"}, {"counterSpecifier": "\LogicalDisk(_Total)\Avg. Disk sec/Write", "sampleRate": "PT1M"}, {"counterSpecifier": "\LogicalDisk(_Total)\Avg. Disk Queue Length", "sampleRate": "PT1M"}, {"counterSpecifier": "\LogicalDisk(_Total)\Avg. Disk Read Queue Length", "sampleRate": "PT1M"}, {"counterSpecifier": "\LogicalDisk(_Total)\Avg. Disk Write Queue Length", "sampleRate": "PT1M"}, {"counterSpecifier": "\LogicalDisk(_Total)\% Free Space", "sampleRate": "PT1M"}, {"counterSpecifier": "\LogicalDisk(_Total)\Free Megabytes", "sampleRate": "PT1M"}, {"counterSpecifier": "\Network Interface()\Bytes Total/sec", "sampleRate": "PT1M"}, {"counterSpecifier": "\Network Interface()\Bytes Sent/sec", "sampleRate": "PT1M"}, {"counterSpecifier": "\Network Interface()\Bytes Received/sec", "sampleRate": "PT1M"}, {"counterSpecifier": "\Network Interface()\Packets/sec", "sampleRate": "PT1M"}, {"counterSpecifier": "\Network Interface()\Packets Sent/sec", "sampleRate": "PT1M"}, {"counterSpecifier": "\Network Interface()\Packets Received/sec", "sampleRate": "PT1M"}, {"counterSpecifier": "\Network Interface()\Packets Outbound Errors", "sampleRate": "PT1M"}, {"counterSpecifier": "\Network Interface()\Packets Received Errors", "sampleRate": "PT1M"}]}, "WindowsEventLog": {"scheduledTransferPeriod": "PT1M", "DataSource": [{"name": "Application![System[(Level = 1 or Level = 2 or Level = 3)]]"}, {"name": "Security![System[band(Keywords,4503599627370496)]]"}, {"name": "System!*[System[(Level = 1 or Level = 2 or Level = 3)]]"}]}}}})
Error in az2tf.py
from py-az2tf.
Ran again with out debug and it error on the TM part:
terraform validate
Warning: "sku": [DEPRECATED] This property has been deprecated in favour of the 'sku_name' property and will be removed in version 2.0 of the provider
on azurerm_api_management.access2__QAVueAuthServer.tf line 2, in resource "azurerm_api_management" "access2__QAVueAuthServer":
2: resource azurerm_api_management access2__QAVueAuthServer {
(and one more similar warning elsewhere)
Error: Reference to undeclared resource
on azurerm_traffic_manager_endpoint.access2__DMSQA.tf line 11, in resource "azurerm_traffic_manager_endpoint" "access2__DMSQA":
11: target_resource_id = azurerm_public_ip.access2__access2qa.id
A managed resource "azurerm_public_ip" "access2__access2qa" has not been
declared in the root module.
Error Validating
from py-az2tf.
ONe more time with debug please (I changed the code to give me more with a debug)
from py-az2tf.
ran again with debug after getting lasted updates, same error as before when running a debug
from py-az2tf.
Please could you post the debug output from that last run - it will contain info. that will help me see why it's producing the incorrect line
target_resource_id = azurerm_public_ip.access2__access2qa.id
The debug output should show json structure that's returned form Azure - just before generating the terraform file (which uses that json structure)
I'm close to fixing this - I can see my code hard codes the resource type as "azure_public_ip" - which it should not do.
I need to see your debug json output as you have a combination I haven't tested here.
I should be able to quickly code it to the right resource type rather than the hardcoded azure_public_ip
from py-az2tf.
oh it's ok - there's enough in your previous posts for me to work with ...
from py-az2tf.
fix posted if you'd like to try it
from py-az2tf.
I pulled latest code and ran again. Debug still failed at the same spot, but regular run seems to have worked for the TM. But now have another error. Looks like it fails with app services slots. Just a small example.
Error: Reference to undeclared resource
on azurerm_app_service_slot.dev-vue__DevVueAB.tf line 6, in resource "azurerm_app_service_slot" "dev-vue__DevVueAB":
6: app_service_name = azurerm_app_service.Dev-Vue__DevVue.name
A managed resource "azurerm_app_service" "Dev-Vue__DevVue" has not been
declared in the root module.
Error: Reference to undeclared resource
on azurerm_app_service_slot.dev-vue__DevVueAC.tf line 6, in resource "azurerm_app_service_slot" "dev-vue__DevVueAC":
6: app_service_name = azurerm_app_service.Dev-Vue__DevVue.name
A managed resource "azurerm_app_service" "Dev-Vue__DevVue" has not been
declared in the root module.
from py-az2tf.
I see the problem - will post fix tomorrow
from py-az2tf.
fix posted
from py-az2tf.
Looks to still be happening:
Error: Reference to undeclared resource
on azurerm_app_service_slot.dev-vue__DevVue__DevVueAB.tf line 6, in resource "azurerm_app_service_slot" "dev-vue__DevVue__DevVueAB":
6: app_service_name = azurerm_app_service.Dev-Vue__DevVue.name
A managed resource "azurerm_app_service" "Dev-Vue__DevVue" has not been
declared in the root module.
Error: Reference to undeclared resource
on azurerm_app_service_slot.dev-vue__DevVue__DevVueAC.tf line 6, in resource "azurerm_app_service_slot" "dev-vue__DevVue__DevVueAC":
6: app_service_name = azurerm_app_service.Dev-Vue__DevVue.name
A managed resource "azurerm_app_service" "Dev-Vue__DevVue" has not been
declared in the root module.
from py-az2tf.
just pulled latest code and was able to now completely run a Debug run with no errors.
Success! The configuration is valid, but there were some validation warnings as shown above.
from py-az2tf.
Closing - reopen of further issues
from py-az2tf.
Related Issues (20)
- Invalid escape sequence HOT 3
- Error in az2tf.py Unicode for Policy info HOT 3
- ValueError malformed string in ast.py HOT 5
- Support for other Azure Clouds HOT 3
- Support for Python 3 HOT 1
- Warning: "network_security_group_id": [DEPRECATED] Use the `azurerm_subnet_network_security_group_association` resource instead. HOT 1
- IndexError: list index out of range HOT 7
- Error HOT 17
- Error naming slots resources HOT 1
- The argument "fqdns" was already set at fqdns = ["x.x.x.x"] HOT 2
- Note in resource "azurerm_management_lock" HOT 22
- azurerm_virtual_network_gateway_connection issue HOT 7
- Azure Role Definition Import fails when role definition has no description HOT 1
- terraform validate fails because storage profile block is never created in vmss import HOT 1
- KeyError for loadBalancerBackendAddressPools in vmss HOT 1
- Invalid multi-line string error HOT 4
- Azurerm 2.0 fails to validate HOT 1
- Tool isnt working
- Still active? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from py-az2tf.