How to set vcpupin in guest xml - virtualization

I am working with openstack and I want to pin vcpus to pcpus in guest xml. Now, the pinning operation can be done using
virsh vcpupin guestname vcpu pcpu
But I want to do it using python API. I investigated the openstack code and found out that get_guest_config function in libvirt/driver.py is responsible for generation of guest XML file. Now, I tried to put vcpupin attribute here by guest.vcpupin or guest.cputune_vcpupin but none of them is working. Any idea what am I doing wrong? Or is this functionality not available with openstack?

Okay, I figured it out. You need to define the attributes in the nova.virt.config before using them. After defining the attribute, it's working fine.

Related

OSRM for airports/aerodrome

Has anyone tried to setup OSRM so it works in aerodromes. So, instead of routing on roads (highway:trunk, highway:primary, etc..) I can route on a aerodrome:runway, aerodrome:taxiway and aerodrome:parking_position.
According to https://github.com/Project-OSRM/osrm-backend/issues/4814, the WayHandlers file needs to be updated (as well as updating the profile).
However, there isn't any info on what specifically to do. I'm also using the docker images (osrm/osrm-backend) - is the profile/WayHandlers processing done only in the osrm-extract phase?

Setting SMBIOSAssetTag in a WMIObject via Powershell without a utility

I'm working with a Lenovo Thinkpad and I'm trying to set the asset tag in Powershell without using Lenovo's WinAIA.exe utility due to restrictions at work (wouldn't be able to access Windows. We would be running everything before we got into Windows Setup via Powershell), and I'm not sure how to go about this. Essentially, the property "SMBIOSAssetTag" (from the WMI class win32_SystemEnclosure) is ReadOnly, and I cannot get around this. I did triple check to make sure that Lenovo does not have its own namespace, and while using the Powershell Module "LenovoBIOS" I didn't see anything that could help me achieve this goal (unless I'm blind and totally missed it). Is there any way to go about this? I've also tried modifying the ReadOnly property of the SMBIOSAssetTag property, but I couldn't get that to work. I'd love any and all feedback. If there is any extra information needed, I'd be happy to help as well.
You don't. The property is defined as read-only in the MOF spec by design.
You're talking about writing to the SMBIOS information, which is an operation specific to your motherboard's OEM. It's up to your OEM to determine the data structure and storage method of the SMBIOS information, and the SMBIOS standard does not provide a standard write method the same way that there is a standard read method.

Include runtime type definitions using VSCode extension

I'm working on a library that lets users run Node processes from inside another application. The library is called "max-api"; functions for sending data to the host application are exposed through a Node module and are loaded in the expected way:
const maxAPI = require("max-api");
However, the user never interacts with this module directly. Rather, when the host application launches the Node process, it intercepts the call to require, checks if the name of the module is "max-api", and provides the module if so.
This works great, the only issue is we have no way to provide type definitions for this modules. So, the user doesn't get any autocomplete or validation for functions in the "max-api" module. I was thinking of writing a VSCode extension to provide these, but I'm not 100% sure how to get started. Thanks in advance for any advice.
You could write a TS typings file (see Definitely Typed). This would be installed in node_modules/#types and vscode will automatically pick it up to provide code completion for your module.

Clone rep:policy on AEM

I am currently working on with a solution that would be able to clone/copy/backup my existing rep:policy. 'Cause when we do some jobs it accidentally removed. I am trying to apply this kind of fix, but am failing to. It says it is an invalid path.
javax.jcr.security.AccessControlException: OakAccessControl0006: Isolated policy node. Parent is not of type [rep:AccessControllable]
final Workspace ws = session.getWorkspace();
ws.copy("/etc/commerce/products/abccompany/TvPackChannelMap/rep:policy","/tmp/nxt/TvPackChannelMap/rep:policy");
Are there other ways that I can be able to take the rep:policy thru code?
You need to make sure that your job does not touch the permissions or the rep:policy, this is the best way forward for you.
The exception could be because of /etc/commerce/products/abccompany/TvPackChannelMap/rep:policy does not exist or the user whose session you are using does not have read access to the node.
Make sure the path is correct, copy paste it to your CRX/DE to make sure it exists.
I have tried to use your code to copy a rep:policy from one node to another, works fine. But I would not* recommend copying permissions that way. The best practice is to use the Access Control Management API for all things permissions.
You can check, install and use the access control tool from netcentric. It offers a jmx interface for exporting AC entries and maybe also some APIs you could use to implement your custom solution.
The Other approach is to retrieve the ACL permissions through the query language.
For example, SELECT * FROM [rep:ACL] or SELECT * FROM [rep:ACE] where [rep:principalName] is not null should give you the results.
For more information, I would recommend you to check the ACS commons ACL Packager Implementation which is available on GitHub.
Reference Link - https://github.com/Adobe-Consulting-Services/acs-aem-commons/blob/master/bundle/src/main/java/com/adobe/acs/commons/packaging/impl/ACLPackagerServletImpl.java

Post csv content to Web Api

I have a c# console application which post .csv content to a web service. If I run my solution through VS, it runs perfectly fine but after deploying web service on IIS I keep getting Multiple Choice Status Code 300 error. Not sure how to resolve that. Any pointers would be appreciated.
Thanks
These are relatively simple but I cannot think of other possibilities based on your description.
One of my recent designs had a literal in the code that when I deployed it ended up using a different port which I had forgotten to change to a relative reference.
If not that then the other problem I had with it was because I used JSON to link to the web service. While it worked when viewing in VS when deployed my JSON reference was actually incorrect. specifically it had to do with code in my web.config file, which would be the app.config file for your console application. I had used the code
standardEndpoint helpEnabled="true" automaticFormatSelectionEnabled="false" crossDomainScriptAccessEnabled="true"
when I should have also added
defaultOutgoingResponseFormat="Json"
to make the code work