Automated cherry pick of #18822: Automated cherry pick of #18821: Feat/deploy guest (#18823)

* feat(region): add guest rescue api && download initrd from baremetal tftp server && add baremetal agent ip finder & update pic address & support ip kernel config.

* feat(host-deployer): use qemu-kvm as default deploy dirver

---------

Co-authored-by: boironic@gmail.com <boironic@gmail.com>
This commit is contained in:
wanyaoqi
2023-11-30 16:50:18 +08:00
committed by GitHub
parent 127711a965
commit b58cd52d30
37 changed files with 1745 additions and 419 deletions

View File

@@ -123,6 +123,8 @@ func init() {
cmd.Perform("set-nic-traffic-limit", &options.ServerNicTrafficLimitOptions{})
cmd.Perform("add-sub-ips", &options.ServerAddSubIpsOptions{})
cmd.BatchPerform("set-os-info", &options.ServerSetOSInfoOptions{})
cmd.BatchPerform("start-rescue", &options.ServerStartOptions{})
cmd.BatchPerform("stop-rescue", &options.ServerStartOptions{})
cmd.Get("vnc", new(options.ServerVncOptions))
cmd.Get("desc", new(options.ServerIdOptions))
@@ -953,46 +955,4 @@ func init() {
}
return nil
})
// ServerStartRescueOptions is used to start a rescue os.
type ServerStartRescueOptions struct {
ID string `help:"ID of server" json:"-"`
QemuVersion string `help:"prefer qemu version" json:"qemu_version"`
}
R(&ServerStartRescueOptions{}, "server-start-rescue ", "Start rescu e a guest server", func(s *mcclient.ClientSession, opts *ServerStartRescueOptions) error {
params, err := baseoptions.StructToParams(opts)
if err != nil {
return err
}
result, err := modules.Servers.PerformAction(s, opts.ID, "start-rescue", params)
if err != nil {
return err
}
printObject(result)
return nil
})
// ServerStopRescueOptions is used to stop a rescue os.
type ServerStopRescueOptions struct {
ID string `help:"ID of server" json:"-"`
QemuVersion string `help:"prefer qemu version" json:"qemu_version"`
}
R(&ServerStopRescueOptions{}, "server-stop-rescue", "Stop rescue a guest server", func(s *mcclient.ClientSession, opts *ServerStopRescueOptions) error {
params, err := baseoptions.StructToParams(opts)
if err != nil {
return err
}
result, err := modules.Servers.PerformAction(s, opts.ID, "stop-rescue", params)
if err != nil {
return err
}
printObject(result)
return nil
})
}