question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

updateing virtualmachines is not idempotent

See original GitHub issue

i am using this to update vm’s vcpu, memory and storage values. even at unchanged values it shows up in changelog as 'updated". please take a look at this.

            updt_vals['vcpus']           = i['CPU_VALUE']
            updt_vals['memory']          = i['MEM_VALUE']
            updt_vals['disk']            = i['STORAGE_VALUE']
            try:
                node_obj = nb.virtualization.virtual_machines.get(name=i['NODE'])
                resultsup = node_obj.update(updt_vals)
                if resultsup is True:
                    updated_obj = node_obj.serialize()
                    logging.info('updated netbox object: "%s"' % str(updated_obj))

Screenshot 2022-07-21 114811

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
flynn1973commented, Jul 28, 2022

worked! thank you

1reaction
PieterL75commented, Jul 27, 2022

Make sure to set the python types to the same as the custom field types. If the CF is an integer, make sure the python variable is an integer too (and not a string) or vice versa. I found that this causes the Record._diff function to see that as a difference and update the record

Read more comments on GitHub >

github_iconTop Results From Across the Web

vmware_guest - not idempotent · Issue #1332 - GitHub
SUMMARY ISSUE TYPE When running either a create VM from template or a blank VM the process completes successfully but when run a...
Read more >
Common errors during Classic to Azure Resource Manager ...
This error can happen if the disks of the VM have been deleted or are not accessible anymore. Make sure the disks for...
Read more >
Pattern: Idempotent Consumer - Microservice Architecture
If a consumer is not idempotent, multiple invocations can cause bugs. ... the consumer to store the IDs in the business entities that...
Read more >
Making retries safe with idempotent APIs - Amazon AWS
An idempotent operation is one where a request can be retransmitted or retried with no additional side effects, a property that is very...
Read more >
Idempotent - MDN Web Docs Glossary: Definitions of ... - Mozilla
Successive calls may return different data to the client, if the data on the server was updated in the meantime. POST /add_row HTTP/1.1...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found