mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-06-08 07:14:19 +08:00
Merge branch 'release/2.7.0' of ssh://git.yunion.io/~qiujian/onecloud into feature/qj-sync-with-lock
Conflicts: pkg/compute/guestdrivers/aws.go
This commit is contained in:
@@ -230,11 +230,11 @@ func (disk *SDisk) GetMountpoint() string {
|
||||
func (region *SRegion) CreateDisk(zoneName string, category string, name string, sizeGb int, desc string) (*SDisk, error) {
|
||||
params := map[string]map[string]interface{}{
|
||||
"volume": {
|
||||
"size": sizeGb,
|
||||
"volume_type": category,
|
||||
"name": name,
|
||||
"description": desc,
|
||||
"availability_zone": zoneName,
|
||||
"size": sizeGb,
|
||||
"volume_type": category,
|
||||
"name": name,
|
||||
"description": desc,
|
||||
//"availability_zone": zoneName,
|
||||
},
|
||||
}
|
||||
_, resp, err := region.CinderCreate("/volumes", "", jsonutils.Marshal(params))
|
||||
|
||||
@@ -380,8 +380,11 @@ func (instance *SInstance) DeployVM(ctx context.Context, name string, password s
|
||||
}
|
||||
|
||||
func (instance *SInstance) RebuildRoot(ctx context.Context, imageId string, passwd string, publicKey string, sysSizeGB int) (string, error) {
|
||||
return "", instance.host.zone.region.ReplaceSystemDisk(instance.ID, imageId, passwd, publicKey, sysSizeGB)
|
||||
|
||||
sysDiskId := ""
|
||||
if len(instance.VolumesAttached) > 0 {
|
||||
sysDiskId = instance.VolumesAttached[0].ID
|
||||
}
|
||||
return sysDiskId, instance.host.zone.region.ReplaceSystemDisk(instance.ID, imageId, passwd, publicKey, sysSizeGB)
|
||||
}
|
||||
|
||||
func (instance *SInstance) ChangeConfig(ctx context.Context, ncpu int, vmem int) error {
|
||||
|
||||
@@ -96,7 +96,7 @@ func (storage *SStorage) GetIStoragecache() cloudprovider.ICloudStoragecache {
|
||||
}
|
||||
|
||||
func (storage *SStorage) CreateIDisk(name string, sizeGb int, desc string) (cloudprovider.ICloudDisk, error) {
|
||||
disk, err := storage.zone.region.CreateDisk(storage.zone.ZoneName, storage.Name, name, sizeGb, desc)
|
||||
disk, err := storage.zone.region.CreateDisk("", storage.Name, name, sizeGb, desc)
|
||||
if err != nil {
|
||||
log.Errorf("createDisk fail %v", err)
|
||||
return nil, err
|
||||
|
||||
Reference in New Issue
Block a user