Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add provisioining event tracing #629

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Conversation

timidri
Copy link

@timidri timidri commented Sep 19, 2023

This change adds logging vsphere events if a vsphere VM fails.
The log creates a JSON array from events and includs only the field fullFormattedMessage. It looks like this:

docker-vmpooler-manager-1  | [2023-09-19 11:15:22] [TEST] [debian-11-x86_64] 'idle-prepolymer' events: ["Assigned new BIOS UUID (42043c18-ef33-bbb6-8ac6-cee47effa4c7) to idle-prepolymer on pix-jj28-u19.ops.puppetlabs.net in pix","Assign a new instance UUID (50046dc0-c241-8cb3-0206-c671bf31a5bc) to idle-prepolymer","Changed MAC address from 00:50:56:84:2d:12 to 00:50:56:84:4f:eb for adapter vmpooler2 for idle-prepolymer","Reconfigured idle-prepolymer on pix-jj28-u19.ops.puppetlabs.net in pix.  \n \nModified:  \n \nconfig.annotation: \"Packer build: debian-11-x86_64-0.0.2 built 2021-08-23T13:59:36Z SHA: 5434ca40d3c2c023ddf5283855470987e5b26102 OS Type: debian10_64Guest\" -> \"(\n  \"name\": \"idle-prepolymer\",\n  \"created_by\": \"dimitri.tischenko@perforce.com\",\n  \"base_template\": \"templates/vmpooler_acceptance5/debian-11-x86_64-0.0.3\",\n  \"creation_timestamp\": \"2023-09-19 11:09:12 UTC\"\n)\"; \n\nconfig.hardware.device(4000).macAddress: \"00:50:56:84:2d:12\" -> \"00:50:56:84:4f:eb\"; \n\n Added:  \n \nconfig.extraConfig(\"mainMem.iowait\"): (key = \"mainMem.iowait\", value = \"5\"); \n\nconfig.extraConfig(\"mainMem.ioBlockPages\"): (key = \"mainMem.ioBlockPages\", value = \"2048\"); \n\nconfig.extraConfig(\"guestinfo.hostname\"): (key = \"guestinfo.hostname\", value = \"idle-prepolymer\"); \n\n Deleted:  \n \n","debian-11-x86_64-0.0.3 cloned to idle-prepolymer on pix-jj28-u19.ops.puppetlabs.net,  in pix","idle-prepolymer on pix-jj28-u19.ops.puppetlabs.net in pix is starting","idle-prepolymer on pix-jj28-u19.ops.puppetlabs.net in pix has powered on","Alarm 'vSphere HA virtual machine failover failed' on idle-prepolymer changed from Gray to Green","Virtual machine idle-prepolymer's PMem bandwidth usage is normal","Alarm 'Virtual Machine High PMem Bandwidth Usage' on idle-prepolymer changed from Gray to Green","Alarm 'Virtual machine memory usage' on idle-prepolymer changed from Gray to Green","Alarm 'Virtual machine CPU usage' on idle-prepolymer changed from Gray to Green"]

Pretty-printed version:

[
  "Assigned new BIOS UUID (42043c18-ef33-bbb6-8ac6-cee47effa4c7) to idle-prepolymer on pix-jj28-u19.ops.puppetlabs.net in pix",
  "Assign a new instance UUID (50046dc0-c241-8cb3-0206-c671bf31a5bc) to idle-prepolymer",
  "Changed MAC address from 00:50:56:84:2d:12 to 00:50:56:84:4f:eb for adapter vmpooler2 for idle-prepolymer",
  "Reconfigured idle-prepolymer on pix-jj28-u19.ops.puppetlabs.net in pix.  \n \nModified:  \n \nconfig.annotation: \"Packer build: debian-11-x86_64-0.0.2 built 2021-08-23T13:59:36Z SHA: 5434ca40d3c2c023ddf5283855470987e5b26102 OS Type: debian10_64Guest\" -> \"(\n  \"name\": \"idle-prepolymer\",\n  \"created_by\": \"dimitri.tischenko@perforce.com\",\n  \"base_template\": \"templates/vmpooler_acceptance5/debian-11-x86_64-0.0.3\",\n  \"creation_timestamp\": \"2023-09-19 11:09:12 UTC\"\n)\"; \n\nconfig.hardware.device(4000).macAddress: \"00:50:56:84:2d:12\" -> \"00:50:56:84:4f:eb\"; \n\n Added:  \n \nconfig.extraConfig(\"mainMem.iowait\"): (key = \"mainMem.iowait\", value = \"5\"); \n\nconfig.extraConfig(\"mainMem.ioBlockPages\"): (key = \"mainMem.ioBlockPages\", value = \"2048\"); \n\nconfig.extraConfig(\"guestinfo.hostname\"): (key = \"guestinfo.hostname\", value = \"idle-prepolymer\"); \n\n Deleted:  \n \n",
  "debian-11-x86_64-0.0.3 cloned to idle-prepolymer on pix-jj28-u19.ops.puppetlabs.net,  in pix",
  "idle-prepolymer on pix-jj28-u19.ops.puppetlabs.net in pix is starting",
  "idle-prepolymer on pix-jj28-u19.ops.puppetlabs.net in pix has powered on",
  "Alarm 'vSphere HA virtual machine failover failed' on idle-prepolymer changed from Gray to Green",
  "Virtual machine idle-prepolymer's PMem bandwidth usage is normal",
  "Alarm 'Virtual Machine High PMem Bandwidth Usage' on idle-prepolymer changed from Gray to Green",
  "Alarm 'Virtual machine memory usage' on idle-prepolymer changed from Gray to Green",
  "Alarm 'Virtual machine CPU usage' on idle-prepolymer changed from Gray to Green"
]

Fixes puppetlabs/vmpooler-provider-vsphere#55

@timidri timidri requested a review from a team as a code owner September 19, 2023 11:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make vmpooler query and log status information from VCenter during waiting for a VM
3 participants