Quantcast
Channel: VMware Communities : All Content - All Communities
Viewing all 172599 articles
Browse latest View live

Not able to capture VMware event Lost network connectivity for DVSPort

$
0
0

I tried the following code. I am able to see the event in vSphere but not able to capture with code.
I am able to see the descriptions related to event on this particular vCenter. To my un
derstanding this vCenter should capture those events.
When i checked the ouput at the sametime.
I don't have any event related to DVPorts.
Please suggest what might have caused this not to capture and how to go about this.

package vmware2020;

 

import java.io.File;

import java.io.FileOutputStream;

import java.net.MalformedURLException;

import java.net.URL;

import java.rmi.ConnectException;

import java.rmi.RemoteException;

import java.util.Calendar;

import java.util.Date;

import java.util.HashMap;

 

import com.vmware.vim25.Event;

import com.vmware.vim25.EventFilterSpec;

import com.vmware.vim25.EventFilterSpecByEntity;

import com.vmware.vim25.EventFilterSpecByTime;

import com.vmware.vim25.EventFilterSpecRecursionOption;

import com.vmware.vim25.InvalidLogin;

import com.vmware.vim25.mo.EventManager;

import com.vmware.vim25.mo.ServiceInstance;

import com.vmware.vim25.mo.StoragePod;

 

//java -cp cim-2.0.0.jar:dom4j-2.1.1.jar:jaxb-api-2.3.1.jar:vijava-55b20130927_c04.jar:vmware2020.jar vmware2020.VmwareEvents <IPADDRESS> <USERNAME> <PASSWORD> '443' 'true' -23 HOUR true

 

 

public class VmwareEvents {

    ServiceInstance serviceInstance;

    VmwareServiceApiServiceImpl vmwareServiceApiServiceImpl;

    HashMap<String, StoragePod> dsMap = new HashMap<>();

    HashMap<String, String> dsSpodMap = new HashMap<>();

 

    public static void main(String[] args) throws RemoteException, Exception {

        VmwareEvents auth = new VmwareEvents();

        String ipAddress = args[0];

        String userName = args[1];

        String password = args[2];

        int port = Integer.parseInt(args[3]);

        String isSecure = args[4];

        boolean secure = (isSecure.equalsIgnoreCase("true")) ? true : false;

        int option = Integer.parseInt(args[5]);

        String calendarTag = args[6];

        String endTimeFlag = args[7];

        auth.go(getServiceInstance(ipAddress, userName, password, port, secure), option, calendarTag, endTimeFlag);

    }

 

