VMware Cloud Community
unhappyvra
Enthusiast
Enthusiast

Change machine description in EBS

Hi!

I'm trying to change machine description at EBS - Machine Provisioning --> Requested (PRE). I grabbed property "'__Notes" from a payload, changed it and returned back through virtualMachineAddOrUpdateProperties.put('__Notes',MyNewNotes);

Unfortunately, machine description (in vCenter/vCAC/vCACCAFE) stayed the same as user defined it originally in the request form ("Description" field).

I also changed several other fields beside "__Notes" - all of them worked but "__Notes", so it is not a problem of my subscription. Yes It is "blocking".

So, the simple question - is it possible to redefine/modify machine's description through EBS? Why I can modify almost all machine's properties at "Requested (PRE)" but description? May be I need to use another event?? As a plan B - I can use vm.reconfigure_task() to apply new notes/annotation/whatever, but - it is additional search/request to vcenter... and stupid. Should be the other way.

I found this interesting thread - __Notes property does not work with vRA 7 · Issue #33 · chef-partners/vmware-vra-gem · GitHub 

Any ideas?

Reply
0 Kudos
11 Replies
daphnissov
Immortal
Immortal

To my knowledge it is not possible to use EBS to alter description as it isn't included in the rest of the payload or otherwise exposed. It essentially goes straight into the postgres database as-is and remains there. It's not even possible to later call that deployment to change it (again, AFAIK).

Reply
0 Kudos
unhappyvra
Enthusiast
Enthusiast

daphnissov

Could you please clarify this - I know that "Deployment" description works that way you said (it is not even exposed in any EBS subscription and not possible to change it later through reconfigure/any vro class/whatever). Here i'm trying to work with machine's description

pastedImage_0.png

I can see it in my payload (as "__Notes" - double underscore), even can modify it but it is ignored by provisioning process... Is it goes directly to Postgress too?

Reply
0 Kudos
daphnissov
Immortal
Immortal

Oh, sorry, that you can modify but because the VRM agent uses this information to write out the Notes field on a deployed VM you have to update the IaaS model for that. There's a vRO method in the plug-in that has an example. I haven't done it personally but a while back did some exploration on this very same topic and we came to the conclusion you'd have to do it there. Don't have much more specific info to provide. Maybe qc4vmware​ has done this before.

Reply
0 Kudos
unhappyvra
Enthusiast
Enthusiast

Thanks, I consider it as a "plan B" - I just don't see a point to make additional calls to IaaS  just to update machine's notes/annotation - i'd like to take care of it on provisioning phase instead (feed all necessary info before machine even started building process). Am I asking too much? Smiley Happy

Reply
0 Kudos
daphnissov
Immortal
Immortal

You misunderstand, I don't mean make a separate call once it's written out, I mean the IaaS entity model for the deployment. The vRA plug-in for vRO has a method which allows you to update these values which will then take effect when machineBuilding starts. I just haven't done it myself so I don't remember which method/action it is and the syntax.

Reply
0 Kudos
unhappyvra
Enthusiast
Enthusiast

Hmm, and here is my problem - I don't know how to call entity manager on deployment's object at the "Requested -- PRE". If I understand correctly, at that moment deployment and its children do not  exist yet... I completely lost here...

Reply
0 Kudos
eoinbyrne
Expert
Expert

You've hit the nail on the head there - at the Requested(PRE) stage the IaaS entities don't exist so there is no VM record to update the "_Notes" field for.

If the only property you want to update is that one then perhaps just pick a later phase? It is not a crucial value on the VM build?

Alternatively, you could wrap the IaaS request with an XaaS form and then you can set the Description before submission

-HTH

Reply
0 Kudos
eoinbyrne
Expert
Expert

Also, forgot these parts of the EBS payload

- virtualMachineAddOrUpdateProperties

Check here for a way to use this - vRA7 how to use virtualMachineAddOrUpdateProperties to update vRA VM Properties from vRO.

-HTH

Reply
0 Kudos
unhappyvra
Enthusiast
Enthusiast

Well, I do understand that machine does not exist at this stage, however - if I redefine settings as CPU/Mem/Disk/name on this stage - IaaS would create a machine with this redefined properties. So, the question - how to tell IaaS to use updated "Description" field for the machine it is going to create? I just want to avoid additional call to IaaS to change machine's annotation/notes/description AFTER provisioning. Why not to use updated description right BEFORE provisioning call?

I can see that updated "__Notes" goes to payload and persist across all provisioning phases, but none of them actually uses it...

Reply
0 Kudos
eoinbyrne
Expert
Expert

I was trying this out just there and I can do the following

pastedImage_0.png

This runs perfectly and vRO reports that the "__Notes" property is updated

pastedImage_1.png

A second run confirms that the value did go into the DB too!

pastedImage_2.png

(See the '.' on the end of the "__Notes" value read in the second time + the '..' on the 2nd update)

However, no matter whether how I refresh the VM view "Managed Machines" page or the "Items" page (reload VM view / full browser refresh / logout+login) the value displayed in the VM view is NEVER updated to show the new value stored in the DB

Seems very odd & very like a vRA bug IMO.

I can understand your frustration now Smiley Happy

One other thing I did find was Gary Coburn's blog where he mentions this (in the comments/responses for a user named skraack) - vRealize Automation 7 – Enabling the Event Broker part 2 – Extending Clouds

He indicates that the virtualMachineAddOrUpdateProperties from the payload can be used to change this in the same phase you're using (Requested/PRE)

Right, will be quiet now and leave you be.

Reply
0 Kudos
unhappyvra
Enthusiast
Enthusiast

Thank you for the test. I would say if you work with already built machine in IaaS/vCAC you better to use "notes" property - it correlates to vCenter's machine annotation. Or you can change it in vCenter and vCAC will update machine's description after inventory collection.

I was not lucky with virtualMachineAddOrUpdateProperties for "__Notes". it works for everything but "__Notes", and that is my big problem here. My is vRA 7.4. There is a discussion I found about "__Notes" (link in my first post), looks like "__Notes" behavior was changes later in 7.x (read-only) - can anybody confirm that?

Reply
0 Kudos