I have a VM with 2 unused disks, 0 and 1 .. and they both scsi.
how do I use qm to set them to sata and set Async IO to native?
thanks
how do I use qm to set them to sata and set Async IO to native?
thanks
qm set "$vmid" --scsihw virtio-scsi-single --"$DEVICE"3 "$storage":vm-"$vmid"-disk-3,aio=native,iothread=1
$endpoint="nodes/$node/qemu/$nextVmid/config"
$URL="https://$phost/api2/json/$endpoint"
$response = Invoke-RestMethod -Uri $URL -Headers $pHeaders
$newConfig = $response.data
$unusedEntries = $newConfig.PSObject.Properties | Where-Object { $_.Name -like "unused*" } | sort name
# Add the unused disks back as SATA
foreach ($entry in $unusedEntries) {
$diskPath = $entry.Value
$sataDevice = "sata$nextSataNum"
# Build the command and execute via SSH
$cmd = "qm set 703 -$sataDevice $diskPath,aio=native"
$SSHStream.writeLine($cmd)
$SSHStream.Read()
# Increment for the next disk
$nextSataNum++
}
We use essential cookies to make this site work, and optional cookies to enhance your experience.