GL-5: explicit rootfs override for DR restore (live-discovered PVE constraint)
The live validation hit PVE's all-or-nothing restore rule: mpN params without an explicit rootfs -> HTTP 500 "mount points configured, but 'rootfs' not set" (the same constraint restoretest.go:211 documents for the live-config path; the spike never ran an override restore). The lost guest has no live config, so the rootfs SIZE now comes from the archive's own embedded config via NEW Client.ExtractArchiveConfig (GET vzdump/ extractconfig - verified live: answers 200 under the scoped agent token; PBS keys stay server-side, the spike's candidate-1 rejection holds; used for the SIZE ONLY - the bind layout stays the platform constants). Unparseable/unreadable archive config -> clean refusal before any restore. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PSK5g6qYLknKj8u3QAFEr6
This commit is contained in:
@@ -53,6 +53,12 @@ type fakeAPI struct {
|
||||
// poolAdds records (pool, vmid) for each PoolAddVMID; poolAddErr backs the failure path.
|
||||
poolAdds []poolAddCall
|
||||
poolAddErr error
|
||||
|
||||
// extractCfg/extractErr back ExtractArchiveConfig (GL-5 DR rootfs sizing); extracts records
|
||||
// the requested volumes. Empty extractCfg with nil extractErr → a canonical 8G-rootfs config.
|
||||
extractCfg string
|
||||
extractErr error
|
||||
extracts []string
|
||||
}
|
||||
|
||||
type poolAddCall struct {
|
||||
@@ -73,6 +79,23 @@ type resizeCall struct {
|
||||
disk, size string
|
||||
}
|
||||
|
||||
// ExtractArchiveConfig returns extractCfg/extractErr; with neither set it returns a canonical
|
||||
// minimal archive config (rootfs size=8G) so DR-mode tests that don't care about the rootfs
|
||||
// override don't have to stage one.
|
||||
func (f *fakeAPI) ExtractArchiveConfig(_ context.Context, volume string) (string, error) {
|
||||
f.mu.Lock()
|
||||
f.extracts = append(f.extracts, volume)
|
||||
cfg, err := f.extractCfg, f.extractErr
|
||||
f.mu.Unlock()
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
if cfg == "" {
|
||||
cfg = "hostname: fake\nrootfs: local-lvm:vm-0-disk-0,size=8G\n"
|
||||
}
|
||||
return cfg, nil
|
||||
}
|
||||
|
||||
func (f *fakeAPI) RestoreLXC(_ context.Context, opts proxmox.RestoreLXCOptions) (string, error) {
|
||||
if f.restoreHook != nil {
|
||||
f.restoreHook()
|
||||
|
||||
Reference in New Issue
Block a user