VMware Cloud Community
nt29
Contributor
Contributor
Jump to solution

Attached existing disk to a Vm already created

Hi

I didn't found how to attached a existing disk on a vm already in use with Powercli

My disk is in the datastore Vol7_Cl3 folder Vm3 and I want to attach it to the vm Vm3

thanks a lot

Nicolas

0 Kudos
1 Solution

Accepted Solutions
SupreetK
Commander
Commander
Jump to solution

Looks like there is a typo in the datastore name. Actual name is VD-VM1_v002 whereas, you have used VD-VM1-v002.

Cheers,

Supreet

View solution in original post

0 Kudos
6 Replies
LucD
Leadership
Leadership
Jump to solution

Use the New-Harddisk cmdlet with the DiskPath parameter.

See Example 3


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

nt29
Contributor
Contributor
Jump to solution

Hi, i see the example 4, but i didn't arrive, here what i have done

Capture where my disk is:

disk_temp.PNG

Here what i have done:

PS C:\Users\NT.OCAP> New-HardDisk -VM $vm -DiskPath "[VD-VM1-v002] TEMP/IPEARS_1.vmdk"

New-HardDisk : 12/09/2018 09:30:27 New-HardDisk No matching datastore found.

Au caractère Ligne:1 : 1

+ New-HardDisk -VM $vm -DiskPath "[VD-VM1-v002] TEMP/IPEARS_1.vmdk"

+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : ObjectNotFound: (:) [New-HardDisk], VimException

    + FullyQualifiedErrorId : Client20_VirtualDeviceServiceImpl_NewVirtualHardDisk_DatastoreNotFound,VMware.VimAutomation.ViCore.Cmdlets.Commands.VirtualDevice

   .NewHardDisk

0 Kudos
SupreetK
Commander
Commander
Jump to solution

Looks like there is a typo in the datastore name. Actual name is VD-VM1_v002 whereas, you have used VD-VM1-v002.

Cheers,

Supreet

0 Kudos
LucD
Leadership
Leadership
Jump to solution

The error message seems to state that your datastorename is not correct.

Can you check?


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
nt29
Contributor
Contributor
Jump to solution

Sorry that what a typo error,

I have check it ....

Thanks a lot, it work

Nicolas

0 Kudos
nt29
Contributor
Contributor
Jump to solution

thanks for you command

Have a nice day

Nicolas

0 Kudos