Sha256: c82cacd2738f64a0b2fc75a9bb88c7354680a5d966226f379561f55f0558ca2b

Contents?: true

Size: 601 Bytes

Versions: 4

Compression:

Stored size: 601 Bytes

Contents

param (
    [string]$VmId = $(throw "-VmId is required."),
    [System.IO.DirectoryInfo]$DiskPath = $(throw "-DiskPath is required."),
    [Int32]$DiskSize = $(throw "-DiskSize is required.")
)

try {
    $vm = Get-VM -Id $VmId -ErrorAction "stop"
    Write-Output $DiskPath.FullName

    # create new disk
    # converting GB to Byte
    NEW-VHD -Dynamic $DiskPath.FullName -SizeBytes $($DiskSize*1073741824)
    # attach new disk to VM
    ADD-VMHardDiskDrive -vmname $vm.Name -path $DiskPath.FullName -ControllerType SCSI
}
catch {
    Write-Error-Message "Failed to create disk or attach to VM "
}

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
vagrant-subutai-7.0.10 lib/vagrant-subutai/packer/script/create_disk_and_attach.ps1
vagrant-subutai-7.0.9 lib/vagrant-subutai/packer/script/create_disk_and_attach.ps1
vagrant-subutai-7.0.8 lib/vagrant-subutai/packer/script/create_disk_and_attach.ps1
vagrant-subutai-7.0.7 lib/vagrant-subutai/packer/script/create_disk_and_attach.ps1