VMware Cloud Community
afzi148
Contributor
Contributor

How to access VM using vrealize API from different application.

HI,

I am trying to access VM using vrealize API from my own application but I am redirected to vrealize login page. How can I access VM directly from my application? How can I maintain session for such purpose or if there is any other way to do it.

Regards.

Reply
0 Kudos
13 Replies
daphnissov
Immortal
Immortal

You will always have to authenticate. There's no such thing as a perpetually-open channel. Do you think that would ever be secure?

Reply
0 Kudos
afzi148
Contributor
Contributor

I do know that but I am unable to redirect user to external web page of the VM with auth token. Is it even possible to do it like this? My application is based on AngularJS and Spring. I want to redirect my user to VM page/URL from my application to view console.

Reply
0 Kudos
daphnissov
Immortal
Immortal

There is no direct accessing of a VM's console from vRA, even with an auth token.

Reply
0 Kudos
afzi148
Contributor
Contributor

ok.

Is there any other way / Plugin which I can use to access VM from my UI Application before assigning IP to VM?

In my scenario I let user to deploy a simple VM using template. I want that after deployment he can access console of VM and then assign IP to machine.


Is there any way I can redirect user to VM console like that?

Reply
0 Kudos
daphnissov
Immortal
Immortal

The whole point of automation is to get AWAY from your users having to do build tasks like assigning an IP. So why are you trying to do this in the first place?

Reply
0 Kudos
afzi148
Contributor
Contributor

I understand your answer. But i don't know that how to automate these build tasks.

Can you share with me any reference document/video/tutorial to automate these kind of tasks like assigning IP?

Reply
0 Kudos
daphnissov
Immortal
Immortal

Assigning static IPs through vRA is quite easy and there are tons of blogs that go into it out there. I'm sure a few Google searches will net you the right stuff. Search for "network profiles" and that'll put you on the right track. Overall process goes something like this:

  1. Have a vCenter customization spec. This is required to assign a static IP.
  2. Dedicate a range of IPs on either an existing or new network for vRA's use.
  3. Create a network profile (under Infrastructure) with the range you allocated.
  4. Assign the network profile to the network (port group) in your reservation.
  5. Any deployments hitting that reservation land on that network and pull an IP from the network profile.
Reply
0 Kudos
afzi148
Contributor
Contributor

Thanks for your response.

I have created customized properties and created VM using that VM template & network profile in vRealize.

Now VM is created and network profile is showing that IP is assigned to that machine but in the VM itself no IP is assigned to it.

When I access VM from vCenter, it shows network adapter but it is not connected in settings. Screenshot attached.

image_2019_03_25T07_42_02_711Z.png

Reply
0 Kudos
daphnissov
Immortal
Immortal

That's a logical switch you have there. Is this selected in the reservation? I'd need to see how that reservation and network profile are set up.

Also...why are you using an LSI Parallel storage controller for this VM? That's almost always a bad decision.

Reply
0 Kudos
afzi148
Contributor
Contributor

I am attaching the screenshots of Reservation and Network Profile.

Kindly check it.

Reply
0 Kudos
daphnissov
Immortal
Immortal

Your reservation screenshot isn't showing up. What does your customization spec look like in the networking section?

Reply
0 Kudos
afzi148
Contributor
Contributor

Please find attached reservation screenshot.

Reply
0 Kudos
SyamAnde
Contributor
Contributor

Hi Afzi148,

If IP is not visible on the linux based VM , we have tried the below KB and its worked on Ubuntu18 in our case. Not sure yours.

Just validate incase.

VMware Knowledge Base

Reply
0 Kudos