olan025's Posts

not for the moment. 3.5/2.5..
Anyone have a solution to this one? I am trying to move VMDKs seperate from the VM configuration (home) directory.
Yeah- The logic is in the type of disks you get... ie get-vm | get-harddisk | where ... thingy equals type raw device... the syntax i can work out if i get some time on my lab.
Hey - Sorry for the really delayed response. I have been out of comission lately for working on this utility. As for your questions. 1. At the time of development, the function to re... See more...
Hey - Sorry for the really delayed response. I have been out of comission lately for working on this utility. As for your questions. 1. At the time of development, the function to remove virtual hard disk was not populated by the API off of VC. That Managed object was only available hitting the ESX Server directly. I haven't tried to see fi that object was available thru vc lately, but my guess is that it is not if you tried it and it failed. 2. You could get it to remove all the RDMs from a virtual machine. I have it setup to be selective in case your VM has RDMs from multiple arrays,, and lets say you work for EMC and wanted to use this utility.... it could help you. You'd just need to populate the array with all the rdms rather than asking for them to be matched with teh WWPNs... I could prob get to it, but my lab is in shambles after neglect for a period....
Happy to help!
No problem Jindi, I attached a PNG graphic with some notes on it if you want to look at that. If you would, I'd appreciate it if you gave my response the Correct Answer or Helpful answer f... See more...
No problem Jindi, I attached a PNG graphic with some notes on it if you want to look at that. If you would, I'd appreciate it if you gave my response the Correct Answer or Helpful answer flag.
You could add an If statement in there to only run the command if it sees that datastore. And add that -confirm:$false like you said. Get-VmHost | Foreach-Object {if(Get-Datastore -V... See more...
You could add an If statement in there to only run the command if it sees that datastore. And add that -confirm:$false like you said. Get-VmHost | Foreach-Object {if(Get-Datastore -Vmhost $_ | where {$_.Name -eq $dsname}) {Remove-Datastore -Datastore (Get-Datastore -Name $dsname) -VmHost $_ }}
Sean, You might want to toss out some information on what exactly you're trying to do. If you're deleting a datastore that is visible to more than one host, then yes, the second host ... See more...
Sean, You might want to toss out some information on what exactly you're trying to do. If you're deleting a datastore that is visible to more than one host, then yes, the second host will error out since it hasn't rescanned. If you're like most SAN / NFS / iSCSI type setups, then you have the same datastore on all hosts in a cluster. If that is the case, then you just need to grab one host per cluster and remove the datastore, then refresh the storage on the hosts in the cluster. Otherwise if you have your storage setup differently, or with local datastores that would change it quite a bit. if you need to rescan, Get-Vmhoststorage -RescanAllHBA will be your friend.
JindiJee, This one should be able to do what you're looking for. Albeit this generates two CSVs since it really is two seperate reports you're looking for. Unless you're trying to print t... See more...
JindiJee, This one should be able to do what you're looking for. Albeit this generates two CSVs since it really is two seperate reports you're looking for. Unless you're trying to print the Datastore for the VM on the same line as the VM, that would be a bit different. This script builds a hash table which is a nice way of then shoving it into a CSV. You could trim this one up to make it more "one-liner" , but should assist in getting the picture across. Let me know if you get this working or if it doesn't do what you're thinking. The first one builds two Hash tables and slaps them into two CSVs. If you want to see your Datastores seperate from your VMs. The second script will add the datastore to the first hash table and list it with the VM. This one is not setup to handle VMs with disks on more than 1 datastore. That can be done with some tweaking. Guess I was bored... I added the 3rd which will add a line in your CSV for each Datastore associated with a VM... This means your VM can be listed more than once, but it will list each DS. This should give you a good idea on how you can play with exporting to CSVs. I like the hash table setup.
Solved in previous post.
I have been able to get the following script functioning, although I would not say consistently. I am having problems. It did delete the VMDK and RDMPVMDK for the first two RDMs in my test VM, th... See more...
I have been able to get the following script functioning, although I would not say consistently. I am having problems. It did delete the VMDK and RDMPVMDK for the first two RDMs in my test VM, then errored out. I will prob post this into the SDK forum... guessing it is more related to that area. I just took the previous persons "remove-hd.ps1" and modified it to use the new VirtualDiskManager and DeleteVirtualDisk_Task feature .............and where is the remove-harddisk cmd-let? ____ NOTE During test,... the script will go through the foreach twice. the $name variable, which houses $dev.backing.filename shows up null after two iterations. __Final Note I got it to work. From Remove-HD.ps1 i did the following. Changed the deletDatastorefile FileManager task to DeleteVirtualDisk_Task of the VirtualDiskManager. Then I took the Get-view command out of the function ( it would error out after two iterations.) If anyone cares for the code I will upload it.
Looks like the remove-HD script uses this method of the fileManager object to remove the VMDK... which doesn't remove the RDMP.VMDK DeleteDatastoreFile_Task ... See more...
Looks like the remove-HD script uses this method of the fileManager object to remove the VMDK... which doesn't remove the RDMP.VMDK DeleteDatastoreFile_Task I'm thinking this one of the VirtualDiskManager object might take care of that issue.... if i can stumble my way through the SDK and fix it i'll post it. DeleteVirtualDisk_Task Apparently the VirtualDiskManager is null on my system when i go to use it. VC 2.5u3, ESXi 14xxx. VIToolKit 1.5 I have to say it... WHERE IS THE REMOVE-HARDDISK CMDLET?
I'm attempting to script the removal of Raw devices. I'm looking to reverse the method I had of creating new RDMs by mapping UUID to the vmhba number. I guess i'm in wonder why there is no remo... See more...
I'm attempting to script the removal of Raw devices. I'm looking to reverse the method I had of creating new RDMs by mapping UUID to the vmhba number. I guess i'm in wonder why there is no remove-harddisk cmdlet... So I am working on the remove-HD code posted. I am running into an issue where the script partially works. My test environment has 4 RDMs. It removes two of them from the VMX and removes the .VMDK file, but doesn't remove the RDMP.VMDK file. The other two remain untouched but the tasks in powershell complete as if everything were fine. The tasks in VC error out with the below information. Here is the thread where i posted this question first, but really this is a new unanswered question and wanted to offer points to the correct answer. screen shot of datastore showing the RDMP files the two RDMP files were previously not visible since the .VMDK geometry file was there. If anyone has some knowledge on how i can tweak remove-HD to accomplish removing the RDMPs and any hints on why it might fail in a foreach after two loops.
Hey LucD or others... I am looking to get the remove-HD function working with physicalmode RDMs. It will remove the .vmdk file, but leaves the rdmp.vmdk file, then error out. I can a... See more...
Hey LucD or others... I am looking to get the remove-HD function working with physicalmode RDMs. It will remove the .vmdk file, but leaves the rdmp.vmdk file, then error out. I can attach screen shot tomorrow when I'm back in the office. Hopefully someone here might know the answer on that... I will start looking around the Views to see if there's anything I can see. Ryan _____________________ Created NEW THREAD __________________ http://communities.vmware.com//thread/198055?tstart=0
You can try this script i built for my place. We're heavy on RDMs so I emphasize getting the UUIDs as well.... But the WinDiskNum translates to the Windows Disk Number in Disk Managem... See more...
You can try this script i built for my place. We're heavy on RDMs so I emphasize getting the UUIDs as well.... But the WinDiskNum translates to the Windows Disk Number in Disk Management on the grey box saying "Disk 1" etc. So you should be able to see Disk 1 and then the VMDK. Let me know if that works
Toss my hat in, 150 ESXi hosts. Would like to manage with VIMA from one if possible.
Thought I should add... That the VIToolkit 1.5 update now skips scsi address x:7 when batching adding disks using New-Harddisk in a Foreach loop. I haven't tested the next adapter after 1... See more...
Thought I should add... That the VIToolkit 1.5 update now skips scsi address x:7 when batching adding disks using New-Harddisk in a Foreach loop. I haven't tested the next adapter after 15 devices yet. -Thanks Carter
This is a script header I built when I realized that most scripts I wrote would go against an array "$vmhosts" containing host objects. This could be one host, a cluster's hosts, or all hosts i... See more...
This is a script header I built when I realized that most scripts I wrote would go against an array "$vmhosts" containing host objects. This could be one host, a cluster's hosts, or all hosts in a virtual center. If you want to write a script that will take ESX host objects in an array $vmhost, just put your Foreach Loop or what have you at the end of this text file. Your script will prompt you for Host, Cluster, Or VC.. then grab the appropriate hosts and shove them in to the array $vmhosts. I'm sure it can be improved on nicely or prettied up.. but it does the job for me for now. I thought i'd share it as I have used it a lot.
PSC_INS I don't currently have a great testing environment to go through it. But you need to highlight A2 on the second worksheet... in the New-VM commands,,, you have to add the -t... See more...
PSC_INS I don't currently have a great testing environment to go through it. But you need to highlight A2 on the second worksheet... in the New-VM commands,,, you have to add the -template parameter then specify a new column in the spreadsheet labeled template. new-vm -template $f.template I've made the changes to this one, you can test it out. Like i said, I am not direclty able to test... if I can i will.
Carter I finally got around to looking for the functions to add the scsi controller. Of course i found LucD's from another thread. I ran a counter that at count 15 runs the add-scsico... See more...
Carter I finally got around to looking for the functions to add the scsi controller. Of course i found LucD's from another thread. I ran a counter that at count 15 runs the add-scsicontroller function, sleeps for 5 seconds, then add's a new disk, then counts greater than 15 and adds more. This allows me to get beyond the 15 disk limit and adds the disks as 1:x. I have to do it with the VM powered off, then correct the x:7 devices to not conflict with the controller. This is good for me now. Reduces my manual time by several minutes per vm. Thanks for the suggestion, and Thanks LucD again... for the code. Ryan