extensions icon indicating copy to clipboard operation
extensions copied to clipboard

[VMware VCenter] ...

Open TheUdK opened this issue 1 year ago • 11 comments

Extension

https://www.raycast.com/massimiliano_pasquini/vmware-vcenter

Description

Current State

Only one VCenter can be added.

Feature

It would be great if multiple VCenters (with differing credentials) could be added. Possibly have the listed resources/assets in the menus reflect what VCenter they are pulled from with a tag/friendlyname or the hostname.

Who will benefit from this feature?

Anyone that either:

  • IT service providers that manage multiple standalone VCenters
  • Anyone working with fully split Prod/Test VCenter environments
  • Manages a VCenter at work and in a homelab

Anything else?

No response

TheUdK avatar Nov 10 '23 09:11 TheUdK

Thank you for opening this issue!

🔔 @MassimilianoPasquini97 you might want to have a look.

💡 Author and Contributors commands

The author and contributors of massimiliano_pasquini/vmware-vcenter can trigger bot actions by commenting:

  • @raycastbot close this issue Closes the issue.
  • @raycastbot rename this issue to "Awesome new title" Renames the issue.
  • @raycastbot reopen this issue Reopen the issue.

raycastbot avatar Nov 10 '23 10:11 raycastbot

Hi @TheUdK, this could be done by moving vCenter credential from Preferences to the LocalStorage. LocalStorage is encrypted and shared only between command of the same extension so is not a problem for security. Saving credential on LocalStorage remove the limitation or saving only a fixed amount of credential.

In the next weeks I will work to implement this requested feature.

MassimilianoPasquini97 avatar Nov 30 '23 11:11 MassimilianoPasquini97

Hi @TheUdK, I have finished to implement the requested feature. Before releasing it I appreciate if you can test it providing me some feedback. You can clone the latest version from MassimilianoPasquini97/raycast_vmware_vcenter repository.

MassimilianoPasquini97 avatar Dec 11 '23 12:12 MassimilianoPasquini97

Hi @MassimilianoPasquini97,

Sorry for the late feedback.

Seems to work great. Added three different VCenters. Will test further during the next couple of days. What would be nice is to be able to select to show all configured VCenters in one view and have it display the source VCenter in a slightly greyed out text behind the asset/hostname/datastore ect.

image

TheUdK avatar Dec 22 '23 13:12 TheUdK

Hi @TheUdK, i have committed a new update on MassimilianoPasquini97/raycast_vmware_vcenter repository implementing this features:

  • Selecting 'All' view objects from all vCenter Server.
  • Added AccessoryList on Items for showing Os Icon and vCenter Server Name if viewing all vCenter Server with 'All'.
  • VM can be filtered by Os Name or IP.
  • Implemented a cache system for improve performance.
  • On 'Virtual Machine' Command now CMD+R refresh information of selected item.
  • On 'Virtual Machine' Command added 'Open RDP' SubCommand for opening an RDP connection with the vm. Microsoft RDP Software is required.

I appreciate if you can test it providing me some feedback.

MassimilianoPasquini97 avatar Jan 23 '24 10:01 MassimilianoPasquini97

Hi @MassimilianoPasquini97

Looks nice. Thanks for your work.

Some issues i have found.

  • When having "All" selected and trying to"Edit Server" i get an error - guess that case should be handled.
  • The OsTextMetadata is out of date VmGuestOS Data Structure

TheUdK avatar Jan 29 '24 15:01 TheUdK

Thanks you @TheUdK for your help on testing all these new features. I have totally forgot to disable 'Edit Server' and 'Delete Server' when 'All' is selected, now I have fixed it. I have also updated VmGuestOS.

I think now all features are mature enough to be published. Here the pull request

MassimilianoPasquini97 avatar Jan 30 '24 07:01 MassimilianoPasquini97

Looks like something broke in with the commit d132bb551c13744e0fd439ea8ab822eb758cca48 Using the previous commit and building locally works fine for me. Using either your main branch, d132bb551c13744e0fd439ea8ab822eb758cca48 or raycast store i get the error. Error: missing expected parameter key: value

VCenter Version {'summary': 'Patch for VMware vCenter Server 8.0', 'install_time': '2023-11-03T15:07:42.946Z', 'product': 'VMware vCenter Server', 'build': '22617221', 'releasedate': 'October 24, 2023', 'type': 'vCenter Server with an embedded Platform Services Controller', 'version': '8.0.2.00100'}

To reproduce error

  1. Uninstall any version of the extension from raycast ui
  2. Install from store or run npm clean-install && npm run dev on main branch
  3. Add new connection
  4. Receive Error: missing expected parameter key: value

Working

  1. Uninstall any version of the extension from raycast ui
  2. git checkout 608f26774dab1779348d9ba26f6aafc6d296b514
  3. npm clean-install && npm run dev
  4. Works as expected

I think there might be an issue with generating the connection object in the later commits. Possibly an issue on my end though as im not very versed with TypeScript/raycast extentions.


Also none of the vm power interactions seem to work (atleast on the commit 608f26774dab1779348d9ba26f6aafc6d296b514)


You could use this endpoint to generate a ticket for the VMware Remote Console. This would authenticate it directly instead of asking for credentials.


Also your function to open the web ui directly to a vm object tries to use the VMs UUID instead of the VCenter instance UUID. I am not sure how to get the VCenter uuid using the /api endpoint but you can see it using the MoRef endpoint at https://[vcenter]/mob/?moid=ServiceInstance&doPath=content.about

TheUdK avatar Feb 15 '24 21:02 TheUdK

Hi @TheUdK, thanks for your help, I have fixed all the errors and implemented console tickets on https://github.com/raycast/extensions/pull/10787

MassimilianoPasquini97 avatar Feb 16 '24 09:02 MassimilianoPasquini97

Everything seems to work now.

There is still an issue with the Open on vCenter Web. You are using the instance_uuid of the VM instead of the instance_uuid of the vCenter with ${vm.vm_info.identity?.instance_uuid}/summary.

To generate the direct link to the VM you need the url format https://{vcenterFQDN}/ui/app/vm;nav=v/urn:vmomi:VirtualMachine:{vmMORefID }:{vCenterInstanceUUID}/summary you are using: https://{vcenterFQDN}/ui/app/vm;nav=v/urn:vmomi:VirtualMachine:{vmMORefID }:{vmInstanceUUID}/summary

Example using PowerCLI: Wrong values to use

(get-vm -name $vms).extensiondata.config.InstanceUUID
5031f478-a46d-27f6-843f-5ea12fc14773
5031f43a-0cfb-f571-f769-5af1f1f5d723

Correct value to use - same for all vms

$global:defaultviserver.InstanceUuid
0f4bf16e-1f72-4072-accf-bc88b3c62265

or https://{vcenterFQDN}/mob/?moid=ServiceInstance&doPath=content.about

This endpoint might help but im not sure.

TheUdK avatar Feb 19 '24 13:02 TheUdK

This issue has been automatically marked as stale because it did not have any recent activity.

It will be closed if no further activity occurs in the next 10 days to keep our backlog clean 😊

raycastbot avatar Apr 09 '24 14:04 raycastbot

This issue has been automatically closed due to inactivity.

Feel free to comment in the thread when you're ready to continue working on it 🙂

You can also catch us in Slack if you want to discuss this.

raycastbot avatar Apr 19 '24 14:04 raycastbot