- instance snapshot

- instance clone

- create form snapshot don't reset passwd
This commit is contained in:
wanyaoqi
2019-10-14 21:36:58 +08:00
parent 905fb307a8
commit 8fc4b2920a
26 changed files with 1203 additions and 26 deletions
@@ -0,0 +1,19 @@
package modules
import "yunion.io/x/onecloud/pkg/mcclient/modulebase"
var (
InstanceSnapshots modulebase.ResourceManager
)
func init() {
InstanceSnapshots = NewComputeManager("instance_snapshot", "instance_snapshots",
[]string{"ID", "Name",
"Status", "GuestId",
"ServerConfig",
},
[]string{},
)
registerCompute(&InstanceSnapshots)
}
+12
View File
@@ -232,6 +232,17 @@ type ServerCloneOptions struct {
Eip string `help:"associate with an existing EIP when server is created" json:"eip,omitempty"`
}
type ServerCreateFromInstanceSnapshot struct {
InstaceSnapshotId string `help:"Instace snapshot id or name"`
NAME string `help:"Name of newly server" json:"name"`
AutoStart bool `help:"Auto start server after it is created"`
AllowDelete bool `help:"Unlock server to allow deleting"`
EipBw int `help:"allocate EIP with bandwidth in MB when server is created" json:"eip_bw,omitzero"`
EipChargeType string `help:"newly allocated EIP charge type" choices:"traffic|bandwidth" json:"eip_charge_type,omitempty"`
Eip string `help:"associate with an existing EIP when server is created" json:"eip,omitempty"`
}
type ServerCreateOptions struct {
ServerConfigs
@@ -259,6 +270,7 @@ type ServerCreateOptions struct {
TaskNotify *bool `help:"Setup task notify" json:"-"`
DryRun *bool `help:"Dry run to test scheduler" json:"-"`
UserDataFile string `help:"user_data file path" json:"-"`
InstanceSnapshot string `help:"instance snapshot" json:"instance_snapshot"`
OsType string `help:"os type, e.g. Linux, Windows, etc."`