Get the VcVirtualDisk data store

Salvation;

I have a small question.

I have an object: VcVirtualDisk but I want to know what data store, this drive is on.

Is there an easy way to do this?

Kind regards

Hi jonathan,.

This should help you:

var features = vm.config.hardware.device;

for (var I in devices)

{

If (devices [i] instanceof VcVirtualDisk)

{

System.log ("disk key:" + devices [i] .key).

System.log ("disk ControllerKey:" + devices [i] .controllerKey);

System.log ("disk size:" + .capacityInKB of devices [i] + "KB");

System.log ("disk size:" + (devices [i] .capacityInKB/1024/1024) + 'GB');

System.log ("Backing:" + devices [i] .backing);

System.log ("Backing - store data:" + devices [i].backing.datastore);

System.log ("Backing - thinProvisioned:" + devices [i].backing.thinProvisioned);

}

}

Tags: VMware

Similar Questions

  • Move-VM error: VM must be managed by the same VI servers as the destination data store

    I work with 2 ESXi servers and a single vCenter server with vSphere 6.0 Update 1 b; and PowerCLI 6.0 Release 2

    I have an a datacenter, cluster, vCenter and a vDS.  I need to pass the vCenter data store to another and get the error message:

    "Move-VM VM you are moving should be handled by the same server of VI as the destination container and the data store.

    Code looks like the following:

    $vctObj = to connect-viserver $vctIPaddress

    $esx1Obj = to connect-viserver $esx1IPaddress

    $esx2Obj = to connect-viserver $esx2IPaddress

    $vmObj = get-vm-name $vmname - Server $vctObj

    $destDSobj = get-datastore-name $destDSname

    Move-vm - vm $vmObj Datastore - $destDSobj - 'End' DiskStorageFormat

    I can migrate successfully from the virtual machine to vCenter data store through the VI Client, but PowerCLI left me speechless.

    Maureen

    Try to use the Server parameter on the Get-Datastore line

  • Extremely high latency during the migration of the local data store to data store shared.

    Hi guys I hope you help me. Sorry for my English btw, I'm not native.

    Let's start!

    I have:

    1 vCenter
    1 host
    1 Distributed Switch (with a pg for managing network/IPstorage the esxi)
    1 standard switch (empty)
    1 FreeNAS to provide iSCSI LUNS
    1 Microsoft to provide iSCSI LUNS

    When I try to migrate virtual machines between the warehouses of shared data or data shared at local store, all right. The problem has become when I try to migrate virtual machines from the local to the shared data store. All data stores down (all paths down) and back up and I get this error:

    "Error caused by the /vmfs/volumes/volumenID/VMDirectory/Disk.vmdk file.


    When I try to migrate virtual machines from the local to the FreeNAS iSCSI data store it fails immediately.
    When I do the same local Microsoft iSCSI datastore that it takes a time loooooong to migrate the virtual computer, give it to me even all the paths downwards and uplinks down error but not lacking in migration.

    I'll give you some screenshots to see the errors.

    Thank you very much!

    EDIT: I have extremely high latency notice when I try to migrate from the premises of warehouses of shared data. average 2000ms with peaks of 50,000 (see my response below for more information)

    Finally, I found the solution! The problem is that I have been using E1000E vmnic instead of vmxnet3. I have configured an adapter vmxnet3 and boom! 20 ms in all migration!

    Thank you to all for help, especially Nick_Andreev !

  • Disk groups are not visible cluster. vSAN datastore exists. 2 guests (on 8) cluster do not see the vSAN data store. Their storage is not recognized.

    http://i.imgur.com/pqAXtFl.PNG

    http://i.imgur.com/BnztaDD.PNG

    Do not know how even tear it down and rebuild it if the disk groups are not visible. The discs are in good health on each host storage adapters.

    Currently the latest version of vCenter 5.5. Hosts running 5.5 build 2068190

    Just built. Happy to demolish and rebuild. Just do not know why it is not visible on the two hosts and the disk groups are only recognized 3 guests when more are contributing. Also strange that I can't get the disk groups to fill in vCenter. I tried two different browsers (chrome and IE).

    I have now works.

    All the identical 5.5 relies on ESXi hosts. All hosts are homogeneous CPU/sum of the prospects for disk controller / installed RAM/storage.

    I have work. I had to manually destroy all traces of the vSAN on each single to help host node:

    (1) put the hosts in maintenance mode and remove the cluster. I was unable to disable vSAN in the cluster, I made on each node host (manually via the CLI below) then disconnected web client vCenter and return to finally refresh the ability to disable on the cluster.

    esxcli vsan cluster get - to check the status of each host.

    esxcli vsan cluster drop - the vSAN cluster host.

    storage of vsan esxcli list - view records in the individual host group

    esxcli vsan storage remove-d naa.id_of_magnetic_disks_here - to remove each of the disks in the disk group (you can ignore this using the following command to remove the SSD only falling each disc in this host group).

    esxcli vsan storage remove s naa.id_of_solid_state_disks_here - this is the SSD and all the magnetic disks in a given disk group.

    After that, I was able to manually add hosts to the cluster, leave maintenance mode and configure the disk groups. Aggregated data of the vSAN data store is correct now, and everything is functional.

    Another question for those of you who still read... How to configure such as the VM storage strategy that migrates towards (or inspired) the vSAN data store will immediately resume the default storage policy, I built for VSANs?

    Thanks for anyone who has followed.

  • Shrink a VM HD - is the destination data store need to have enough space for the source or destination VM?

    Hi all

    I have an existing file with HD Server configures:

    HD1: 60 GB

    HD2: 20 GB

    HD3: 650 GB

    Total: 730 GB

    I intend to shrink HD3 250 GB that will give me a new total of 330 GB.

    My question is, when I rode the VMware Converter Standalone process and I get to the step where I select the 'destination '.  Obviously, I need to select a data store that can adapt to the virtual destination machine.

    My concern is that it shows the size of the source disk (Go 730) (see image below), and for some reason any part of the conversion process the destination data store requires the storage of the size of 330 GB vm 730GB as opposed to the 'new '.

    source disk size.PNG

    Can anyone confirm?

    Thank you

    There are no for the data store 730 GB free in order to submit the conversion. 330 GB free (size after reduction) would be sufficient.

    If you also select a provisioning, you could even start the conversion with less free space on the data store, but it may fail at some point, if the actual data meet.

  • Clone the virtual machine to the local data store

    Hi all

    I'm looking to automate a task daily (or almost) of my friends with a small script with powercli.

    I'm trying to "backup" or to clone a virtual machine, I work in a storage of one of our servers.

    The servers are managed by a 5.1 vCenter and the machine is on a shared storage.

    From time to time, I clean, stop the machine, remove all snapshots and clone the virtual machine to one of the local server as a backup storage. So I put together a small script which almost works. It works as long as the target data store is a shared storage, but not with a local storage.

    I get always an error that claims it can not access the local data store and is not a permissions problem...

    Given that I can accomplish this via the customer without problem I thought it is possible via powercli too, or I'm wrong?

    My Script up to now:

    # Variables
    $VC = "vc.domain.com" #vCenter Server
    $User = "domain\user" #User
    $Pass = 'test123' #User PW
    $VMName = 'scripttest' #VM
    $BackupSuffix = "backup" #Suffix to add the name of VM to mark this as a backup
    $VmHost = "esx2.domain.com".
    $Datastore = 'ESX2-LocalData' #Datastore
    $BackupFolder = 'Backup' #Folder the VM gets classified


    # Register cmdlets to VMware

    If (-not (Get-PSSnapin VMware.VimAutomation.Core - ErrorAction SilentlyContinue)) {}

    Add-PSSnapin VMware.VimAutomation.Core

    }


    # Connect to the server

    SE connect-ViServer $VC - user $User-password $Pass


    # Remove the old clone

    $OldBackups = get - VM | WHERE {$_.} {Name: corresponds to '$VMName - $BackupSuffix'}

    If ($OldBackups - don't "")

    {

    If ($OldBackups.Count - gt 1)

    {

    Write-Host "better check! "Found several results:

    Foreach ($VM to $OldBackups)

    {

    Write-Host $VM. Name

    }

    }

    on the other

    {

    Remove-VM - VM $OldBackups - DeleteFromDisk-confirm: $false

    }

    }


    # Clone VM

    $VMInfo = get - VM $VMName | Get-View

    $CloneSpec = new-Object Vmware.Vim.VirtualMachineCloneSpec

    $CloneSpec.Snapshot = $VMInfo.Snapshot.CurrentSnaphshot

    $CloneSpec.Location = new-Object Vmware.Vim.VirtualMachineRelocateSpec

    $CloneSpec.Location.Datastore = (get-Datastore-name $Datastore |) Get - View). MoRef

    $CloneSpec.Location.Transform = [Vmware.Vim.VirtualMachineRelocateTransformation]: sparse

    $CloneFolder = $VMInfo.Parent

    $CloneName = "$VMName - $BackupSuffix".

    $TaskCloneID = $VMInfo.CloneVM_Task ($CloneFolder, $CloneName, $CloneSpec)


    # Check if the task is completed


    $Check = $false

    While ($Check - eq $false)

    {

    $Tasks = get-job | Select State, id | Where {$_.} State - eq "Running" - and $_. State - eq "pending"}

    ForEach ($Task in $Tasks)

    {

    If ($Task.id - eq $TaskCloneID)

    {$Check = $false}

    on the other

    {$Check = $true}

    }

    Start-Sleep 10

    }

    # Move clone to the backup folder

    Move-VM - VM '$VMName - $BackupSuffix' - Destination $BackupFolder


    # Disconnect

    Disconnect-VIServer-confirm: $false

    Can you show us the complete error message you get?

    BTW, the clone step can be replaced by the New-VM cmdlet with the setting of the virtual machine.

  • ESXi 5.0 servers don't recognize that same NFS share to the same data store

    I have a setup of vSphere 5.0 running VMware Workstation 8.  I have two ESXi servers that are accumulating the same NFS share (with the same IP address and the same directory path), but for some reason, they don't recognize it as the same data store.  I deleted and added to the data store again and checked that I am getting the same way on both nodes.  However, vSphere don't let me use the same name when I ride sharing NFS as a data store on the second node. vSphere changes the name of "NFSdatastore" to "NFSdatastore (1)" and will not let me change, say that the name already exists.

    The NFS file server is a VM of 2.99 OpenFiler, which IP 192.168.0.100 (and is in DNS as "openfiler1").  The path is "/ mnt/vsphere/vcs/datastore.

    The NFS mount works great as a data store on the two servers ESXi, except for the fact that vSphere sees two data stores.  I have a Red Hat VM running on each of them, and when I browse the data of each ESXi Server store, I can definitely see two configs VM, as well as a few ISO images that I put on the NFS share.  However, I can't vMotion as he complains about not being able to access the configuration file and the file virtual disk (vmdk) of the other node.

    On the OpenFiler, the directory/mnt/vsphere/vcs/datastore is the property of "ofguest" in the "ofguest" group, and the permissions are "drwxrwsrwx +".  All files under the directory are also held by "ofguest" in the group "ofguest".  Vmx files have permissions "rwxr-xr-x + ', and the vmdk files have permissions ' rw +-

    I did a lot of Google search, read best practices, etc.  Any help is appreciated.

    UPDATE: he Figured out - leakage / on one of the paths of NFS mounting.  DOH!

    Maybe this can help you:

    http://KB.VMware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalID=1005930

    http://KB.VMware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalID=1005057

    Concerning

  • Cloning of VM/TIME to the different data store

    Hi all

    I am working out scripts excellent clone of Ruben garcia and one thing I'm trying to add is to have the VAPP created on a different data store.

    # Clone and move virtual machines
    {foreach ($vm to $vms)
    $vm = $vm | Get-opinion
    $vmname = $cloneName + "»" + $vm.name "
    . \LcloneVM $vm.name - cloneName '$vmname' - «$PortGroup» PortGroup
    Get-vm-name $vmname | Move-vm-destination $vapp;
    The virtual machine are getting cloned and then inserted in the passed TIME as a parameter name, but I can't understand how do to have the VAPP will be created on a data store that I specify. At this time the vApp is created on the same data store where the linked clones. Can I travel after from the user interface by using the migrate command but I want if possible to automate it.
    I thought that the next line should work but the VAPP fails when creating, so the move-vm command fails later.
    # Create VAPP
    $vapp = $host_name | VAPP-new-name "$cloneName" - data store "ThinDiskTesting"

    I am at a loss to what im doing wrong

    Post edited by: BrianRTS - difficulty of setting in the form

    You can specify the data store where you want to create linked clone delta files.

    This requires a slight modification to the script of Ruben

    # Generate specs for clone
    $cloneSpec = new-object Vmware.Vim.VirtualMachineCloneSpec $cloneSpec.Snapshot = $sourceVM.Snapshot.CurrentSnapshot $cloneSpec.Location = new-object Vmware.Vim.VirtualMachineRelocateSpec $cloneSpec.Location.DiskMoveType = [Vmware.Vim.VirtualMachineRelocateDiskMoveOptions]::createNewChildDiskBacking $cloneSpec.Location.Datastore = (Get-Datastore -Name $tgtDatastoreName).ExtensionData.MoRef
    

    Ownership of the data store is used to indicate where the clone should be placed.

    Or you want to create the clones, then move them?

  • Impossible to migrate from windows 2008 to the different data store

    Hai

    When I try to migrate the computer to the different data store I get the error

    "[error caused by file hard to]."

    Thank you

    Concerning

    R.Ramji

    Hello

    first move this virtual machine to another host and try to migration of storage. still, the problem you then close restarts the virtual machine host and try storage vmotion.

    It should work. If the problem continues after the error log.

  • ESXi 4.1 reinstall without loss of data in the system data store

    Hello world

    because of incorrect tape device configuration (see more low http://communities.vmware.com/thread/289847?tstart=0), I have to reinstall Esxi 4.1 in the same place where the system partition is also home to the Oracle data disk (I didn't have the choice because the system starts on the table of great raid with SSDS, there was no such thing which allow me to pre partition the RAID disk into several partitions and choose) only a small partition to install ESXi files), what happens if I reinstall ESXi with the method of "REPAIR"? will be large files within the system data store destroyed or intact?  Help, please.  Any suggestions are greatly appreciated.

    When you do a normal installation of ESXi, the whole installation drive is wiped regardless of the existing partitions that exist.  With a repair only install ESXi system partitions are left.  Any data store must be perserved and after the repair, you can save any virtual machines that were welcomed on this data store.  If the repair not proceed with the installation (for example, if the data store exists in the first 900 MB of storage), then you will get a warning in this sense and a new facility (wipe the entire disk) is performed.

    So with a repair, you should be fine, but I want to take a backup without worrying.

    Dave

    VMware communities user moderator

    Now available - vSphere Quick Start Guide

    You have a system or a PCI with VMDirectPath?  Submit your specifications to Officieux VMDirectPath HCL.

  • Increase in the size of block of the local data store

    I tried from Googling and it involves a lot of things from the command line and seems to be different ways of doing.

    They say that I need to format the drive again and specify a block size.  But isn't ESXi installed on the same partition? If I reformat it, it won't get rid of the ESXi software?

    Where can I get easy step by step instructions on how to do this?

    If you have no data, go to Configuration / Storage and remove the existing data store.

    Then choose Add datastore.

    André

  • Update the XML data store

    Hello experts,

    I've created an interface when an xml file is reversed in the form of a source data store. Xml data are pumped into a target of oracle db. All this goes well.

    I'm creating a scenario where I get an xml file from a ftp server on a daily basis (with agent). This new xml file has the same structure as that already used in the interface. The question is: How can I update the data in the xml data store?

    I tried to replace the original xml file, but it does not work and cdc does not seem to apply here, I searched for quite a while now.

    Thank you very much!

    Yves

    Hello

    See if that helps
    XML for the interface Oracle even insert County regardless of input XML file

    Thank you
    Fati

  • Unable to browse the server data store

    Hello

    I lost the files in my data store. I have two data warehouses and two of them had vm folders in there but tonight my vms unresponsive and when I try to restart they throw an error that a file is not present. When I tried to browse the data store, the two data stores back empty.

    Thank you

    Hey m,

    can you go on the albums esx server into your virtualcenter

    Try remapping to one of the existing NFS shares. You should get a message that the share already exists, but when you return to the summary page, you should be able to doubleclick on the NFS share and view folders (it's like trying to connect is enough to restore the existing connection)

    Let me know how you go

  • Get the latest data of Variable shared before disconnecting from the network

    Hello.

    I use Shared - published network variables for my communication between two PC's. Each LV software will pass the data to another.

    Sometimes the wireless connection to become really bad and the network connection stops.

    I want to get the latest data. Currently my VI will show the value '0' on the variable shared data once the connection is cut.

    I tried using shift, but she registers the same results.

    Can someone show me how I can stay past data when the network connection is disconnected.

    Thank you very much.

    Kind regards

    Hello Fan, Ravens

    It works! Thank you very much.

    Kind regards

  • Get the raw data to map its (SDK)

    I did a search on sound cards and many forums have been useful.  I have just a few quick questions.

    I have a card his (CardDeluxe http://www.digitalaudio.com/) connected to the computer through a PCI.  My goal is to get the raw data from the card and plug and it blow in analytics in CVI.  I don't know how to "talk" to my sound card.

    Of course, my main question is above, but to the refine some concerns...

    I guess I need the SDK libraries for that.  For this, I just need to install the MSN help libraries?

    Is this possible in the Basic Version, or if the full Package of CVI is necessary?

    I have not done things well at low altitude, but it looks like getting a wav file is necessary.  I can't use anything outside of the applications I want to eventually create a program automatically record and play at a time (sync) précis.

    Thanks in advance.

    This site is what I was looking for.  The zip file contains an exe as file c source code.

    http://paulhoule.com/phsrec/index.php

    Edit:

    There is also some info here - http://forums.ni.com/t5/LabWindows-CVI/wav/m-p/235344

Maybe you are looking for

  • How to remove or change the tags in a photo?

    In some of my images, bad tags appeared on pictures of some people. How to fix or remove these?

  • LabView Runtime upgrades.

    Greetings, I'm new to the forum, please pardon any typos correct procedure and/or label. I am using 2012 LabView full development system w/Database connectivity Toolkit, running on a window XP SP3 box. I have to make changes to two applications that

  • recovery in loop process (windows 7)

    I got recovery discs in the mail Todier for my desktop Compaq CQ5600F Windows 7. I loaded the first disc in the drive. Screen says "loading windows files" downstairs, then went to a home screen windows with a green bar, and from there, a screen with

  • BlackBerry Z30 Amazon Appstore crashes

    Hey guys,. A few weeks ago, I installed "Candy Crush' via Amazon Appstore. But decided I don't like, so I simply removed it. It didn't remove via Appstore, simply by clicking on the icon remove this App Seems which was a big mistake... Since then, I

  • MDS BBM Simulator does not work (throws an exception)

    I try to use the BBM SDK Beta v1.0 but I have problems with the MDS Simulator.  I followed the quick start guide that is included in the download.  While trying to start the MDS Simulator, I get this exception: