Skip to content

Add the SCVMM Lab on AWS blueprint - #128

Open
mbomb67 wants to merge 24 commits into
mainfrom
scvmm-aws-lab
Open

mbomb67 wants to merge 24 commits into
mainfrom
scvmm-aws-lab

Conversation

@mbomb67

@mbomb67 mbomb67 commented Nov 4, 2026

Copy link
Copy Markdown
Owner

Summary

Adds SCVMM Lab on AWS (blueprints/BP-9zp8udce). It builds an SCVMM 2025 test lab: two or more Windows Server 2025 Hyper-V hosts on nested-virtualization EC2 instances in a failover cluster, shared storage over iSCSI from a gp3 volume, and an SCVMM server that manages the cluster. Every server joins an existing AD domain. A build takes about 43 minutes.

New content:

  • Build plug-ins: Prepare SCVMM Lab on AWS (OHK-q6fb9833), Install SCVMM (OHK-8f9o1496), Configure Hyper-V Hosts (OHK-8ioy2cbi), Create Hyper-V Cluster (OHK-77f19kly), Add Hyper-V Cluster to SCVMM (OHK-ive3ka22).
  • Teardown: Remove Hyper-V Cluster Object (OHK-kzb6pzzu) destroys the cluster with Remove-Cluster -CleanupAD. If that leaves the protected computer object or the cluster's DNS record behind, it deletes them itself.
  • Shared module scvmm_lab (SHM-dpj24dfj): guest steps as polled scheduled tasks, long scripts uploaded in pieces under the WinRM command-line limit, and the EC2 calls.

Changes to existing content:

  • Join Windows Server to AD Domain (HPA-jjp1vlfi, OHK-9oqn6pur): renames the guest before joining, and retries the rename while the domain controller is busy.
  • Delete Windows Computer Object from AD (HPA-q181uofy, OHK-bkoau0j8, SHM-gcba1u31): also deletes the DNS records the computer object owns. PKG-nf407lm5 goes to 1.2.0.

Tested live

On a CloudBolt 2026.3 appliance with AWS and an AD domain, through the MCP testing tools:

  • Two orders built in one uninterrupted run each (ORD-p8ofojj7, ORD-mpxmpx3q), ending WARNING. SCVMM managed the cluster with both nodes responding. The warning is SCVMM failing to copy its DHCP server extension over BITS, which the README covers.
  • Their deletes (JOB-hnqur5j1, JOB-5o43l9t9) destroyed the cluster and deleted its computer object. The second confirmed no cluster DNS record was left. The servers' computer objects and DNS records were deleted.
  • Earlier labs exercised every build item through pause and resume, the DNS name check, and DNS cleanup on delete.

Not yet run live: failing the core group over to another host, and the teardown's fallbacks for a cluster whose creation failed partway (deleting a protected computer object from a host, and deleting the cluster's DNS record). The README lists them.

After merging

Sync blueprints/BP-9zp8udce, orchestration_actions/HPA-jjp1vlfi and orchestration_actions/HPA-q181uofy from main, then restart the job engine so it loads the updated shared modules.

🤖 Generated with Claude Code

mbomb67 and others added 24 commits November 2, 2026 11:55
Builds an SCVMM 2025 test lab on AWS in an existing domain: two or more
nested-virtualization Hyper-V hosts in a failover cluster, iSCSI shared
storage from a gp3 volume on the SCVMM server, and SCVMM managing the
cluster. Five build plug-ins and a CNO teardown share the scvmm_lab module,
which runs guest steps as marker-reporting PowerShell or polled scheduled
tasks (the domain account's steps sign in as that account) and makes the
EC2 calls through the AWS handler, adding NestedVirtualization to the
signed request because the appliance's botocore predates it.

SCVMM media comes from File Archives (SCVMM_2025.zip, unchanged); SQL
Server 2022 Developer and the Windows ADK download from Microsoft. Not yet
run on an appliance; the README lists what is untested.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…nvironments enabled

The tier's OS build limits the environments it offers, so enabling all of
them leaves only the environments that carry the build.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Add-Computer -NewName joins the computer and then renames it. In testing the
SCVMM lab's third server joined, but its rename returned 0x200e (The
directory service is busy) while the other two servers were restarting and
updating their own objects on the same domain controller. The join action now
checks whether only the rename failed and retries it with Rename-Computer up
to five times, 15 seconds apart, and the rename-only path gets the same
retries.

