How to record a custom message / event in the virtual center of the virtual machine

Is it possible to record a personalized message in the virtual center of the VM?

I use a vCLI script to reset a virtual machine. I want to report where (PC) this script is launched.

And it would be great if it is possible to report to the event list or task of the virtual machine that will be reset.

You can relate from where and which this script is initiated by the following script

#!/usr/bin/perl -w
# CustomEvent.pl

#
use strict;
use warnings;
use VMware::VILib;
use VMware::VIRuntime;

my %opts = (
   vmname => {
      type => "=s",
      help => "Name the virtual machine associated with the event",
      required => 1,
   },
);

Opts::add_options(%opts);

Opts::parse();
Opts::validate();
Util::connect();

my $vmname  = Opts::get_option('vmname');
my $username, my $compname;
($username = `echo %USERNAME%`) =~ /(\S+)/; $username = $1;
($compname = `echo %COMPUTERNAME%`) =~ /(\S+)/; $compname = $1;

my $EventManager = Vim::get_service_content()->eventManager;
my $EventManager_view = Vim::get_view(mo_ref => $EventManager);
my $vm_ref = Vim::find_entity_view(view_type => 'VirtualMachine', filter => {'name' => $vmname});
eval {
    $EventManager_view->LogUserEvent(entity => $vm_ref, msg => "CE_RESTARTVM : VM $vmname restarted by $username from $compname.");
    Util::trace(0, "\n CUSTOMEVENT \'VM $vmname restarted by $username from $compname.\' post Successfully.\n");
};
if ($@) {print "Error: ". $@ . "\n";}
Util::disconnect();

Tags: VMware

Similar Questions

  • How can I save my messages instand from the Webcam live messenger window

    How can I save my messages instand from the Webcam live messenger window

    Hello

    I hope that's what you're after...

    http://www.WikiHow.com/save-your-Windows-Live-Messenger-conversation-history

    Concerning

    GT4U

  • How to send an instant message, what is the format of an address of instant messaging

    How to send an instant message, what is the format of an address of instant messaging

    Hello

    Are you referring to the use of messenger?

    If so:

    they will help you with your questions/problems Messenger when repost you the link below in the Messenger forums

    http://windowslivehelp.com/product.aspx?ProductID=2

  • How to display a CUSTOM message after the filters are applied on an analysis

    Hi Experts

    I created an analysis which consists of the following filters:


    Status is equal to / is full
    AND
    Quote value is greater than 40000

    But after I appy these filters there is no data to display (as there is no data that meets the requirements of the filter)

    Is it possible to display a CUSTOM message instead of display the results by default 'No '.

    Please could you help

    Franck

    11 g - http://santoshbidw.wordpress.com/2012/06/10/obiee-11g-no-results/

  • How can I retrieve a message deleted from the iPhone 6

    Accidentally, I got a deleted message when I was looking for a way to print my message I made a few moments ago.

    How can I retrieve a message deleted from my iPhone 6??

    you restore the last backup of your phone that contains this message.

  • How to record from Apple Store invoice in the office?

    Apple Store Canada, I bought a backlit keyboard Logitech CREATE for my iPad Pro - in order to register my product with them that I need to download the invoice and all the Apple site offers is to print it.

    How to record on my desk, preferably in a .pdf file?

    Well, to answer my own question, it is not directly possible, unless you have Windows 10 and then you can print to PDF which would open the Bill in Acrobat Reader or DC or something else, and then you can save it.

    There is a free application that you can download on other systems.  I shouldn't advertise, but it starts with the c Word and ends in pdf.

    Who is achieving the same goal.

    Of course, the best response of all would Apple allow to record the invoice directly in PDF format.  Which shouldn't be too difficult for them to do, no doubt?   In hindsight I see that this has been a perennial question.   Sorry I can't offer any suggestions for Mac or iOS that I don't know if there is.

  • How to disable a custom button field, extending the field 4.5

    Hi all

    I'm working on an application that builds in 4.5, but should work on almost all BlackBerry 4.5 devices from.

    My query is, I need to enable and disable a button custom field that extends the class of the field. I do use if the methods navigationMovement() and moveFocus() for devices not tactile, but on BB 9800 (Tourch) when I touch the button on the screen, it is worn.

    I don't want to use any API touch, can all about suggest me how disabled button on the ground without the help of the Touch API. Please don't suggest also on setEnable(), coz this is not supported in 4.5.

    Thank you

    Let isFocusable return false, for example

  • How can I add a drag event at the scene or the element?

    I would like to add a kick to my animation gestures.

    It should work on mobile.

    How can I add a drag event? Do I need an invisible button?

    There are right and left events shot already on board animate 3

  • Tuxedo of Oracle and Oracle Tuxedo message queue on a virtual machine.

    Hi friends.

    How is it going?

    A small question.

    So let's go live using Oracle Tuxedo 12.1.1.0 with binding distinguished Bulletin Board and Oracle Tuxedo Message Queue 12.1.1.0 on a Virtual Machine (VMWARE) running Oracle Linux 6.2. However, we want to know if there are recommendations or mishaps in which we face before running Oracle Tuxedo on a virtual machine?

    I mean, I wonder if I have to worry about kernel parameters, settings of virtual machine or any other thing that could ruin everything.

    Another question.

    Oracle also provides certification of VMS where Tuxedo Oracle would go on top of the?

    Todd little-Oracle

    Maurice G-Oracle

    Hi Bruno.

    I'm not sure what you mean with single Liaison Bulletin Board.  I guess you mean a cluster or the MP configuration?  And is it really a clustered or just a single machine of the MP configuration?

    About the configuration, you use Tuxedo services as well or just Tuxedo Message Queue?  The biggest problem with the configuration of the BONE is the IPC resources.  If you do a-c tmloadcf on your UBBCONFIG file, it will help you to determine the required minimum IPC resources.  In general, I suggest configuration much more resources than the minimum to allow for the changes to come and for some of the parameters for heavier loads.  In particular IPC message queue settings are strongly dependent on the load.  So make sure that the maximum message size and the size of the queue are big enough for your expected workload.  You can monitor the slot load using the ipcs command.

    We don't certify virtual machine environment, but support also a long time the VM vendor to ensure compatibility, obviously VMware and Oracle VM who both do.

    Kind regards

    Todd little

    Chief Architect of Oracle Tuxedo

  • Difference between tasks and events in a virtual machine

    Hello

    I wonder if someone can help me. I am trying to identify when and how the as many times a virtual machine has been migrated manually by a user. The task of the virtual machine in question pane indicates that a task 'Migrate virtual machine' took place 31, but I don't see any event corresponding to this day here. If I click on related events, it comes up indicating that a migration has occurred. If I look at the events tab, then I see that there is a 18-type event "Migrate virtual machine" However there is no corresponding task. There is no event HA and DRS is disabled.

    My question is, that we should I think or is it a combination of the two? Only a manual migration by an administrator would be able to move the machine.

    Thank you

    Dan

    In the web client, the tasks are empty, but events are there.

    I have query to the database of vmware to bring to the event log and the get the DRS and migration events.

    The query has been

    Select EVENT_ID EVENT_TYPE, CREATE_TIME, username, VM_ID, VM_NAME, HOST_ID and HOST_NAME.

    COMPUTERESOURCE_ID, COMPUTERESOURCE_TYPE, COMPUTERESOURCE_NAME from VPX_EVENT where the EVENT_TYPE like '% VmMigrated %' and VM_NAME as ''.

    order of CREATE_TIME

    Thanks for your help.

  • How to install CM2320fxi MFP into a MS HyperV Virtual Machine?

    I have a Microsoft Server 2008R2 Enterprise running HyperV with several Windows 7 32-bit Enterprise workstations. I would like to install a CM2320fxi MFP CC435A printer on the virtual machines, but on installation I select network installation and I get an error message saying "cannot find the USB device" and the installation will stop. Does anyone else have this problem? Is there a way to install this printer on a MS virtual machine? I have another bran of the MFP installed on MS virtual machines and they install fine.

    Thank you

    Hi jacksonDog,

    It is a product of the profit margin. For the best answer to your questions, you need to transfer your question at the following links.

    http://h30499.www3.HP.com/T5/business-support-forums/CT-p/business-support

    http://h30499.www3.HP.com/T5/printers-LaserJet/BD-p/BSC-413

  • Retrieve the tasks and events for a Virtual Machine

    Hello everyone.

    This question may seem trivial to some people here, but I cannot make it work: I would like to use VCO to retrieve the tasks and events for a specific virtual machine (IN parameter). Can someone help me to do?

    Best regards

    As I said, it must create a collector by using the createCollectorForTasks method in VcTaskManager.

    The parameter of this method is an instance of VcTaskFilterSpec, in which specify you the object to filter (in your case, the reference entity VM)

    You will get a VcTaskHistoryCollector which can only be traversed by using the methods readNextTasks and readPreviousTasks.

    // Get TaskManager service
    var sdktm = vm.sdkConnection.taskManager;
    
    // Create FilterSpec containing vm reference to filter
    var filter = new VcTaskFilterSpec();
    var spec = new VcTaskFilterSpecByEntity();
    spec.entity = vm.reference;
    spec.recursion = VcTaskFilterSpecRecursionOption.self;
    filter.entity = spec;
    
    // Create collector
    var collector = sdktm.createCollectorForTasks(filter);
    collector.resetCollector();
    
    // Browse all pages returned by collector (10 entries per page)
    var taskPage;
    while ((taskPage = collector.readPreviousTasks(10)) != null)
    {
        for each (var task in taskPage)
        {
            System.log("Task: " + task.name + " -> " + task.startTime);
        }
    }
    
  • How do to activate 'VAPP Options' on an existing virtual machine, and then add the properties that will be passed down through the OVF - ENV. XML



    I'm trying to understand vSphere PowerCLI how to activate the "Options of VAPP" on an exsiting VM (in this case a model freshly cloned) then add properties and select cdrom of the FVO data access such as when the virtual machine is running the FVO - env.xml contains the properties in the CD-ROM drive.

    If I use the vSphere client and open the virtual machine settings and click on the tab 'Options' and then select "Options of VAPP" and change the setting to "Enabled" and then select 'VAPP-> Advanced Options' and click on the button 'Properties' on the right, I can add the properties and then I can change them vsphere PowerCLI, but given that these actions are not retained if I clone the virtual machine I need a way to put these in place of vSphere PowerCLI without using the vSphere client to do.

    Thanks in advance for the help!

    Mike

    You can use the vSphere API to activate the 'Options of VAPP"on an existing virtual machine, and set properties. For example:

    $spec = new-Object VMware.Vim.VirtualMachineConfigSpec

    $spec.vAppConfig = new-Object VMware.Vim.VmConfigSpec

    $spec.vAppConfig.property = new-Object VMware.Vim.VAppPropertySpec [] (1)

    $spec.vAppConfig.property [0] = new-Object VMware.Vim.VAppPropertySpec

    $spec.vAppConfig.property [0] .operation = 'Add '.

    $spec.vAppConfig.property [0] = new-Object VMware.Vim.VAppPropertyInfo .info

    $spec.vAppConfig.property [0].info.key = 0

    $spec.vAppConfig.property [0].info.classId = "Property1ClassID".

    $spec.vAppConfig.property [0].info.instanceId = "Property1InstanceID".

    $spec.vAppConfig.property [0].info.id = "Property_1.

    $spec.vAppConfig.property [0].info.category = "Property1Category".

    $spec.vAppConfig.property [0].info.label = "property 1.

    $spec.vAppConfig.property [0].info.type = "string".

    $spec.vAppConfig.property [0].info.userConfigurable = $true

    $spec.vAppConfig.property [0].info.defaultValue = "Property1DefaultValue".

    $spec.vAppConfig.property [0].info.value = «»

    $spec.vAppConfig.property [0].info.description = "Property1Description".

    $vm = get-VM-name vm3

    $vm. ExtensionData.ReconfigVM_Task ($spec)

  • How to install an OS (windows7) invited on a virtual machine

    Dear friends,

    I installed ESXi 4.1 on a system (AMD64).  I can't connect to the ESXi host of vsphere client on a laptop computer.

    I have created a virtual machine for windows 7.  Screenshot attached. As is apparent from the screenshot, I created a virtual disk for windows7, which is presented as "Windows7/Windows7.vmdk [datastore2].

    After this point, I'm not clear on the next step on how to install windows7 on the virtual machine.

    -I guess, I have to reboot the host, ESXi, with a CD of windows7, I did.

    -After a few screens, it shows the list of partitions, as shown in the two screenshots.  But none of the partitions show the virtual disk, I created and allocated using vsphere client.  In vsphere, I created a file of virtual disk of size 256 GB (maximum allowed, even though I have 1 TB * 2 discs), hoping I'd find this 256 GB as partition, on which I can install windows.

    - But I can't find a relevant 256 GB partition.

    I'm doiing it the right way?

    Is there a particular method for installing an operating system on a virtual disk file?

    Thanks in advance and best regards,

    RV

    It depends on your needs. With ESXI, which does not allow direct access to virtual machines (as you have already discovered) you will usually have the best performance and reliability. If you need to use the host and run virtual machines as part of it, then you might want to take a look at products like VMware Workstation or VMware Player who install an operating system (Windows or Linux) on top.

    André

  • How to upgrade v4.1 when vCenter is a virtual machine?

    Hello


    We have ESXi 4.1 on our host (only 1) and want to update to the latest version.  Our vCenter server is a 64-bit VM.  Prior to v4.1, we used the host update utility, but it can not be used today.  Can someone please tell me how we can put our host firmware update and other critical updates when vCenter is on a virtual machine?  It seems that the host must be placed in Maintenance Mode, and all the virtual machines in this regard must be stopped, so I have a problem before the hen's egg.  We do not have another host that we can migrate virtual machines to when the update...


    Thank you for your help,


    Mike

    You will have to establish a direct connection to your host with the vSphere client, close the VMs and placing the host in maintenance mode.  You can then use the vihostupdate of the vCLI or InstallVMHostUpdate of PowerCLI for updating your host.  With the vCLI or PowerCLI you can also script the closure of VMs and placing the host in maintenance mode. http://www.VMware.com/support/developer/PowerCLI/PowerCLI41U1/HTML/install-VMHostPatch.html

Maybe you are looking for

  • Why ipod classic shows code 10 in Device Manager

    Just bought a new laptop downloaded itunes to the external hard drive and kept all my library and playlists. When I plugged the ipod classic on computer, nothing happens. There is no icon load on ipod, Manager of devices under USB controllers, it sho

  • Satellite A500 - impossible to switch to Windows 7

    Recently, I received my copy of Windows 7 ultimate 64-bit. When I actually bought my laptop, it was delivered with Windows Vista family premium 64-bit, all I wanted is upgrading to Windows 7 I bought. So I followed the instructions with the Windows 7

  • Application error invalid win32 appears after downloading

    Hello everyone. I have my new (well it's a few months now) pc portable satellite.everything is fine apart from when I try to run everything I try to download (upgrade Messenger, i-tunes, download a microsoft game) I get the message "invalid win32 app

  • Satellite P770 - helps the touchscreen, backlit screen and Functionkeys

    Hey, I come from Germany and I need your help! So be patient with my broken :) English My problem is, I have my own version of win 7 and downloaded all the drivers, but 3 things are missing, because thereplace. First of the drivers for the backlit an

  • Regarding y560 i7 064654U

    I hope this is the right forum to post this question. I ordered this laptop (without prior knowledge of the driver/BIOS issues) for $699. These issues are still present? Can I cancel the order? I am a computer expert so I'll be able to install the OS