    private void go(ServiceInstance serviceInstance, int option, String calendarTag, String endTimeFlag) {

        File file = null;

        try {

            this.serviceInstance = serviceInstance;

            String fileName = "vcenter_events_";

          

 

            StringBuffer bf = new StringBuffer();

            EventManager evtManager = this.serviceInstance.getEventManager();

            Event[] events = null;

            if (evtManager != null) {

                EventFilterSpec fSpec = new EventFilterSpec();

                // fSpec.setCategory(null);

                // Need to filter with Time

                EventFilterSpecByTime fTime = new EventFilterSpecByTime();

                // begin time = lastpooled time from if nul api get time

 

                Calendar time = this.serviceInstance.getServerClock();

                System.out.println("TIME: "+time);

                Calendar beginTime = (Calendar) this.serviceInstance.currentTime();

//                System.out.println("BEGIN TIME: "+beginTime);

                Calendar endTime = (Calendar) this.serviceInstance.currentTime();

//                System.out.println("END TIME: "+endTime);

              

//                java.util.GregorianCalendar[time=?,areFieldsSet=false,areAllFieldsSet=true,

//                lenient=true,zone=sun.util.calendar.ZoneInfo[id="GMT+00:00",offset=0,

//                dstSavings=0,useDaylight=false,transitions=0,lastRule=null],firstDayOfWeek=1,minimalDaysInFirstWeek=1,

//                ERA=1,YEAR=2020,MONTH=7,WEEK_OF_YEAR=1,WEEK_OF_MONTH=1,DAY_OF_MONTH=1,DAY_OF_YEAR=1,DAY_OF_WEEK=5,

//                DAY_OF_WEEK_IN_MONTH=1,AM_PM=0,HOUR=0,HOUR_OF_DAY=7,MINUTE=41,SECOND=36,MILLISECOND=916,

//                ZONE_OFFSET=0,DST_OFFSET=0]

              

//                Date date = time.getTime();

//              

//                time.getTimeZone();

//                time.getFirstDayOfWeek();

//                time.getMinimalDaysInFirstWeek();

//              

//              

//                int ERA = time.ERA;

//                int YEAR = time.YEAR;

//                int MONTH = time.MONTH;

//              

//                int WEEK_OF_YEAR = time.WEEK_OF_YEAR;

//                int WEEK_OF_MONTH = time.WEEK_OF_MONTH;

//              

//                int DAY_OF_MONTH = time.DAY_OF_MONTH;

//                int DAY_OF_YEAR = time.DAY_OF_YEAR;

//                int DAY_OF_WEEK = time.DAY_OF_WEEK;

//                int DAY_OF_WEEK_IN_MONTH = time.DAY_OF_WEEK_IN_MONTH;

//              

//                int AM_PM = time.AM_PM;

//                int HOUR = time.HOUR;

//                int HOUR_OF_DAY = time.HOUR_OF_DAY;

//                int MINUTE = time.MINUTE;

//                int SECOND = time.MILLISECOND;

//                int MILLISECOND = time.MILLISECOND;

//                int ZONE_OFFSET = time.ZONE_OFFSET;

//                int DST_OFFSET = time.DST_OFFSET;

              

              

                System.out.println("OPTION: [" + option + "]");

              

                if (calendarTag.equalsIgnoreCase("YEAR")) {

                    beginTime.add(Calendar.YEAR, option);

                } else if (calendarTag.equalsIgnoreCase("MONTH")) {

                    beginTime.add(Calendar.MONTH, option);

                } else if (calendarTag.equalsIgnoreCase("HOUR")) {

                    beginTime.add(Calendar.HOUR, option);

                } else if (calendarTag.equalsIgnoreCase("DAY_OF_WEEK_IN_MONTH")) {

                    beginTime.add(Calendar.DAY_OF_WEEK_IN_MONTH, option);

                } else if (calendarTag.equalsIgnoreCase("DAY_OF_MONTH")) {

                    beginTime.add(Calendar.DAY_OF_MONTH, option);

                }  else if (calendarTag.equalsIgnoreCase("FRIDAY")) {

                    beginTime.add(Calendar.FRIDAY, option);

                }

 

          

                System.out.println("Begin Time " + beginTime.getTime());

                System.out.println("End Time " + endTime.getTime());

                String bt = beginTime.getTime().toString().replaceAll(" ", "_");

                String et = endTime.getTime().toString().replaceAll(" ", "_");

                bt = bt.replaceAll(":", "_");

                et = et.replaceAll(":", "_");

                 file = new File(fileName+bt+"_"+et+"_END_TIME_IS_"+endTimeFlag+".txt");

              

                fTime.setBeginTime(beginTime);

                if (endTimeFlag.equalsIgnoreCase("true")) {

                    fTime.setEndTime(endTime);

                }

                fSpec.setTime(fTime);

 

                // Need to filter with Entity

                EventFilterSpecByEntity entityFilter = new EventFilterSpecByEntity();

                entityFilter.setEntity(this.serviceInstance.getRootFolder().getMOR());

                entityFilter.setRecursion(EventFilterSpecRecursionOption.all);

                fSpec.setEntity(entityFilter);

 

                // Updating with latest time stamp every time

                // VMwareMonitorCacheProvider.addEventLastPolledTimeMap(device.getUniqueId(),

                // entityUuid, api.getCurrentServerTime());

                bf.append(

                        "Name                                                   FullFormatName                                              EventTypeId           \n");

 

                events = evtManager.queryEvents(fSpec);

                System.out.println(evtManager.getLatestEvent().fullFormattedMessage);

                if (events != null) {

                    System.out.println(events.length);

                    for (Event event : events) {

                        if (event instanceof com.vmware.vim25.AlarmStatusChangedEvent) {

                            com.vmware.vim25.AlarmStatusChangedEvent e = (com.vmware.vim25.AlarmStatusChangedEvent) event;

                            bf.append("\t" + e.getClass().getSimpleName() + "   " + "\t" + e.getFullFormattedMessage()

                                    + "\n");

                        } else if (event instanceof com.vmware.vim25.EventEx) {

                            com.vmware.vim25.EventEx e = (com.vmware.vim25.EventEx) event;

                            bf.append("\t" + e.getClass().getSimpleName() + "   " + "\t" + e.getFullFormattedMessage()

                                    + "\t" + e.getEventTypeId() + "\n");

                        } else if (event instanceof com.vmware.vim25.ExtendedEvent) {

                            com.vmware.vim25.ExtendedEvent e = (com.vmware.vim25.ExtendedEvent) event;

                            bf.append("\t" + e.getClass().getSimpleName() + "   " + "\t" + e.getFullFormattedMessage()

                                    + "\t" + e.getEventTypeId() + "\n");

                        } else {

                            bf.append("\t" + event.getClass().getSimpleName() + "   " + "\t"

                                    + event.getFullFormattedMessage() + "\n");

                        }

                    }

                }

            }

 

            byte[] bytes = bf.toString().getBytes();

            try (FileOutputStream fos = new FileOutputStream(file)) {

                fos.write(bytes);

                fos.flush();

            }

 

            if (this.serviceInstance != null) {

                this.serviceInstance.getServerConnection().logout();

            }

        } catch (Exception e) {

            e.printStackTrace();

        }

    }

 