Also document the Quantity parameter the SCVMM lab's host tier needs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Replace the rename retry with Microsoft's documented order: Rename-Computer
locally, then Add-Computer -Options JoinWithNewName, so AD creates the
computer object under the CloudBolt hostname and never renames it. The
failure the retry targeted was that AD rename (Add-Computer -NewName joins
under the EC2AMAZ name first), and a failed rename left an object under the
old name that the cleanup action cannot find.

The retry version also broke every WinRM join: CloudBolt sends the script as
powershell -encodedcommand on one 8191-character command line, and the
added code pushed it to about 10,900. The script's comments move to Python
and the script now encodes to 7,576 characters, below main's 7,680.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
CloudBolt's WinRM transport runs a script as powershell -encodedcommand on
one command line, which Windows caps at 8191 characters (about 3,000
characters of script). Prepare SCVMM Lab on AWS failed in testing with "The
command line is too long" when it started its first scheduled task, and every
later step's task would too. A script over 2,800 characters is now gzipped,
written to the lab folder in base64 pieces of at most 2,400 characters, then
read back, deleted and run in the same session, so its output and exit code
are unchanged. Tested locally through powershell -EncodedCommand.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The shared module's run_task started a scheduled task and polled it to the
end, so Configure Hyper-V Hosts installed Hyper-V and Failover Clustering one
host at a time (about 3.5 minutes each in testing). start_task now starts a
task and returns a handle, and wait_tasks polls a set of them together,
waits for every one even after a failure, and names every failure. run_task
is start_task plus wait_tasks for one task.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…apper

In testing the SQL Server 2022 bootstrapper ran for 20 minutes under SYSTEM
with no CPU and no files, with or without /IACCEPTSQLSERVERLICENSETERMS. Its
download switches are undocumented. Install SCVMM now downloads the
Developer ISO from download.microsoft.com with curl.exe, mounts it, copies
setup to the lab volume with robocopy and deletes the ISO. Done by hand on
the stuck lab server, it downloaded 1.16 GB in 7 seconds and SQL Server
setup started from the copied media.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The Evaluation Center's SCVMM 2025 link (go.microsoft.com/fwlink/?linkid=2292412)
redirects to download.microsoft.com/.../SCVMM_2025.zip with no registration,
so the lab no longer needs a 1 GB upload to File Archives. scvmm_media now
holds that link by default; Install SCVMM downloads it with Windows' curl.exe
and extracts it with its tar.exe. A File Archives reference still works, for
labs without internet access. Install SCVMM also calls curl.exe and tar.exe
by their System32 paths and creates the media folder if it is missing.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… DNS before clustering

Lab-6's Create Hyper-V Cluster failed because hvlab-002's name still
resolved to the deleted lab-1 server's address: AD-integrated zones let
only a record's owner update it, so the new server could not replace it.

- Delete Windows Computer Object from AD (HPA-q181uofy / OHK-bkoau0j8)
  now also tombstones the DNS nodes the computer object owns: its host
  name and the PTR node of each of that name's addresses, in any
  AD-integrated partition. Nodes another account owns are left alone.
  Tombstoning follows MS-DNSP (dNSTombstoned TRUE, one DNS_TYPE_ZERO
  record with EntombedTime), the way the DNS server deletes a node.
- ad_domain (SHM-gcba1u31): dns_bases, find_dns_nodes, dns_records,
  a_addresses, owner_sid (SD flags control, owner only),
  tombstone_dns_node; computer results carry objectSid.
- scvmm_lab.check_dns: from the first host, every lab server's name must
  resolve to its primary private IP and nothing outside its instance;
  a wrong name is asked to Register-DnsClient once and rechecked for up
  to 3 minutes, then the error names each wrong record. Prepare and
  Create Hyper-V Cluster run it.
