PowerCLI - looking for a command to connect/disconnect a virtual disk

I have a virtual drive persistent indeendent that stores data.  I would like the opportunity to:

-Disconnect a computer virtual, via PowerCLI

-Perform this action

-Reconnect the persistent independent virtual disk to the virtual machine via POwerCLI

p.s. I do not want to delete or create a new drive, just to use one I have already created.

Thank you

Frank

Since VMware vSphere PowerCLI is not for VMware Workstation, the forum you posted, I'll assume that you posted in the wrong forum.

Check out online cmdlet Reference and specifically Remove HDD and example 4 in New HDD.

Tags: VMware

Similar Questions

  • Students cannot "connect/disconnect the virtual machine's CD/DVD devices.

    I will start with this context (and apologies for the wall o ' text): I'm a newbie.  I took the course VMware local community college offers [VMware ESXI Server Enterprise (CIS197)], but I've not yet certified. And I don't have a real experience, except what I have taught myself so far.

    I recently accepted a position of learning associated with the College (think: glorified lab tech). I was tasked to work with stuff from VMware in the laboratory (among other things such as Cisco and Juniper equipment). There is no pass-down information like the previous left the position four months ago.

    We have a single host running ESXi 348481 4.1.0. "We have vCenter Server (5.5.0, 1312298), running on Windows Server (2008 R2, Enterprise Edition).  Access host and vCenter through two different IP, addresses using the vSphere client (either 5.5 or 4.1, using a single application - depends to know if I connect to the host or vCenter).

    At that time, the host is using local storage only (we have plans to change this, but it will take time).  The host is not a production on its own server, because it does not have a school systems.  He does, however, run a number of virtual machines in the lab, students use (Linux, Microsoft, Web design, etc.).  So, right now, I can't take it down.

    I was tasked to create a number of virtual machines that students can use to make the basic labs of Microsoft Windows 7.  So far, I have:
    -Created users, one per student, on the host.
    -Creating VMs, deploy one per student, I have a gold model vcenter.
    -Creation of roles to limit the access of students to just their VM attributed, which they access via client vSphere.
    -Created a Windows Server 2008 R2 domain controller that is also a DHCP server.
    -Created a virtual network, which is accessible only by the Windows 7 virtual machines and is not visible outside the vSphere environment (if I said this right - he does not see the Internet or school network).

    So far, it's all good.

    However, I need to be able to allow students the ability to edit the ISO file on which their VM points in order to complete some laboratories. I guess they would use the button "connect/disconnect the virtual machine's CD/DVD devices" on the taskbar (or console window). It does not work.
    I searched a lot and found that others have had the same problem.  However, all of the solutions I've tried so far have failed.  When they click 'Connect to ISO image on the data... store. "they get an error message means nothing to me,"an internal error has occurred in the vSphere Client. Details: Object Reference not set to an instance of an object. Contact VMware support if necessary.
    The role that I use for students has these settings:
    -Data store > Browse the data store
    -Virtual Machine > Configuration > change the settings of the device
    -Virtual Machine > Configuration > settings
    -A bouquet under the virtual machine > Configuration >
    -Configure CD media
    -Console interaction
    -Connection of the device
    -On
    -Power off
    -(and more, which I don't believe are important to the question)
    -State > create the snapshot
    -State > go back to the snapshot

    I tried "Virtual Machine > Configuration > add existing disk", "Virtual Machine > Configuration > add new disk" and "Virtual Machine > Configuration > add or remove an instrument" with no luck.

    Either by the way, the root account can do all these things, but no other account can - not even a game as an administrator account.

    I've seen mention I have apply the role in the data store.  It is perhaps part of the problem. I can't see the data store when I am connected to the host (wellll, I can, if I click on the host name, then on the Summary tab - but roles do not apply at this stage).  I see is 'Inventory' (which has virtual machines and Pools of resources), 'Rôles' and 'log files '.

    I can see the data store when logged in vCenter. Roles of students, however, are defined on the host computer. If I clone the role of users in vCenter and change this role cloned to have "permissions" that those who are on the host computer and then apply it to the data store, it still does not work.

    So, after all this (which I hope I've included all the necessary information), what can I do to allow the students to change ISO to which they are connected?

    Of course, if I left something, or if someone has a question, please ask.  I want to get this resolved as soon as I can.

    It turns out that I finally found the solution to the problem.

    What 'fixed', it is sufficient to vSphere Web Client to vCenter, which then allowed us to use Single Sign-On (SSO).  This, in turn, allowed us to define users and roles in vCenter (rather than having set them up directly on the host computer) which have then been applied to the VMS of students and also to the data store.

    Now, they can (de-) connect their ISOs at will.

    I find it interesting that vSphere Client (application) shows the users (and the things that they have access to), but it won't let you set of users.

  • I'm looking for a Script that can list all virtual machines with type of NIC E1000 via the output of the CSV file.

    Hi gurrus and LucD

    I'm looking for a Script that can list all virtual machines with type of NIC E1000 via the output of the CSV file.

    The script should search for information in a multiple Vcenter servers and multiple clusters and list all the VMs name, status (two powers on or off) with type card NETWORK Type E1000 only no other.

    Concerning

    Nauman

    Try like this

    $report = @)

    {foreach ($cluster Get-cluster)

    foreach ($rp in Get-ResourcePool-location $cluster) {}

    foreach ($vm in (Get-VM-location the $rp |)) Where {Get-NetworkAdapter - VM $_______ | where {$_.}} Type - eq "e1000"}})) {}

    $report += $vm. Select @{N = "VM"; E={$_. Name}},

    @{N = 'vCenter'; E={$_. Uid.Split('@') [1]. "Split(':') [0]}},"

    @{N = "Cluster"; E = {$cluster. Name}},

    @{N = "ResourcePool"; E = {$rp. Name}}

    }

    }

    }

    $report | Export Csv C:\temp\report.csv - NoTypeInformation - UseCulture

  • Unable to connect to the virtual disk Service, Virtual Disk Manager Interface not registered

    I installed Windows 7 Ultimate on this laptop as a new installation about six months ago.  Since then, I don't think I ever ran diskmgmt.  Today, I joined a new external hard drive usb, it reported the drivers installed fine, but then the installation bombed at the beginning.  I went to verity, what had happened and has run diskmgmt.msc (as an administrator), but she came back with the message "Unable to connect to the virtual disk Service" and also a small OK msgbox appeared with the title "Virtual Disk Manager" and the "Interface not registered" message

    I disconnected the USB hard drive and tried again diskmgmt, but no change.

    I restarted in safe mode, tried diskmgmt, but no change.

    I ran sfc/scannow, but it has reported that it found no errors.

    I checked that the virtual disk service has been configured as a textbook in services.msc, and event viewer showed that when I ran diskmgmt he started VDS and then stopped VDS.

    I tried again, but still not like before.

    Is there some dll I can't regsrv32?

    Thank you

    Marc

    Hello

    I suggest you to return the items for the following responses from Microsoft, he says same issues with trying the troubleshooting steps and check if it helps.

    http://answers.Microsoft.com/en-us/Windows/Forum/windows_vista-hardware/cant-start-disk-management-unable-to-connect-to/31898500-9d84-4CB5-9ba3-c1f42e3b1ace

    http://answers.Microsoft.com/en-us/Windows/Forum/windows_vista-hardware/problems-with-Vista-after-unplugging-by-external/093f1660-160F-478f-b81a-493e963ffd9a

    http://TechNet.Microsoft.com/en-us/library/cc771775.aspx

    Note: it also applies to Windows 7.

    Hope the information is useful.

  • When running Disk Management, get the error - failed to connect to the virtual disk Service.

    When I run the Snap on the local server disk management, I get an error message in the status bar: unable to connect to the virtual disk Service.

    Thanks, I have tried these things and nothing has solved the problem.  Here's what I did:

    (a) check the VDS service was manual and failures later per second are 'take no action '.
    ANSWER: Yes to manual and following, second has not changed to "restart the service" of "non-action".
     
    (b) sfc/scannow as administrator
    ANSWER: the System File Checker has found no problem (program reported no problem and findstr/c: "[SR]" on CBS.log doesn't have the list of issues)

    (c) restore to a previous system restore point
    ANSWER: I have tried restore points several more early, each of them failed

  • Look for the Wi - Fi connection?

    Hi guys,.

    I used the code below to check for the Wi - Fi connection

    I referred follow url:http://developer.blackberry.com/cascades/files/webinars/dealing_with_data.pdf

        bool available = false;
    
        foreach(QNetworkInterface interface,QNetworkInterface::allInterfaces())
        {
            if(interface.flags().testFlag(QNetworkInterface::IsUp) && interface.name().compare(QString("ti0")) == 0)
            {
                available = true;
    
            }
                }
    

    But it's always fail.

    What I'm missing here?

    You're right, using the QNetworkInterface class that we are able to determine if the interface is in place, and able to connect to an AP or down (off). But it is not an obvious way to determine the interface is actually connected to an access point.

    So far I have has some success by using this code:

    bool Downloader::isWifiOnline()
    {
        bool available = false;
        foreach(QNetworkInterface interface,QNetworkInterface::allInterfaces())
        {
            if(interface.flags().testFlag(QNetworkInterface::IsUp) && interface.name().compare(QString("tiw_sta0")) == 0)
            {
                if (interface.addressEntries().count() > 1)
                    available = true;
            }
        }
        return available;
    }
    

    It seems that the interface has a number of addressEntries 2 when it is connected to the access point. and less when it is not. This allows us to determine if the interface has a configured IP address, where probably connected to an access point. It is possible that the user manually configures the ip address of the wireless interface, which can result in a false positive.

    For now it seems to work, but I have still a few test cases to try. I hope that others may chime about how they determine if the phone is connected to an access point.

    See you soon,.

    Eric

  • Looking for an Apple support-connected to COTEQ?

    Surf the internet with I-phone. EU security alert to contact Apple technical support with a phone #. Did not trust #, then sought support from Apple. Found a link that said Apple Tech Support and was connected to the COTEQ. Said that they are under contract to Apple technical support. Anyone have this experience?

    It's a scam. They have nothing to do with Apple.

  • Looking for a command

    The command to list blackout schedule is not a problem. I would like to know if there is a command to list all name of calendar in Foglight as nonworking days, business day. This is the command I use to list blackout annexes./fglcmd.sh - usr pwd - cmd - agent: showschedule.

    Hello

    Have you checked the referenced in this solution to support command line

    https://support.quest.com/SolutionDetail.aspx?ID=SOL32946

    I think it's one that can respond to your case

    Schedule:

    list displays a list of all the annexes Foglight.

    Golan

  • Lenovo ThinkPad Edge 15 - screen becomes black for a while when connected/disconnected.

    Hey,.

    I have a problem with my Lenovo. The problem is that whenever I have plug or unplug the adapter to my pc, the screen goes black for a second about. I don't encounter this problem before, it started to happen a week or 2 ago.

    I also put in place a video on this topic to get a better overview:

    http://Tinypic.com/player.php?v=2l9r2ts&s=5

    Any help is appreciated!

    OK, I got it fixed now. Turns out it was my old graphics driver. Just updated my driver and woila. This works. Could not even think that this would have been the problem tho xD

    So if anyone else has this problem, then try to update your graphics driver.

  • looking for a script to the list of virtual machines by datastore

    Someone at - it a script that lists each data store, then the virtual machines that are on it. Or maybe the list all virtual machines and data store or data warehouses is located in the virtual machine?

    Thank you

    This should do the trick for you.  In fact, it extends the computer object complete virtual with a property data store so you can still search the other aspects of the virtual machine.

    Get-Datastore. WHERE-object {$_.} {Name - like "DMX *"} | {ForEach-Object

    $dsname = $_. Name

    $_ | Get - VM | {ForEach-Object

    $($_ | Add - Member MemberType NoteProperty-name of store data-value $dsname - PassThru) | Select-object Name, host, Datastore

    }

    }

  • looking for a file in the disk

    Hello and greeting to your friend,

    I'm looking for a command or a small program that displayed the files by their names in directories and returns a Boolean value, true if the file exists and, if mistakes.

    Thank you

    You can use the recursive file list feature to create an array of file names. Then do a string search in this table:

    Your regalar expression would be "^ foo". Refer to "Match Regular Expression" primitive for more information on regular expressions. Also you can watch here in the forums since it is a regularly discussed topic and, unfortunately, not too easy at first...

    Norbert

  • Failed to initialize the library for the assembling and disassembling workstation virtual disks 9

    I am using VMware Workstation 9.0.4 build-1945795 and have a problem with "map of the virtual disks. I tried map a virtual drive on windows server 2008 r2, windows server 2008, windows 7, windows xp, windows 2000, windows 98, and BACK 6.22. I have went to the file - card virtual disks and get 'Could not initialize the library for the Assembly and disassembly of the virtual disks', every time I have try to map any operating system for the virtual machine. Some have snapshot while others do not is a mixture of 64-bit and 32-bit virtual machines. My system is Windows 7 Enterprise 64-bit. What I'm missing here because if a feature is available in the menu you seem to expect it to work actually on something.

    OK the fix for me was that I had to uninstall VMware workstation and now it seems to work very well on all the OS preceding reinstall it.

  • I'm looking for a link to XP SP1 does not require a network connection to install

    I'm looking for a link to XP SP1 does not require a network connection to install

    Were you recently doing a Clean Install? I ask because you are implying in your installation of Windows XP is in 'gold' or SP0 (i.e., pre - SP1) level. Well sure, automatic updates will not work!
    You can use this path to level – says in passing:
    Gold XP to XP SP2 to XP SP3.
    Note that installing SP1a is TOTALLY USELESS!
    Here are the detailed instructions:

    1. download the installation of SP2, SP3 and IE8 files. I prefer to keep these on a USB key, but this is optional. Here are the links to all the installation of three files:

    http://www.Microsoft.com/download/en/details.aspx?ID=28 (for SP2)

    http://www.Microsoft.com/download/en/details.aspx?ID=24 (for SP3)

    http://www.Microsoft.com/download/en/details.aspx?displaylang=en&ID=43 (for IE8)

    And if you wish, download the Setup file of a good anti-virus program. I recommend Avira free Antivirus:

    http://www.Avira.com/en/Avira-free-antivirus

    2. disconnect Internet.

    3. temporarily disable the automatic updates.

    4. install SP2. Restart twice.

    5 install the SP3. Restart twice.

    6 switch to IE8. Restart twice.

    7 install an Antivirus software.

    (What happens very often is that someone has their software antivirus running as they try to install SP3, which often translates into chaos! "This is why it must be done after installing SP3 and IE).

    8 make sure that firewall Windows is activated (it should be).

    (Now you can physically reconnect to the Internet.)

    9 visit Windows Update to download and install only the critical security updates.

    10 re - enable automatic updates.

    After the back if you need guidance.

  • looking for help on the script PowercLI.

    I'm looking for a script powershell group based vmsessions on the State of vmtools version so that I can plan the upgrade to version VMtools on virtual machines.

    Please use the below script and let me know if problems.

    Claire

    $logfile = "result.txt".

    $vms = «»

    $output = «»

    $temp =""

    $vm =""

    To connect to vcenter Server

    $vcenter = read-host "enter the vCenter Instance.

    to connect-viserver-Server $vcenter - WarningAction SilentlyContinue

    Get-Date | out-file $logfile

    echo "= details = | out-file $logfile - Append

    $vms = get-Content.\list.txt

    $output = get - vm $vms | SELECT name, vmhost, PowerState, version, toolsversion, toolsversionstatus, comments.

    | Tri-objet-property toolsversionstatus | FT - AutoSize GroupBy - toolsversionstatus-wrap

    $output

    $output | Out-file $logfile - append

    Disconnect-VIServer *-confirm: $false

  • I'm looking for documentation on the Firefox command line arguments.

    I'm looking for documentation on the Firefox command line arguments. I use Ubuntu.

    http://KB.mozillazine.org/Command_line_arguments

    This doesn't seem to be what you're looking for?

Maybe you are looking for

  • iPod Nano 1st generation, not seen by PC

    I found my Ipod Nano and reloaded when I first plugged it in to charge it shows the iTunes I remember loading. However, when I plugged it in to the computer (using the same cable that I used recently, so I know it works!), it displays a message "use

  • keyboard died after a little water

    My dv5 keyboard - 1044ca is not functional after any spill water on it. I have unplugged, and dismantled just after to let dry. Up to 24 hours later and the laptop works less the keyboard.  Device Manager indicates it is plugged into the port and wor

  • Need display driver for Equium A60

    I have a laptop equium ea60-155 and I get a blue screen saying that plays my display driver to come up. does anyone know which ati driver I should replace my current with?Thank you

  • Help. my computer has been hi-jacked. someone, somewhere took control of my system

    Hello. According to me, an ex-girlfriend's and took my computer with a program activity secret journal. She is the only person with access to this computer in my house, but also of information network key, passwords, everything. is there a way to det

  • DeskJet 3525 InkAdvatage: forgotten password

    I'm unable to connect to network my printer Deskjet 3525 (the wifi network is indicated as HP-Print-CB-Deskjet-3520) as I forgot the password. How to recover the password?