Skip to content

Conversation

@tenthirtyam
Copy link
Contributor

@tenthirtyam tenthirtyam commented Dec 15, 2025

Description

  • Added 'device.sata.add' command to add SATA controllers to virtual machines.
  • Registered 'device.sata.add' in the 'govc' CLI entry point.
  • Updated documentation and test suite to cover the new command.

Closes: #3780

How Has This Been Tested?

make govc-test and manually.

govmomi on  govc/add-device-sata-add [!?] via 🐹 v1.25.5 
➜ vm="test-sata-$(date +%s)"
govc vm.create -on=false \
  -pool '/DC0/host/DC0_H0/Resources' \
  -net 'VM Network' \
  "$vm"

govmomi on  govc/add-device-sata-add [!?] via 🐹 v1.25.5 
➜ echo "== before =="
govc device.ls -vm "$vm" | egrep -i -- 'ahci|sata' || true

== before ==

govmomi on  govc/add-device-sata-add [!?] via 🐹 v1.25.5 
➜ id=$(govc device.sata.add -vm "$vm")
echo "added: $id"
govc device.info -vm "$vm" "$id"
added: ahci-204
Name:       ahci-204
  Type:     VirtualAHCIController
  Label:    ahci-204
  Summary:  ahci-204
  Key:      204
  Devices:  

govmomi on  govc/add-device-sata-add [!?] via 🐹 v1.25.5 
➜ echo "== after =="
govc device.ls -vm "$vm" | egrep -i -- 'ahci|sata' || true
== after ==
ahci-204      VirtualAHCIController      ahci-204

@tenthirtyam tenthirtyam self-assigned this Dec 15, 2025
Copilot AI review requested due to automatic review settings December 15, 2025 17:42
@tenthirtyam tenthirtyam force-pushed the govc/add-device-sata-add branch from 42c817e to 24ae76c Compare December 15, 2025 17:44
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a new device.sata.add command to govc for adding SATA controllers to virtual machines.

  • Implements the device.sata.add command with support for adding SATA (AHCI) controllers
  • Registers the new command in the govc CLI and updates documentation
  • Adds test coverage for the new SATA controller functionality

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
cli/device/sata/add.go New file implementing the SATA controller add command
govc/main.go Registers the new SATA device package
govc/USAGE.md Documents the new device.sata.add command
govc/test/device.bats Adds test case for SATA controller functionality

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@tenthirtyam tenthirtyam force-pushed the govc/add-device-sata-add branch 2 times, most recently from 9db8ed8 to 19d4f7f Compare December 15, 2025 18:03
spacegospod
spacegospod previously approved these changes Dec 16, 2025
Copy link
Collaborator

@spacegospod spacegospod left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

- Added 'device.sata.add' command to add SATA controllers to virtual machines.
- Registered 'device.sata.add' in the 'govc' CLI entry point.
- Updated documentation and test suite to cover the new command.

Signed-off-by: Ryan Johnson <[email protected]>
Comment on lines +61 to +64
err = vm.AddDevice(ctx, d)
if err != nil {
return err
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: consider changing this to if err := vm.AddDevice(ctx, d); err != nil { ... }?

@tenthirtyam tenthirtyam merged commit 2a3fd10 into main Dec 16, 2025
12 of 13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add govc command to add SATA controller

4 participants