    private static ServiceInstance getServiceInstance(String ipAddress, String userName, String password, int port,

            boolean secure) {

        String apiEndPoint = null;

        URL url = null;

 

        // Create a new ServiceInstance for this API call

        ServiceInstance serviceInstance = null;

 

        try {

            apiEndPoint = secure ? "https://" + ipAddress + ":" + port + "/sdk"

                    : "http://" + ipAddress + ":" + port + "/sdk";

            try {

                url = new URL(apiEndPoint);

            } catch (Exception e) {

                System.out.println(apiEndPoint);

                System.out.println(url);

                e.printStackTrace();

            }

 

            serviceInstance = new ServiceInstance(url, userName, password, true);

 

        } catch (InvalidLogin ile) {

            System.out.println("InvalidLogin");

            ile.printStackTrace();

        } catch (RemoteException re) {

            if (re instanceof InvalidLogin) {

                System.out.println("InvalidLogin2");

            }

 

            if (re instanceof ConnectException) {

                System.out.println("ConnectException");

            }

 

            re.printStackTrace();

        } catch (MalformedURLException me) {

            System.out.println("MalformedURLException");

            me.printStackTrace();

        } catch (Exception e) {

            System.out.println("Exception");

            e.printStackTrace();

        }

        return serviceInstance;

    }

 

    public void logout() throws Exception {

        if (serviceInstance != null) {

            try {

                serviceInstance.getServerConnection().logout();

            } catch (Exception e) {

                e.printStackTrace();

            }

        }

    }

 

}


Different IP address in multiple virtual machines?

$
0
0

Hi, wanted to know if its possible to change the public IP address for each virtual machine I use on my pc. Thank you.

Not able to increase storage in my Datastore for ESXi 6.0

$
0
0

I have an issue with ESXi 6.0.  I have 398 GB free space in my Datastore. I added an extra 1.2 TB Hard drive and I can see in iLO on the HP server that it detects the new Hard drive. I go through the steps to add the additional storage space, but when I get to "Increase Datastore Capacity" and then on the left is Extent Device, it's blank and doesn't show anything.

What could be the issue?  I was thinking of upgrading to 6.7 since I have the support and license, but don't think that will fix the issue.

How to access USB stick content from VMWare running Windows 7?

$
0
0

I am running Windows 7 via VMWare under Ubuntu 18.04. I have followed the procedure to install the USB stick. It is now connected to the host.

