Add the new SCSI controller and new drive - powershell SDK

Hi all

I'm trying to add the new disc of paravirtual to my VMs. There are two types of virtual machines in the environment; a Paravirtual controller attached and others are without controller; so my task is to set the new drive of paravitual using powershell SDK.

So far I am successful with my code if the controller is already present but the script fails when I try to attach the controller. with the error.

RecommendDatastores: The method call failed because [System.Object []] contains a method named "RecommendDatastores".

C:\NodeDeployment\Inprogress\Add_newPVScsiDisk.ps1:111 tank: 44

+ $generatedkey = $SRM. RecommendDatastores < < < < ($storageSpec)

+ CategoryInfo: InvalidOperation: (RecommendDatastores:String)], RuntimeException

+ FullyQualifiedErrorId: MethodNotFound


I know that this script is not good enough to post here because it is an initial draft, but in the script attached please help me with the present part-

The Script requires a csv with VMname entry; Disksize to be attached and store cluster data

else {
            Write-Host "Paravirtualized SCSI Controller Not Found in $vmname.. Trying to add new scsi controller and additional Hard-disk..."
            $NewSCSIDevice = New-Object VMware.Vim.VirtualDeviceConfigSpec
            $NewSCSIDevice.operation = "add"
            $NewSCSIDevice.device = New-Object VMware.Vim.ParaVirtualSCSIController
            $NewSCSIDevice.device.key = -222
            $NewSCSIDevice.device.busNumber = ($allScSiController.BusNumber.Count)
            $NewSCSIDevice.device.sharedBus = "noSharing"
            $NewDiskDevice.device.controllerKey = -222
            $NewDiskDevice.device.unitNumber = 0
            $NewDiskDevice.device.capacityInKB = ($diskSize * (1024 * 1024))
            $storageSpec.configSpec.deviceChange += $NewDiskDevice
            $storageSpec.configSpec.deviceChange += $NewSCSIDevice
            $generatedkey = $SRM.RecommendDatastores($storageSpec)
            $key = $generatedkey.Recommendations[0].Key
            $SRM.ApplyStorageDrsRecommendation_Task($key)
}

OK I have it myself; I guess busnumber was the problem. He converted to INT working like charm...

Now, I have to work with storage Drs IE. with the ReconfigureVM_task method. hoping that will work also...

else {}

[int] $busnumber = $allScSiController.Count

Write-Host "paravirtualized SCSI Controller not found in $vmname... Try to add the new controller scsi and extra hard drives... »

$NewSCSIDevice = new-Object VMware.Vim.VirtualDeviceConfigSpec

$NewSCSIDevice.operation = 'Add '.

$NewSCSIDevice.device = new-Object VMware.Vim.ParaVirtualSCSIController

$NewSCSIDevice.device.key = - 222

$NewSCSIDevice.device.busNumber = $busnumber

$NewSCSIDevice.device.sharedBus = "noSharing".

$NewDiskDevice.device.controllerKey = - 222

$NewDiskDevice.device.unitNumber = 0

$NewDiskDevice.device.capacityInKB = ($diskSize * (1024 * 1024))

$storageSpec.configSpec.deviceChange += $NewDiskDevice

$storageSpec.configSpec.deviceChange += $NewSCSIDevice

$generatedkey = $SRM. RecommendDatastores ($storageSpec)

$key = $generatedkey. Recommendations [0]. Key

$SRM. ApplyStorageDrsRecommendation_Task ($key)

}

---

Concerning
Sanshis

Tags: VMware

Similar Questions

  • Adds the second SCSI controller &amp; change the SCSI ID numbers?

    Hello

    I have a need to add a couple of SCSI drives to my VMware Workstation VM (v10), and these drives need the SCSI ID of 1:x (i.e. who need a second controller).  Could someone give me some advice on the .vmx necessary parameters for this?  I looked at a few posts - which says that I must just add the readers in the UI, then change the SCSI ID in the .vmx... but it does not work.

    Any help is appreciated...

    Cheers, James

    You will need to should not change at all .vmx file to achieve this.

    Once you've added the hard drives on the virtual machine, click the Advanced button in the lower right of the settings of the Virtual Machine window.  The Virtual Device Node labeled popup should allow you to move the virtual hard drives SCSI 1:0, which will give you a second card SCSI.

    --

    Darius

  • cannot add the new hard drive more than 2 TB on vsphere upgrade 5

    can someone give me a clue? I can't add new greater than 2 TB drive to my vm on my upgraded vsphere 5.0. My data store is 6 TB and already read by vsphere... I create new virtual machine and add the new drive, but it limits again just 2 TB when I change 4 TB, the error message will appear. I recently added my datastore LUN with VMFS5 version. is there a any mistake I made? Please help me this problem is so frustrating me... i need to create new disk 6 TB to my new file server

    Hello.

    You will need to use a RDM in physical Compatibility Mode to achieve. As weinstein5 said, a VMDK cannot be greater than 2-to-512bytes. You can use the OS to spread over several 2 TB-512bytes VMDK, if that's what you really want.

    Good luck!

  • Add the new hard drive into the data store in ESXi 4.1

    Hi all

    I got ESX 4.1 installed on the Dell server, and I have 3 virtual machines on a data store.

    I added a new 500 GB scsi hard drive to the server,

    and I need to add it to the datasore or create a new...

    How can I see this new hard drive? and add it to the data store?

    Waiting for your help.

    concerning

    Abrams

    Oracle system engineer

    Abrams,

    That's all I can help you.  These instructions are based on the Perc 5 / i controller, which I think you have on our system.  You have not specified the server so I just assumed that this is so.

    1. unscrew the hot spare that you just made.  Follow this link from Dell.
    http://support.Dell.com/support/eDOCS/storage/RAID/PERC5/en/UG/HTML/chapterh.htm#wp1061343

    2 follow the link for the installation of virtual disks - http://support.dell.com/support/edocs/storage/RAID/PERC5/en/UG/HTML/chapterh.htm#wp1069357

    This link has three steps to void, skip the step on "spare parts of designate hot."
    a. create the virtual disks and select virtual disk options.   -Online steps to create another disk group and add the new disk to the disk group.
    (b) designate the drives hot spares (optional). =>, YOU CAN SKIP THIS STEP
    c. initialize virtual disks. -online must do.  just do not initialize the incorrect disk.

    After the step #2 c, you should be able to access the drive in ESXi or command-line (list of nmp esxcli devices).

    And no, you cannot add this manaully until do you step #2 above which is to define the disk group, creating virtual disks and initialize the virtual disk.

    Good luck.

  • Add to that a drive to RAID5 ESX didn't add the new space?

    I need more space for the ESX Server so I add 4th same drive size to existing RAID5, I had 3 discs 264.50 I now see in open manage once I add the 4th car total 408 GB is 260 something in ESX under storage always fresh watch 46 GB 264.50 GB of space even old information and restarted ESX even question? How can I add the new space of ESX?

    Thank you

    Always backup your virtual machines if you are not sure

    For me, because I am familiar with the disk partitioning, I would just to repartition the disk.  Depends on your comfort level.  method 1 is the "safest".

    -Matt

  • My computer with two hard drives and 2 starting systems has the car crash in the solid state. When I got the new drive and tried to restore from time capsule, I lost some data. How can I see what backups are on the time capsule? My laptop is also backed u

    My computer with two hard drives and 2 starting systems has the car crash in the solid state. When I got the new drive and tried to restore from time capsule, I lost some data. How can I see what backups are on the time capsule? My laptop is also saved to the time capsule. Everything is in 'Data' when I look through the Airport utility. I think that the information that I've lost are still there since I was a Capsule 3 to.

    Time Machine backup to a sparsebundle.

    The sparsebundle will use the share name of computer. So, it should be obvious who is your Macbook and that is your Macpro.

    Open the sparsebundle in Finder and keep open the subfolders until you get to the backup of each separate hard drive...

    You has of course set the exclusion in Time Machine?

    By default, Time Machine will exclude your second drive unless you have included it. Did you?

    Once you get to this level during the backup, you can do a full restore manually whenever you want.

  • How to import bookmarks to an old win / win wqhere FF installation failed. New victory and FF install the new drive. Old files

    Old installation of Windows and where winning FF stopped working. Have reinstalled on the new drive win and FF and import bookmarks from the old install on the old disk. The files are always accessible. None of the listed options explain another FF FF import that create a new profile that will not work in this case.

    Just as a reference, when you explore your old hard drive, will seek you:

    E:\Users\yourusername\AppData\Roaming\Mozilla\Firefox\Profiles

    (the drive letter may vary)

    If Windows hides the AppData folder on the old disk, you can disable hide files and folders: http://windows.microsoft.com/en-us/windows/show-hidden-files

    Then you can get off and find the folder bookmarkbackups containing .jsonlz4 files.

  • How to add the 'new tab' button next to the last tab?... I use version 9.0.1. and they are missing and I can't find how to add.

    I got the new tab next to open tabs button, but with a recent update of Firefox, the tab button disappeared. Went through all the help points, but how do I add the new Help tab is not listed. The only way to open a new tab is manually using the buttons on windows/t or opening the file and choosing the new tab.

    Hello

    It could be that he is hidden behind another icon. Please try this: right click on the empty space after the last tab and Customize.... With the mini window open, you can move the other toolbars and icons to check if the new tab button is hidden. You can also check inside the mini window customize the icon named new tab or click Restore Default Set that will be hopefully restore back. Please note that if nothing is uninstalled or disabled when you click on restore by default, you will have to redo all changes to manual/personal toolbar.

    Customize toolbars

  • What does offline or online when you say: servicing an image Windows 7 to add the new application online? and what is the difference between the online and offline maintenance image

    What does offline or online when you say: servicing an image Windows 7 to add the new application online? and what is the difference between the online and offline maintenance image

    Your question it will be better answered in forum Windows 7 installation and deployment on TechNet:

    Windows 7 installation, Setup, and Deployment Forum

  • Xps420 - how to install a 2nd HD and make the new drive the boot drive?

    I bought a new and more large hard drive for my system XPS420 almost nine.  I want to install the new disk, create two partitions as the original (C & D (reprise)) drive, copy all of the original drive to the new drive and make the new drive the boot drive, with the original drive becomes a secondary additional storage drive.  I understand how to use the Vista disk management feature to create the partitions and format the new drive. After that, what is the best way to proceed?


  • Should I partition the new drive?

    I installed a new hard drive of 320 and then install Windows XP without the disk partitioning. I think it was a mistake since I have a number of questions: i.e., no message of paging to the startup file and the computer is not shut down correctly, all turn off. I need to create a partition?

    In addition, my computer only recognizes the former status of 80 GB from my old drive.

    If you need to upgrade the BIOS then do.  Also, make sure that the rider of the disc is correctly defined (master/slave/Cable Select), if it is the only drive on the IDE controller, you can set it to master.

    The Windows XP Setup program took care of partitioning, there is no need to use other tools of preparation of partitioning or disk when you install Windows XP, Setup will give you a list of available disks and you ask what disk and partition you want to install Windows, it will load if necessary partitioning.  If you select a new disk that has not been initialized or prepared you will be asked and asked if you want to create a partition, Windows cannot be installed on a disk at least a primary partition, the installation program will create the partition before it can go further, you could not install Windows on your new drive if she had no partitions the Setup program creates the partition that invited you to do when you have Windows installed on your new drive.

    Is the new drive the only hard drive in the computer when you installed Windows XP?  The "No paging file" error is usually caused by incorrect drive letter assignments, glitches or mix ups installation can cause problems with possibility of drive letter.  When you install Windows, you must ensure that there is no external device connected to the computer other than the keyboard, mouse and monitor, make sure that there is no USB drives don't, sticks of flash, cameras or printers with readers card connected to the computer, disconnect everything except the keyboard, mouse and monitor.  Having poorly adjusted riders drive can also cause problems, for example have a drive as a slave when it is the only drive on the controller may cause problems or give unexpected results during the installation of Windows.

    John

  • Add the new database

    I have a 2 rac cluster

    rac1 server with 2 network cards

    eth0, eth1

    rac2 server with 2 network cards

    eth0, eth1

    We have completed the installation of rac cluster

    the database is rac

    Now the manager who comes to me and says

    I want you use the environment above and create another database QA

    of course I can easily create a single instance of QA Manager

    said... I want allows you to create a car QA database

    How do I do this with the same material?

    Imagine the size of the data set is 20 GB and data used are 10 GB

    the sys admin says if you want it can create discs more than necessary.

    How to use two servers to create another data base rac called QA

    I can't go to the Manager and say... BUY a material more

    What are the minimum requirements and that is the necessary steps.

    Of course I don't want detailed step by step guide

    just a preview...

    You can use dbca (Database Configuration Wizard) to create multiple databases in the same installation of RAC cluster.

    But first think how big disks (data, Redo, Arch) (grid Infra (clusterware) disc can be same for all databases) you need this new database and add these new drives for servers and ASM if you use.

    And then create a new database with dbca.

  • Cannot transfer Time Machine backups on the new drive

    I store my backup Time Machine on a Seagate 1.5 TB drive when the drive starts giving errors.  I had files on this computer and was able to transfer all except for 2 who were on unreadable sectors.  Fortunately, one of these files was an older archived version that I could afford to give up and the other was a temporary file in the photo library and since all other items were okay, I think I'm good.

    The problem came when I tried to transfer my Time Machine backup of 800 GB for a new disk.  When I copy and Exact-paste (cmd-opt-shift-v) the Backups.backupdb to the new drive, it gets the extent of November 23, 2015 and then dies because reports of the Console to the system, it gets an IO error when you try to read:

    /Library/SystemMigration/history/migration-245250B6-4F52-4FBB-BD61-546A8C19CCD5/ QuarantineRoot/private/var/db/dyld/dyld_shared_cache_x86_64

    in the relevant backup.  And because it's an IO error it simply abandons the whole process so I have no backup from November 23, included, for now.

    Because the disc is unstable, I wasn't able to use disk utility to make repairs on it.  The disc is what is and I have to deal with the mess, that I do not have the disorder, that I would have.

    I tried to manually place the missing files in the database, but the operating system will not let me.  I want to just copy my backup / OS X stop abandonment and be more like Windows and give me the options to "try again" or "fail" instead of just quitting!  I mean, why should I lose my backup all hierarchy of 23 November and beyond, simply because you cannot read a file, a file that I could simply replace in the backup of the current version or you can just ignore it.

    I tried to copy files on and setting xattr on them to be backup items, but they are wrong.  I tried chflags parameter to make the writable directory, but it does not work.  I can't copy the missing files to fix my archives.  Help.

    Please, don't try to transfer backups of a failed drive. Placing the disk aside until you don't know no longer you need the data, then delete and recycle. Start a new backup set on the new drive. For more security, you always have more than one backup.

  • Add the new entry name of folder of bookmarks does not

    (There's a reason I'm fool the previous thread on this subject, as well as my response to this: I couldn't find a way to add FireFox 10.0.2 to the tags of the thread.) If the thread tags may be edited/added, I wouldn't highlight problems with FireFox 10.0.2 by launching this new thread.)
    RE add new bookmarks folder, can not enter the name of the new folder:

    I am now having this problem with FireFox 10.0.2, 11/03/2012

    When I click on add a folder, a new folder appears in the tree view and the folder name field is highlighted for the entry. But when I start to type characters in the field, I can only type 1 or 2 characters at the most seized stops accept input. I then go to the bookmarks menu, locate the new folder, right-click it, click Properties and complete the registration of the name of the folder.

    At worst, the folder name field will cease to accept entry as soon as I type the first tank, in which case the name of the folder will remain as "new folder." I find the new folder in the bookmarks menu to change the name, as described above.

    It is very annoying because it adds a number of additional steps just to add a new folder in the bookmarks menu. Add the new folder through the "Show all bookmarks" and navigate through the folder hierarchy are an alternative workaround, but that records all the steps.

    Any ideas or solutions?

    Hi John99,
    It has worked well in Mode without failure. Thanks for the suggestion!

    I'm going offline a bit to understand what add-on, plugin, etc., could be causing it. In the meantime, I have marked your suggestion to use Mode safe as useful so that anyone else coming here could get the clue.

    I should probably drop another line in the thread for the guy who in (or has been) using FireFox 7...

    I'll post my results if I can understand it.

    UPDATE:

    I went after any add-on which had nothing to do with bookmarks.

    It was the first add-on I tried, SortPlaces 1.9.1 that automatically sorts bookmarks in various ways according to the parameters. When I disabled it, the problem disappeared.

    I re-enabled it and checked the options to see if I could understand why she was stop to add the new folder. In the 'Options' tab, there is a time limit for how long interval SortPlaces will wait before you sort a bookmark changed or added. It was set to 3 seconds.

    It is not long enough for old men by typing the new name of folder. I put it in 10 seconds. Then, I created a new folder of bookmarks and start typing a name long nonsense, while I looked at the clock. After that 10 seconds it stopped accepting the entrance, right on the mark. What this hidden for me earlier, it was that when he stops to accept input, you don't see the new folder to place in the position of sorting on the menu add a folder. You will see that if you expand the folder later. It's probably why I didn't connect the two.

    Anyway, problem solved. I'm leaving the delay to 10 seconds. If I ever need to be longer, I'll just increase it.

    Thanks again for the suggestion of Mode safe and enjoy the next season of mud.

    Alan Mintaka

  • Satellite L655-1GN - failed to install the new drive HARD original recovery image

    Hello

    Just had to buy a new hard drive and put the latter with the former. I already checked that he was the same size and SATA as the original hard drive. When I tried to start a new installation of the operating system from the recovery disk (that I bought the Toshiba provider in my country - MAFIL), the boot option was not available.

    MAFIL representative told me that the recovery disks only for the reinstalliation of the OS on the original drive, but are not suitable to install a fresh copy again. So, how can I install my Win7 64-bit, with all settings on the new drive and Toshiba apps?

    Thank you
    Tomer

    On many models of laptops different change HARD drive or upgrade can be done by the owner of the laptop and after doing this, you can install recovery image using the disc of recovery without any problem.

    I did several times on different models of Toshiba laptops. This works.
    I really don't understand how someone can give you this information.

    By default the BIOS settings, restart your machine and press F12 at startup. When the boot menu appears on the screen put the recovery disk ODD news, select CD/DVD as a boot device and press ENTER.
    What happens when you do this?

Maybe you are looking for