Get the scsi for a data store information if the data store is known
Hello
I'm looking for a way to get the information of scsci for a data store if the name of the data store is known. In perl/powershell, this is not a big problem, but how to do this using the Orchestrator. It seems that some information is not available/accessible in vCO, as information volume.extent (object VcHostFileSystemVolume).
For an example on how to do who, in powershell, see
http://vwiki.co.UK/Datastore_to_LUN_Mapping_%28PowerCLI%29
No idea on how to do the same with the Orchestrator.
Concerning
Thomas
Hello
Onyx would not help in this case. After thinking a bit, I found the solution. I looks like:
for each {(var Mon in wfHostObject.configManager.storageSystem.storageDeviceInfo.multipathInfo.lun)
System.Debug ("number of paths:" + lun.path.length);
for each {(var path in lun.path)
If (path.state == 'active') {}
//
Download the mountinfo
//
System.Debug ("mountinfo length:" + wfHostObject.configManager.storageSystem.fileSystemVolumeInfo.mountInfo.length);
for each {(Mount var in wfHostObject.configManager.storageSystem.fileSystemVolumeInfo.mountInfo)
If (mount.volume.hasOwnProperty ("extent")) {}
for each {(measure of var in mount.volume.extent)
var tmp = extent.diskName.split(/\./);
var regExp = new RegExp(tmp[1],'gi');
If (lun.id.match (regExp)) {}
System.Debug ("mount.type:" + mount.volume.type);
System.Debug ("mount.name:" + mount.volume.name);
System.Debug ("extent.diskName:" + extent.diskName);
}
}
}
}
}
}
}
Tags: VMware
Similar Questions
-
Get price value for last date items
Hello
I have a table with
item_id, price, cr_date
How can I get the latest price for each item_id
ex.
1, 2.1, January 1, 2015
1, 2,4, 4 January 2015
1, 1.7, January 2, 2015
3, 4.5 7 January 2015
3, 2.2 January 2, 2015
I want to get
item_id price, Date
1, 2,4, 4 January 2015
3, 4.5, 7 January 2015
Concerning
ARIS
Hello
You can use the aggregate LAST, as this function:
SELECT Item_id
MAX (price) DUNGEON (DENSE_RANK LAST ORDER BY cr_date) AS last_price
MAX (cr_date) AS last_cr_date
FROM table_x
GROUP BY item_id
;
If you would care to post CREATE TABLE and INSERT statements for your sample data, and then I could test this.
The combination (item_id, cr_date) is unique? Otherwise, the query above returns the highest price on the last date; This is what MAX (price) means.
-
get support scsi LUNS for the data store?
I've been delving into the different classes available to HostSystem.queryHostConnectionInfo () and none of the properties appear to contain the id of naa I see when I look at LUNS on an HBA. How do you get to LUN support for a data store?
Figured it out. For anyone else who wants to know:
I created two actions, one to return a hash of the id of naa-online data store object and another action to return a hash of the naa-online drive scsi id
// actions //getDatastoresKeyedByLUN var o_diskHash = new Properties(); for each (var scsiDisk in u_host.config.storageDevice.scsiLun) { //System.log("-> LUN: " + scsiDisk.canonicalName); for each (var dataStore in u_host.datastore) { if (dataStore.info.hasOwnProperty("extent")) { for each (var scsiDiskPartition in dataStore.info.vmfs.extent) { if (scsiDiskPartition.diskName == scsiDisk.canonicalName) { o_diskHash.put(scsiDisk.canonicalName, dataStore); } } } } } return o_diskHash; // getScsiDisksKeyedByLUN var o_diskHash = new Properties(); for each (var scsiDisk in u_host.config.storageDevice.scsiLun) { o_diskHash.put(scsiDisk.canonicalName, scsiDisk); } return o_diskHash; // in workflow for each (var can in dstoreMap.keys) { System.log(dstoreMap.get(can).name + "(" + lunMap.get(can).canonicalName + ")"); }
-
Get the size of the file for a particular file in a data store
I was wondering if it was possible to get the size of a particular file on a data store. It seems that this should be trivial, but I'm new to PowerCLI and I see not all the properties of size when I invoke the cmdlet:
PS fs:------> Get-ChildItem "somefile" * | Get-Member
TypeName: VMware.VimAutomation.ViCore.Impl.V1.DatastoreManagement.DatastoreFolderImpl
Name MemberType definition
---- ---------- ----------
Method of ConvertToVersion T ConvertToVersion [T])
Equals method Boolean Equals (System.Object, obj)
GetHashCode method int GetHashCode()
Type of the method GetType GetType()
IsConvertableTo method bool IsConvertableTo (type toType)
String the ToString ToString() method
PSChildName NoteProperty System.String PSChildName = XXXXXXXXXXXXXXXXX
PSDrive NoteProperty VMware.VimAutomation.ViCore.Cmdlets.Provider.DatastoreProvider.DatastoreDriveInfo PS...
PSIsContainer NoteProperty System.Boolean PSIsContainer = True
PSParentPath NoteProperty System.String PSParentPath=VMware.VimAutomation.Core\VimDatastore::\XXXXXXXXXXXXXX
PSPath NoteProperty System.String PSPath=VMware.VimAutomation.Core\VimDatastore::\XXXXXXXXXXXX
PSProvider NoteProperty System.Management.Automation.ProviderInfo PSProvider=VMware.VimAutomation.Core\VimDa...
Datastore property {get ;} VMware.VimAutomation.ViCore.Types.V1.DatastoreManagement.Datastore data store
DatastoreFullPath property System.String DatastoreFullPath {get ;}
DatastoreId property System.String DatastoreId {get ;}
FolderPath property System.String FolderPath {get ;}
FullName property System.String FullName {get ;}
Property ItemType ItemType of VMware.VimAutomation.ViCore.Types.V1.DatastoreManagement.DatastoreItemType...
System.Nullable'1 [[System.DateTime LastWriteTime, mscorlib, Version = 4.0.0.0 property, Culture = neutral, publ...
Property System.String name {get ;}
UID property System.String Uid {get ;}
Faik, you must use the SDK API to find this HostDatastoreBrowser of information, i.e.
.
See for example Re: using SearchDatastore_Task
-
Failed to get the disk partition information when you add the new data store
Hello
Update my ESX to version 4 Update 1 (4.0.0, 256968). Now, I'm trying to add a new data store to a cluster in vCenter and receive the following error message when I will review the current structure of the disc "error when configuring the host: failed to get the disk partition information. When I click back, then next, there's no error message but in the formatting window, I get the error "Object reference" not set to an instance of an object.
I see this question has been asked before, but I can't seem to find an appropriate response. Anyone? The interface using CLI instead of vCenter isn't an option (alignment VMFS, workload and so on)
I use Dell R900 with an EMC Symmetrix VMax SAN
The size of the LUN I want to add is 741 GB
Concerning
Marius Aulie
If you have a virtual machine for Windows test, you could do the following, to ensure that the logic unit number has a clean partition table:
-set the LUN as a GROSS physical to virtual machine device
-Run diskpart, select the drive and run the CLEAN command
-detach the LUN to the virtual machine
-try to create the data on the LUN VMFS store
The size of the block of the data store where the VM test can be a problem with the above. Due to the size of the LUN, the size of the block of the data store must be at least 4 MB. Attach the LUN to a physical test system could be an alternative.
André
-
Get the device UID (naa) in the data store
Hello
I want to get the UID (naa) device from a data store (VcHostDatastoreSystem).
But I don't seem to find it.
Can someone help me with this?
Kind regards
Jonathan
Look at the code in this post: receive information from scsi to a data store if the data store is known
I used that as a starting point for the following... I put this code in a script task and passed in a VC:HostSystem object named "wfHostObject":
for each (var lun in wfHostObject.configManager.storageSystem.storageDeviceInfo.multipathInfo.lun) { for each (var path in lun.path) { if (path.state == "active") { // Get the mountinfo for each (var mount in wfHostObject.configManager.storageSystem.fileSystemVolumeInfo.mountInfo) { if (mount.volume.hasOwnProperty("extent")) { for each (var extent in mount.volume.extent) { var tmp = extent.diskName.split(/\./); var regExp = new RegExp(tmp[1],'gi'); if (lun.id.match(regExp)) { System.debug("=========== Mount Name: "+mount.volume.name); System.debug("Type: "+mount.volume.type); System.debug("Extent diskName: "+extent.diskName); System.debug("vStorageSupport: "+mount.vStorageSupport); System.debug("---- Mount Info"); var mountInfo = mount.mountInfo; System.debug("AccessMode: "+mountInfo.accessMode); System.debug("Accessible: "+mountInfo.accessible); System.debug("Inaccessible Reason: "+mountInfo.inaccessibleReason); System.debug("Mounted: "+mountInfo.mounted); System.debug("Path: "+mountInfo.path); } } } } } } }
Example of output:
[2013-12-12 17:03:57.370] [D] =========== Mount Name: qnap-iscsi [2013-12-12 17:03:57.370] [D] Type: VMFS [2013-12-12 17:03:57.370] [D] Extent diskName: naa.60014055dbf2832dbc91d4bacdb356d9 [2013-12-12 17:03:57.370] [D] vStorageSupport: vStorageSupported [2013-12-12 17:03:57.370] [D] ---- Mount Info [2013-12-12 17:03:57.374] [D] AccessMode: readWrite [2013-12-12 17:03:57.374] [D] Accessible: true [2013-12-12 17:03:57.374] [D] Inaccessible Reason: null [2013-12-12 17:03:57.374] [D] Mounted: true [2013-12-12 17:03:57.374] [D] Path: /vmfs/volumes/528cbe4f-6ae388d8-6a9e-14dae927d5bb
-
Hello guys,.
I have vCenter Orchestrator 4.1.1 build 733 installed and it works fine, but I need your help for the following two issues:
(1) I want to put the description/notes of a virtual machine using a workflow. But I have not found any API useful to create this workflow (I don't want custom attributes, see attachment for details).(2) how can I get the name of the data store, where the virtual machine? I need this name for a workflow.
I need your help.
Thanks in advance!With regard to the notes of the VM, the following code (see enclosed package) can do this:
var oldNotes = vm.summary.config.annotation;
If (oldNotes == null) {oldNotes = ' ' ;}}
System.log ("Notes of VM current:" + oldNotes);
Now put the new notes:
Start by creating a context
Context of var = new VcVirtualMachineConfigSpec();
Update the annotation with the new value property
configSpec.annotation = notes;
launch the task to reconfigure the virtual machine with the new context
NOTE: This is sure to apply with a virtual machine under tension
var task = vm.reconfigVM_Task (configSpec);And, in what concerns the VM information, take a look at the workflow of the library: \Library\vCenter\Virtual Machine management\Others\Extract virtual machine information
-
Hello!
If there is a way to search a data store specific, given its GUID (e.g. 498bd332-3e6216da-c1cd-007e4f41313f)?
If not, is there a way to get a list of all the objects of managed database known to VI (that I can then get the GUID)?
Thank you! <! - google_ad_section_end - >
Take a look at this script: getDatastoreUUID.pl
=========================================================================
William Lam
VMware vExpert 2009
Scripts for VMware ESX/ESXi and resources at: http://engineering.ucsb.edu/~duonglt/vmware/
VMware Code Central - Scripts/code samples for developers and administrators
If you find this information useful, please give points to "correct" or "useful".
-
Original title: My Vista system will not back up my data to an external drive. I get the error message 0 x 80070002. I obviously don't want to lose any data on my hard drive. What can I do?
I'm running Windows 9 and I'm trying to save on a Western Digital 1 .5TB external drive.in Vista
Hello
There is no windows 9 Microsoft
There is IE9
Read this vista information
see if this information helps you
How to make a backup of your data
http://www.vista4beginners.com/how-to-backup-your-data
How to restore your files
http://www.vista4beginners.com/how-to-restore-files
the 1st link below is how do the backup complete pc
http://www.bleepingcomputer.com/tutorials/tutorial145.html
and that is how do to recover the backup complete pc
http://www.bleepingcomputer.com/tutorials/tutorial144.html
and here is the information of microsoft in restoring a system image backup
http://Windows.Microsoft.com/en-us/Windows-Vista/restore-your-computer-from-a-system-image-backup
If you have problems, it's in here is a forum for microsoft specifically for backup issues
http://social.technet.Microsoft.com/forums/en-us/WindowsBackup/threads
-
original title: error 0xC0AA02FF
I try to use a "USB" "cruzer" to create a disc repair system, but when I click on this drive to create it I get the following error message:
"The device reported unexpected or invalid data for a command. (oxC0AA02FF)
Hello
What method did you follow to create the system repair disc?
I suggest you to create the system with different USB repair disc and check if it helps.
Means all try the methods and check them off below if it helps.
Method 1:
Try to put the computer in a clean boot state, and then check if it helps.
How to troubleshoot a problem by performing a clean boot in Windows Vista or in Windows 7
http://support.Microsoft.com/kb/929135
Note: After troubleshooting, be sure to set the computer to start as usual as mentioned in step 7 in the above article.
Method 2:
I also suggest you to perform check disk (chkdsk) on the computer and see if it helps.
http://Windows.Microsoft.com/en-us/Windows7/check-a-drive-for-errors
Note: You may lose a small amount of data while performing the check disk.
I also inform you that the data on the USB key will be lost. You should take a backup.
You can also check with the reference article below:
http://Windows.Microsoft.com/en-us/Windows7/create-a-system-repair-disc
-
To Powercli how to get the actual number of the paths to the data details store
I'm looking for a command Powercli get the real number of the paths to the data store > Details of the data store
See you soon,.
Vincent
You can do something like this
$esxName = "MyEsx".
$esx = get-VMHost-name $esxName
$esxcli = get-EsxCli - VMHost $esx
$esxcli.storage.vmfs.extent.list () |
Select VolumeName,ExtentNumber,@{N='Device'; E={$_. DeviceName}},
@{N = ' path # ';} E = {}
$esxcli.storage.core.path.list ($_.) DeviceName) | Measure-object | Select Count - ExpandProperty
}}
-
I need to eager zero a virtual disk while building a virtual machine. I found the eagerZeroVirtualDisk_Task() under VcVirtualDiskManager function, which takes in 2 parameters:
name - (String) the name of the disk, is a path to the data store or a URL pointing to the virtual disk that needs to be inflated.
Data Center - (VcDatacenter) if the name is a path of data store, the data center for the path of the data store. Not necessary when called directly on ESX. If not specified on a call to VirtualCenter, the name must be a URL.
How can I get the correct path of data store given the virtual disk? I intend to iterate through the features of the virtual machine to get the disks.
Thank you!
Actually figured out how to get the path of the data store, and how a drive zeros. In case it is useful to share the code here:
var vimHost = vm.vimHost; VM instanceof VCVirtualMachine
var vDiskMgr = vimHost.virtualDiskManager;
for each disk
var features = vm.config.hardware.device;
for each {(dev var in devices)
dev.backing contains a lot of useful things...
If (dev instanceof VcVirtualDisk) {}
a disc!
var dsPath = dev.backing.fileName;
System.log ("path of disk:" + dsPath);
Data var Center =
System.getModule('com.vmware.library.vc.datastore').getDatacenterForDatastore (dev.backing.datastore);
var vcTask = vDiskMgr.eagerZeroVirtualDisk_Task (dsPath, datacenter);
wait
var waitResult =
System.getModule('com.vmware.library.vc.basic').vim3WaitTaskEnd (vcTask, true, 5);
}
}
-
How to get the uri of the web client or IP information to the data java adapter service
Hello
Samples for SDK 'chassis-app/chassis-service', the examples use the 'ChassisDataAdapter implements DataProviderAdapter' to get the data.
Here, I want to get the customer web ip in the constructor of the provider information.
I thought is to use the '_userSessionService', but '_userSessionService.getUserSession ()' returns the null value!
Is there a new way to get the IP address?
public ChassisDataAdapter (UserSessionService userSessionService, VimObjectReferenceService vimObjectReferenceService) {}
_objectRefService = vimObjectReferenceService;
_userSessionService = userSessionService;
/ /Here to get the Web info IP client
createChassis();
}
The ChassisDataAdapter constructor is called when the server starts, there is no session of the user at this time here.
You can access the current userSession in each call GetData.
-
get the data store with details of mapped cluster
Hi with the script below, I am able to do data store maps on which the cluster and its host details... but I'm having multiple LUNS how to write for everyone to get to each store data below the output...
Get-data store 'testdatastore ' | Get-VMHost | Name,@{N="cluster select '; E={$_| Get-Cluster}}, version
Output:
Version of cluster name
10.0.0.0 testcluster 5.1.0
Desired output:
I need the name of output data store because I check for several data stores... can someone help me to get .csv exit foreach datastore as below
Data name cluster version store
testdatastore 10.0.0.0 testcluster 5.1.0
testdatastore 1 10.0.0.1 testcluster2 5.1.0 What type of data store?
I'm asking because there is no mentioned properties (. ExtensionData.Info.Vmfs.Extent) for data warehouses is of type NFS:
PowerCLI C:\Windows\system32 > ((get-datastore_iscsi*).ExtensionData.Info.Vmfs.Extent). Diskname
NAA.60a9800042594835695d453439742f53
PowerCLI C:\Windows\system32 > ((get-datastore_NFS).ExtensionData.Info.Vmfs.Extent). Diskname
So, you'll need probably something like this:
Get-Datastore. % { $ds=$_; Get-VMHost - Datastore $ds | Select @{N = 'Data store name'; E = {$ds. Name}},@{N="NAA '; E = {if($ds.) Type - such as 'NFS') {'NFS'} elseif($ds.) Type - as "VMFS") {[String]: join (", ($ds.ExtensionData.Info.Vmfs.Extent|% {$_.}))} DISKNAME}))}}}, name, @{N = 'cluster'; E={$_| {Get-Cluster}}, version}
-
Get the properties of the NAS data store in vSphere SDK Webclient
In vSphere client web plugin I want to go get the remotehost and remotepath data store
I created a DataByModelRequest in the mediator class and to a model of the Ombudsman
[Event(name="{com.vmware.data.query.events.DataByModelRequest.REQUEST_ID}",
type="com.vmware.data.query.events.DataByModelRequest")]
private function requestData():void {
var requestInfo:DataRequestInfo = new DataRequestInfo(DataUpdateSpec.newImplicitInstance());
var dsdatarequest:DataByModelRequest = DataByModelRequest.newInstance(
_contextObject, DatastoreDataItem, requestInfo);
dispatchEvent(vmdatarequest);
}
[ResponseHandler(name=
"{com.vmware.data.query.events.DataByModelRequest.RESPONSE_ID}")]
public function onDataRetrieved(request:DataByModelRequest,
result:DatastoreDataItem, error:Error):void {
if (error != null) {
Alert.show("ERROR");
_logger.debug("onDataRetrieved error: " + error.message);
return;
}
else
Alert.show(ObjectUtil.toString(_contextObject));
Alert.show("RETRIVED");
// Assigning the result to variables to update the view.
_view.dsprop = result;
Alert.show(ObjectUtil.toString(result));
}DatastoreDataItem is my model class
[Bindable]
[Model(type="Datastore")]
public class DatastoreDataItem extends DataObject {
[Model(relation="info.nas", property="type")]
public var type:String;
[Model(relation="info.nas", property="remoteHost")]
public var remotehost:String;
[Model(relation="info.nas", property="remotePath")]
public var remotepath:String;
[Model(property="url")]
public var url:String;
}get the value null for all fields but name works very well and I also tried [Model(type="NasDatastoreInfo")]
Relational syntax you are using does not work because data info store is not a managed entity, it's just a property field. The solution is to cast to the type of Datastore.Info, i.e. NasDatastoreInfo in your case. Here's the syntax to use in your model:
[Model(property="info[@type='NasDatastoreInfo'].nas.remoteHost")] // The server for NFS datastore public var nfsServer:String; [Model(property="info[@type='NasDatastoreInfo'].nas.remotePath")] // The folder for NFS datastore public var nfsFolder:String;
Maybe you are looking for
-
I need help. I can't use my PC at home (laptop) more access to internet using Firefox 7: no contact. Before you can update everything was OK. I received a warning that some versions of Java were not comatible with Firefox 7. Since Firefox 7 did not w
-
How uncompile two albums on itunes?
Somehow, after that I loaded a CD into iTunes, two of them got interlaced, and I can't find a way to separate them again. I have to delete the songs from one of the albums and reinstalling them? Flipping between Annie Lennox and the Eurythmics and
-
Use the classes in lvclass to 8.6, if I create an instance of a class, do I need to delete? For example, if it were a RefNum, I would use the close Reference.vi to dispose of it. Should this be done with a constant of class? And if so, how?
-
What to do or how to fix my laptop which will not load to windows/microsoft?
I get out the battery but it is not the problem. And I continue to turn on and off and when it lights up regularly, it loads but then it gets to the part where I sign my account and it's just a white screen. How can I fix it? And how can I remedy thi
-
I have an old laptop DV5000 since mid-2006 who worked at random and I'm trying to circumvent the problem. I'll try and keep this short ish since I could go into great detail about every little thing, but will try and cover the main things first and l