State of the device set OFF using powercli

#$e = get-esxcli - vmhost esx1

#$lun = get-content lun.txt

Any idea on the equivalent of esxcli storage set of basic device - state = off naa.xx d

#$lun | {$e.storage.core.device.set ($sur, ($_), $off)}

Assuming that this file un.txt contains the IDS devices ("naa.xxxxxx"), you can do

$esxcli.storage.core.device.set($_,$null,$false,'on')

When $_ is the device ID, the 2nd parameter is a new name for the device if necessary (if not specify $null).

The 3rd parameter is a Boolean value that indicates whether the device should be = not persistent or not.

The last parameter sets the status can be 'on' or 'off '.

Tags: VMware

Similar Questions

  • Airport Extreme works but the State of the led is off

    Airport Extreme works, but the State of the led is off, it is brand new and I can set up this last but the led stays off, showing no decided (green color or ambar)

    Could someone help with this?

    Thanks in advance.

    Hardware failure - defective leads.  Take that back for a new one, as big a PITA, you should.

  • Way to the commands per second using PowerCLI

    You can use powerCLI for average orders per second of a virtual machine on a historical period in the same way, as you can with cpu.usagemhz.average?

    Just to clarify:

    Does

    datastore.numberreadaveraged.Average

    give me information on the entire data store connected to the virtual machine? Or is information specific to just the VM I comment on?

    (In this case, I'm eager to get all the IOPs for all all of the virtual disks connected to a specific virtual machine)

    It gives you the IOPS / s specific to entire virtual machine and not the data store.

    Also - I'm the zeros for my data when I launch the present.  I see in vSphere client commands per second only to the data in real time, not for the last day, week or year.  Is it because of my level settings statistics?

    Yes, vCenter 5.0 and place unfortunately don't collect statistics of e/s long term on a per-VM level more.

    However, you can still add these values to return to lower levels of statistics as described in this article:

    http://alpacapowered.WordPress.com/2012/12/17/control-vCenter-performance-counter-collection-and-get-back-VM-IOPS-statistics/

  • AF:inputListOfValues sets the value of the first item in the result set when using enter key or tab and component value autosubmit = true

    I use JDev 11.1.1.6 and when I type in a value in an af:inputListOfValues element and press enter or the tab key, it will replace the value I entered with the first element in the set of results LOV. If enter a value, simply click on the component af:inputListOfValues it works correctly. If I use the popup and find a value it works properly as well. I have a programmatic view object that contains a single transitional attribute (this is the view object that is used to create the list of the components of the value of) and then I have another object from view based on entities which defines one of its attributes in a list of the attribute value. I tried to use a base object view of entity to create the LOV to and everything works as expected, so I don't know if this is a bug when using programmatic view objects or if I need more code in the VOImpl. In addition, it seems after that first of the value being replaced by the first value in the result set that it will work correctly as well. Here are some excerpts of important code.

    Also, it seems that this does not work only if the text entered in the component af:inputListOfValues would have only a single game, returned in the result set. For example, given the result defined in code: Brad, Adam, Aaron, Fred, Charles, Charlie, Jimmy

    If we get into Cha, the component works as expected

    If we register A, the component works as expected

    If we get Jimmy, the component does not work as expected, and returns the first value of results IE. Brad

    If we get Fred, the component does not work as expected, and returns the first value of results IE. Brad

    I also checked that I get the same behavior in JDev 11.1.1.7

    UsersVOImpl (programmatic view with 1 transitional attribute object)

    import java.sql.ResultSet;
    
    import java.util.ArrayList;
    import java.util.Iterator;
    import java.util.List;
    
    import oracle.adf.share.logging.ADFLogger;
    
    import oracle.jbo.JboException;
    import oracle.jbo.server.ViewObjectImpl;
    import oracle.jbo.server.ViewRowImpl;
    import oracle.jbo.server.ViewRowSetImpl;
    
    // ---------------------------------------------------------------------
    // ---    File generated by Oracle ADF Business Components Design Time.
    // ---    Wed Sep 18 15:59:44 CDT 2013
    // ---    Custom code may be added to this class.
    // ---    Warning: Do not modify method signatures of generated methods.
    // ---------------------------------------------------------------------
    
    public class UsersVOImpl extends ViewObjectImpl {
    
        private static ADFLogger LOGGER = ADFLogger.createADFLogger(UsersVOImpl.class);
        private long hitCount = 0;
    
        /**
         * This is the default constructor (do not remove).
         */
        public UsersVOImpl () {
        }
    
        /**
         * executeQueryForCollection - overridden for custom java data source support.
         */
        protected void executeQueryForCollection (Object qc, Object[] params, int noUserParams) {
    
             List<String> usersList = new ArrayList<String>();
             usersList.add("Brad");
             usersList.add("Adam");
             usersList.add("Aaron");
             usersList.add("Fred");
             usersList.add("Charles");
             usersList.add("Charlie");
             usersList.add("Jimmy");
    
             Iterator usersIterator = usersList.iterator();
             setUserDataForCollection(qc, usersIterator);
             hitCount = usersList.size();
             super.executeQueryForCollection(qc, params, noUserParams);
    
        } // end executeQueryForCollection
    
        /**
         * hasNextForCollection - overridden for custom java data source support.
         */
        protected boolean hasNextForCollection (Object qc) {
    
             Iterator usersListIterator = (Iterator)getUserDataForCollection(qc);
             if (usersListIterator.hasNext()) {
         
                 return true;
    
             } else {
    
                 setFetchCompleteForCollection(qc, true);
                 return false;
    
             } // end if
    
        } // end hasNextForCollection
    
        /**
         * createRowFromResultSet - overridden for custom java data source support.
         */
        protected ViewRowImpl createRowFromResultSet (Object qc, ResultSet resultSet) {
    
             Iterator usersListIterator = (Iterator)getUserDataForCollection(qc);
             String user = (String)usersListIterator.next();
             ViewRowImpl viewRowImpl = createNewRowForCollection(qc);
    
             try {
    
                 populateAttributeForRow(viewRowImpl, 0, user.toString());
    
             } catch (Exception e) {
    
                 LOGGER.severe("Error Initializing Data", e);
                 throw new JboException(e);
    
             } // end try/catch
    
             return viewRowImpl;
    
        } // end createRowFromResultSet
    
        /**
         * getQueryHitCount - overridden for custom java data source support.
         */
        public long getQueryHitCount (ViewRowSetImpl viewRowSet) {
             return hitCount;
        } // end getQueryHitCount
    
        @Override
        protected void create () {
    
             getViewDef().setQuery(null);
             getViewDef().setSelectClause(null);
             setQuery(null);
    
        } // end create
    
        @Override
        protected void releaseUserDataForCollection (Object qc, Object rs) {
    
             Iterator usersListIterator = (Iterator)getUserDataForCollection(qc);
             usersListIterator = null;
             super.releaseUserDataForCollection(qc, rs);
    
        } // end releaseUserDataForCollection
    
    } // end class
    
    

    <af:inputListOfValues id="userName" popupTitle="Search and Select: #{bindings.UserName.hints.label}" value="#{bindings.UserName.inputValue}"
                                                  label="#{bindings.UserName.hints.label}" model="#{bindings.UserName.listOfValuesModel}" required="#{bindings.UserName.hints.mandatory}"
                                                  columns="#{bindings.UserName.hints.displayWidth}" shortDesc="#{bindings.UserName.hints.tooltip}" autoSubmit="true"
                                                  searchDesc="#{bindings.UserName.hints.tooltip}"                                           
                                                  simple="true">
                              <f:validator binding="#{bindings.UserName.validator}"/>                       
    </af:inputListOfValues>
    
    
    
    

    I found a solution to this problem. It seems that, when using a view object programmatic that has a transient as its primary key attribute, you need to override the methods in the ViewObjectImpl so that he knows how to locate the line related to the primary key when the view object records are not in the cache. That's why it would work properly sometimes, but not always. Here are the additional methods that you must override. The logic you use in the retrieveByKey would be on a view view object database object and would be different if you had a primary key consisting of multiple attributes.

    @Override
    protected Row[] retrieveByKey (ViewRowSetImpl viewRowSetImpl, Key key, int i) {
        return retrieveByKey(viewRowSetImpl, null, key, i, false);
    }
    
    @Override
    protected Row[] retrieveByKey (ViewRowSetImpl viewRowSetImpl, String string, Key key, int i, boolean b) {
    
        RowSetIterator usersRowSetIterator = this.createRowSet(null);
        Row[] userRows = usersRowSetIterator.getFilteredRows("UserId", key.getAttribute(this.getAttributeIndexOf("UserId")));
        usersRowSetIterator.closeRowSetIterator();
        return userRows;
    
    }
    
    @Override
    protected Row[] retrieveByKey (ViewRowSetImpl viewRowSetImpl, Key key, int i, boolean b) {
        return retrieveByKey(viewRowSetImpl, null, key, i, b);
    }
    
  • State of the device, Windows stopped the device because it has reported problems (Code 43)

    A usb driver for microsoft

    Windows has stopped the device because it has reported problems (Code 43) Standard USB HOST Controller, location of port #0002 Hub_ #0005

    Right click on desktop, select Properties.  On the next page, top left click on Device Manager.

    Scroll down the page until you come to the Universal Serial Bus Controllers and double click on this.

    Uninstall ALL USB host controllers. (Remember that when you have finished the last of them, your keyboard and mouse may not work!)  Restart the PC.  Windows should then pick up the controllers & install the correct drivers.  The only time where it will not install the drivers is when the USB host controllers are physically damaged.  In this case, the fastest and cheapest method is to buy a USB PCI card which fits directly into a PCI slot on your motherboard and will come with three or four USB 2.0 ports.

  • Create permissions to the level of vCenter using PowerCLI

    PowerCLI command:

    New-VIPermission-role "RoleABC" - main "Domain\Security Group" -entity vCenter

    It is not possible to create permissions in vCenter level using PowerCLI?

    If I want to add permissions for a particular port group, which VIObject should I use for - entity?

    Thank you

    Try it like this

    New-VIPermission-role "RoleABC" - main "Domain\Security Group" -entity (data centers from Get-file)


  • Extract the host name vCenter using PowerCLI

    Hi all

    I was asked to create a script that displays the host ESX, the version of the product name (I use "Get-View $_USER.USER"). «» ""Config.Product.FullName"), and what I thought, that's easy, vCenter host name." I'm having a hard time trying to figure out how to extract the host name real vCenter. I can get the vDC and the cluster, but I can't find what combination of cmdlets or vim commands can extract this nugget. Is something that is accessible via a standard cmdlet such as get-viproperty, get-view or another?

    TIA,

    g

    Does what you're looking for?

    Get-VMHost | Select Name,@{N="vCenter";E={$_.Uid.Split(':')[0].Split('@')[1]}}
    
  • Skype and Surface Pro - can I activate microphone for Skype, but the device is off?

    I would like to use Skype but don't want the camera on.  I can only find a place to allow the use of both at the same time.  Is there one place other than the camera app where I can turn off the camera?

    Hello

    My problem was that in the camera app and the Skype app is given to the microphone and camera at a time.  I did talk about today with support Surface and found that have the permission to the camera application turn off continue to allow the microphone to work in the Skype app without having to worry about the camera.

    I did follow your advice as well and now know where to go for my personal use.

    Thank you!

  • AC/battery lights - should they be lit even when the device is off?

    Hello
    Recently taken a U300. Can someone please help... are the AC / battery charge lights supposed to stay on blue all the time... even when the lid is closed and the unit is turned off (but still plugged?)
    Would appreciate any help
    Thank you

    Yes. If the laptop is turned off but connected to the power supply the two LEDs will be all the TIME.
    When you disconnect the power supply both will be OFF.

  • How to restore my Equium A110 to the factory setting by using the product CD?

    Hello

    My laptop crashed and it was basically the problem hard drive according to my understanding.

    I bought a new identical hard drive on the laptop and when I run the product recovery CD, it starts and then on the choice of the language, he says there is no language selection and connect in some BACK...

    I don't know how to restore my laptop using the default product recovery CD. Can someone be kind enough to walk me through step by step or point me in the right direction if there is already a thread on this forum.

    Thank you all for the cooperation.

    Rob

    Hello

    Laptops are specific products of countries recovery image on a single language. You cannot choose a different languages.

    Start the installation of recovery, don t change simply follow the menu on the screen and try to start the recovery image installation.

  • Change the type of NICs using PowerCLI fails

    Hello world

    I'm changing the type of network adapters in a specific VM through the CLI interface, running on VMware ESXi 4.1

    Connection to the ESX host and find the desired virtual machine are pretty easy. The beginning of the troubles, when I enter the command get - vm < virtual computer name > | Get-networkadapter | together-networkadapter-type vmxnet3

    So, I get:

    Together-NetworkAdapter fault. RestrictedVersion.summary

    + get - vm Sophos-UTM | Get-networkadapter | together-networkadapter < < < <-type vmxne

    T3

    + CategoryInfo: NotSpecified: (:)) [game-NetworkAdapter], RestrictedVersion)

    + FullyQualifiedErrorId: Client20_VirtualDeviceServiceImpl_SetVirtualNetworkAdapter_ViError, VMware.VimAutomation.ViCore.Cmdlets.Commands.VirtualDevice.SetNetworkAdapter

    Apparently, I am doing something wrong here, but so far, have been unable to determine what the problem is.

    Could someone help me, please,

    Concerning

    Tobias

    I have encountered this problem before, this article will be useful for you.

    http://www.virtuallyghetto.com/2011/06/dreaded-faultrestrictedversionsummary.html

  • Download the Version of vCenter using PowerCLI

    I have a report that runs connected to multiple vCenters at the same time.  How can I get the version of the vCenter 4.1, 5.1, 5.5, 5.0 format, etc and use it in a report as below?

    Thank you!

    foreach ()$vcenter in $global: DefaultVIServers) { }

    }

    Like this

    Global $: DefaultVIServers | Select the name, Version

  • How do we get the device phone number using webworks api 2.0

    I could see an example of code to get the phone number of javascript which is not supported for BB10.  The code below does not work for BB10? If so, what is one alternative to the native extension.

    
    

    Hi beats,

    It is currently not possible. The only way you could get the phone number in this moment is to create a native extension that accesses the 'phone' / 'Line' API here http://developer.blackberry.com/native/reference/cascades/bb__system__phone__line.html?f=line#functi...

  • Error: "the process cannot access the file because it is being used by another process." when treid to install the device driver

    Original title: Windows cannot install the drivers

    I had a lot of trouble installing the drivers on my Windows computer.  I went straight in the Device Manager and deleted the devices I tried to install and reinstalled them, I went into safe mode, I got Windows to run the console and only the basic process and run from there Device Manager... no matter what I do the same mistake.

    "The process cannot access the file because it is being used by another process".

    Even after a restore of the system, he did this, and I don't know what to do anymore.  Only devices that have been previously installed work.

    What's more important install my Blackberry software because my phone is broken.  The software cannot detect my phone because the drivers have not been installed.  Most of the devices I can use with Linux (I have Windows Vista and Ubuntu running on the same computer), but RIM don't make Blackberry for Linux software, so I have to do it on Windows.

    Hi paco2012,
     
    1. did you of recent changes on the computer?
    2. how many user accounts you have on the computer?
     
    Try these steps and check the result.
    Step 1: Install the driver as an administrator
    a. shut down the computer runs.
    b. start the computer and the connection as an administrator.
    c. find the driver configuration file, right-click on the file and click "Run as Administrator".
    d. follow the instructions in the wizard to install the driver.
    e. restart the computer once the driver is installed.
     
    Step 2: Try to install the driver to boot either by disabling all non-Microsoft programs
    a. open the article: http://support.microsoft.com/kb/929135
    b. Article, follow "step 1: perform a clean boot."
    c. restart the computer.
    d. install the driver and verify the result.
    e. follow "step 7: reset the computer to start as usual.
     
    Kind regards
    Syed - Microsoft technical support.
    Visit our Microsoft answers feedback Forum and let us know what you think.
  • No driver found for the new USB drives don't. No problem with the devices previously used.

    Hi, I can not install any "new" USB keys or USB external drives. The error is "driver not found".

    The thumb drives and external drives that I've used are working properly. The error is for the devices was not used in this machine.

    I tried to follow a tip on a site and deleted INFCACHE.1 (after creating a restore point), but it has not changed the behavior.

    Windows 7 32 bit.

    Kind regards

    Check if you have limited the available somehow drives... possibly VMWare has reserved
    the drive letters. Best is to check with the VMWare Support and forums.

    Look in Windows disk management and see if something is there.

    Rob Brown - MS MVP - Windows Desktop Experience: Bike - Mark Twain said it right.

Maybe you are looking for