- Configure Hyper-V Hosts stops the NAT switch's gateway address, the
  same on every host, from registering in DNS.
- PKG-nf407lm5 1.2.0.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…for it before SCVMM adds it

New-Cluster ends by opening the cluster by name, which failed on lab-7: the
cluster registered its name with one domain controller, and the hosts'
resolvers answered "no such name" for about 18 minutes (replication plus a
cached negative answer). Create Hyper-V Cluster now works on the local
cluster and carries on when only that last step fails. Add Hyper-V Cluster
to SCVMM waits up to an hour for the name to resolve from the SCVMM server.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…cluster at teardown

On lab-8, the local Get-Cluster in Create Hyper-V Cluster's fallback did not
answer in the moment New-Cluster failed to open the new cluster by name, so
the fallback gave up. It now retries for up to 10 minutes and logs why.

Windows protects a cluster's computer object from accidental deletion, so
the LDAP Utility could not delete hvc-513. The teardown now turns off DNS
registration on the running hosts, then runs Remove-Cluster -CleanupAD as the
domain account that created the object, and deletes it over LDAP only when it
is still there. The lab-7 hosts' DNS records came back after the cleanup
action deleted them: their cluster IPs moved while they shut down, and each
registered its name again.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ed one

Lab-9 was canceled before Create Hyper-V Cluster, and its teardown reported
"Destroyed cluster hvc-515". The script now marks whether it ran
Remove-Cluster, and the note says the host is in no cluster otherwise.
Also updates the blueprint README's list of what has not run live.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…er name

On lab-10, New-Cluster succeeded and the next cmdlet, Get-ClusterNode with no
-Cluster, failed with "An error occurred opening cluster 'hvc-528'" (event
4657 in FailoverClustering-Manager/Admin): without a cluster argument the
cmdlets open the local cluster by its name, which does not resolve yet.
OpenCluster accepts a node name, and the cmdlets work through it while the
name does not resolve, so every cmdlet now passes -Cluster $env:COMPUTERNAME.
After New-Cluster, success or not, the item waits up to 10 minutes for the
cluster to answer on this host.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…tCluster -Name

On lab-10, Get-SCVMHostCluster -Name threw "A cluster with the name
'hvc-528.<domain>' does not exist" for a cluster SCVMM did not manage
yet, so Add Hyper-V Cluster to SCVMM failed before adding it. It now lists the
clusters and matches the FQDN or the short name.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
On lab-10, SCVMM's "Discover clusters and their nodes" failed with
AMHostAccessDenied. hvlab-003's Security log showed why: event 4625, NTLM
logon for user "user@<domain>" in domain "localhost", no such user.
SCVMM treats a user@domain name as a local account. Add Hyper-V Cluster to
SCVMM now resolves the account to DOMAIN\user through its SID, and corrects a
Run As account it made earlier with the other form.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…and responding

On lab-10, Add-SCVMHostCluster installed the SCVMM agent on both hosts and
SCVMM lists the cluster with both nodes OK and Responding, but the add job
failed: SCVMM's BITS endpoint answered HTTP 500 (0x801901F4) when copying the
DHCP server extension, DHCPExtn.msi, to the hosts. Add Hyper-V Cluster to
SCVMM now ends with WARNING and SCVMM's message in that case, and still fails
when a node is not responding. The README notes the caveat.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
New-Cluster brought lab-12's core group online on the second host, and
Windows refuses to remove a node from the possible owners of a resource
online on it, so Create Hyper-V Cluster failed on every run.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ssage

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… at teardown

Remove-Cluster leaves the cluster name's DNS record, so the teardown reads
the cluster computer object's SID first and afterwards tombstones the
records it owned. When Remove-Cluster leaves the protected computer object
behind, a running host removes the protection and deletes it as the domain
service account that created it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A lab teardown found no DNS record of the cluster left after Remove-Cluster,
so the teardown's DNS step only catches a record when Remove-Cluster did not
run or failed. The record an earlier lab left came from a teardown that never
ran Remove-Cluster.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant