update vm

This commit is contained in:
TangBin
2018-10-29 20:12:46 +08:00
parent 5cd99ead80
commit 1c09c493f4
2 changed files with 5 additions and 6 deletions
+3 -6
View File
@@ -326,7 +326,6 @@ func (self *SInstance) DeleteVM() error {
for {
err := self.host.zone.region.DeleteVM(self.InstanceId)
if err != nil {
// todo: implement me
return err
} else {
break
@@ -337,8 +336,7 @@ func (self *SInstance) DeleteVM() error {
}
func (self *SInstance) UpdateVM(name string) error {
// todo :implement me
return nil
return self.host.zone.region.UpdateVM(self.InstanceId, name)
}
func (self *SInstance) RebuildRoot(imageId string, passwd string, publicKey string, sysSizeGB int) (string, error) {
@@ -690,12 +688,11 @@ func (self *SRegion) DeployVM(instanceId string, name string, password string, k
}
func (self *SRegion) UpdateVM(instanceId string, hostname string) error {
// todo : implement me
return nil
// https://docs.aws.amazon.com/zh_cn/AWSEC2/latest/UserGuide/set-hostname.html
return fmt.Errorf("aws not support change hostname.")
}
func (self *SRegion) ReplaceSystemDisk(instanceId string, imageId string, passwd string, keypairName string, sysDiskSizeGB int) (string, error) {
return "", cloudprovider.ErrNotSupported
}
+2
View File
@@ -83,6 +83,8 @@ func (self *SRegion) GetMatchInstanceTypes(cpu int, memMB int, gpu int, zoneId s
}
// 实例类型顺序: 微型实例 -> 通用型 -> 计算优化型 ...
// todo:部分实例类型 需要启用ena才能正常启动。需要过滤掉。
// https://docs.aws.amazon.com/zh_cn/AWSEC2/latest/UserGuide/enhanced-networking-ena.html
ret := []SInstanceType{}
for _, t := range types {
// cpu & mem & disk & ena 都匹配才行