However, I don't know how to access the content of the stick. My Google research indicates that this may be a mounting issue. I read somewhere that I should check /proc/bus/usb, but the usb directory does not exist in /proc/bus. Unfortunately, I am not a Linux expert at this.

 

Please help

How to delete RTEP from an edge node?

$
0
0

Hi. This is in a test environment. We are playing around with Federation and have 2 Sites connected with Remote Tunnel Endpoints. We want to remove our Edge nodes to try a different configuration but we are unable to remove them from the Edge Cluster saying it is use by a Logical Router. I assume it is because it is configured with an RTEP. We have removed all other references to this edge. Removed the BGP neighbor setup, and his interface from the T0, so we assume it is the RTEP. I cannot find anywhere where you can delete an RTEP from an Edge after you configure it from the Global Manager. Thank you for any help. Thanks,,,

Isolating vmnet9 and vmnet10

$
0
0

I would like to setup 2 custom vmnets that are not able to communicate with one another but can communicate outbound to the internet. I would like to do this without any extra VMs acting as routers on the vmnets. Here are my assumptions:

 

1. If I setup 2 custom vmnets like vmnet9 and vmnet10 configured with NAT, these 2 vmnets would not be able to communicate with each other.

2. The guests on vmnet9 and vmnet10 would be able to communicate with the host, even if the "Connect a host virtual adapter" option is unchecked.

 

Are these assumptions correct?

 

Thanks!

Newbie to VMware Vsphere - looking for common issues faced daily to solve and learn.

$
0
0

Hello everyone.

 

Hope everyone is doing well in these dark ages.

 

I'm hoping to get some assistance to practice more troubleshooting steps and more learn more on Vmware Vsphere 6.7.

 

I'm in the process trying to get my VCP and I'm looking create some common problems or areas you need to master for working environment. I'm hoping to create some challenges in my lab environment and try to solve them.

 

At my current work, I'm only creating VM machines at the moment but my manager wants me to be back up of senior admin who is responsibly everything else. We are not using vSAN and or VDS at the moment.

I don't see many tickets coming in for VMware issues at  my current company. My limit for issues I can think is ESXI failing, storage issues or hardware issues.

 

I have already done the Challenging labs at HOL.

 

 

please let me know if you can think anything.

 

thanks

user ___VMware_Conv_SA___ in bios inknown password1

$
0
0

Hey there.

 

After i've installed Vmware converter stanalone , in my laptop HP elitebook 2170p, it blocked  my Bios because the vmware created user ___VMware_Conv_SA___  in bios and this user has admin right. Now I can't change setiings in bios

 

 

Anyone  knows the password of this user  in bios?

 

Regards

 

Vladimir


If I set up a new VM in Workstation Pro can all Windows 10 users access it?

$
0
0

So I'm trying to set up two VMs in Workstation Pro on my Windows 10 pc. I want all Windows 10 users to be able to access the first VM, and then I want to restrict the second VM to a single account, so that only that account can see and use that machine. Is there any way to do this? If so, how? Thanks in advance.

Change password of a System Domain account

$
0
0

I've click on "Reset Password" to change the password of a System Domain account. This tries to send an email which fails. Now I cannot login with this account.

Is there any way to change a password without sending an email?

 

Thanks.

SQL Config for Workspace One

$
0
0

Hi,

 

We need to move the BD of our SQL for Workspace one to another server we ar doing a network migration and i want to know where can i find the location in Workspace One to tell Workspace One where the SQL is so that WOrkspace One can find it again after the migration.

what is included?

$
0
0

hi

 

After reading several blogs and the official website I see a lot of confusion about what licenses are included in VCF 4.

 

Specifically, is the vRealize Suite (vRA,vROPs,....) included?

thanks

 

 

VRF Can't enable BGP - Is this is a BUG?

$
0
0

Hello Gurus,

 

When I enable BGP on my VRF I am getting this error.

Trying to  understand why it is, is it related to Edge Node VM configs (Uplink'ed to VSS instead of vDS, however I don't think so)?

 

BGP+VRF.PNG

Provisioning error occured for Machine xxxx-xx. Resync operatioN failed

$
0
0

I have one machine in a pool of 105 VMs which is showing this error : Provisioning error occured for Machine xxxx-xx. Resync operatioN failed.

I tried to recover, restart the machine but the issue still persists.

Any possible resolution or explanation for this issue?

VRA 8.1 deployment "Create Failed"

$
0
0

A particular user with the roles "Organisation member", "Project member", "Service Broker User" fails to successfully deploy a catalog item.
In Step-6 (Machine Provisioning) the user gets the error: "Create Failed: IllegalAccessError: forbidden"

 

When i add the role "Service broker viewer" to this user, he is able to deploy the catalog item successful.

But this makes no sense to me. With the role "Service broker viewer", the user gets to many menu items in his console.

 

Screenshot 2020-09-17 161247.jpg
This is the case with local (System) users and with users from AD.

Any ideas for a solution or suggestions for troubleshooting?

 

Message was edited by: sven.knockaert


Move unmanaged desktops between pools with PowerShell?

$
0
0

Hi....

 

Very new to Horizon View, so apologies in advance if I am in the wrong place....

 

We have recently installed VMware Horizon 8 and I have been trying to use the VMware.Hv.Helper powershell module to manage desktop moves, adds and changes.

Currently, all of the desktops we are using with Horizon are physical unmanaged Windows desktops running the Horizon View Agent.

 

I was just wondering if there is any way of moving a desktop from one pool to another via PowerShell and the VMware.Hv.Helper module?

 

I've been able to add registered machines to a pool, and remove desktops from a pool via PowerShell and the module, but I can't seem to find any commands to enable me to move a desktop from one pool to another without using the Horizon Console.

 

Thanks in advance for any help.

 

Cacheman

Home lab NVMe disk

$
0
0

Hi,
I tryed to stuck together something useful for my means. Ryzen 5 3400G, 32GB RAM, 3 old Drives, and 2 NVMe drives. 
While everything works fine, but I am unable to get the 2nd 1TB NVMe drive (XPG GAMMIX S11 Pro) to be recognized by ESXi

While booting into a live usb I am able see and use the drive.

I do not see the drive listed in ESXi.

Can some point me into the right direction?
7.0.0 build 15843807

The possibility of forwarding physical GPU in VMware Workstation

$
0
0

Сделать это через параметры VMXили через настройки графического адаптера в виртуально машине.

 

To do this through the parameters of the VMX or through the settings of the graphics card in the virtual machine.

VCF 4.0 Consolidated Management + VI Workload

$
0
0

Hi,

 

We are currently in the process of looking into deploying Cloud Foundation, mainly due to us being a Greenfield Deployment and are primarily seeing VCF as a building block to easen the LifeCycle of ESXi, vSAN, NSX-T and Kubernetes (I.e, not using vRealize for the moment).

 

As we are a mid-sized shop (Looking at 7 nodes in the biggest cluster) we are leaning towards utilizing an Consolidated Management Setup which on paper seems to be rather straight forward. But our concern is that directly out of the gate is looking at atleast 4 different clusters spread in two datacenters, but without any need to have anything stretched.

 

Here comes the tricky part when it comes to understanding the documentation and any drawback regarding the setup:

 

- Is it possible to have 1 or several VI Workload Domains when using an Consolidated Management Domain?

- If no to above, is it possible to have several clusters inside of the Management Domain with their own IP-Pools/Ranges, some also located in another DC than the Management (High-Bandwidth, Low Latency)?

 

From a technical standpoint I really can't see any issue with having VI Workload Domains even when using a Consolidated Management (This is even mentioned when going from consolidated to standard), but I can't find anything in the docs. about supportability and have gotten different answers/information when talking with our locals.

 

Kind Regards

Order of NICs/IPs and its VM DNS name in VCenter

$
0
0

Hi Experts!

I'm not sure what determines which IP correspond to DNS name when i have more than one NIC on my VM, what is the order that vCenter displays and respond the IPs for each VM?

Sorry for the confused constructed question, i hope you get my point.

I just need to get available my VM DNS name on particular IP not random or last appeared or anything else.

How to force vSphere to do that in my way?

 

Many thanks for your help.

Viewing all 172599 articles
Browse latest View live


Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>