Files
cloudpods/pkg/hostman/diskutils/disk.go
Rain babc05b772 feature(esxi-agent): Esxi Agent Golang
1. 修改了host-deployer 使其支持 vmware vddk 的 deploy guest fs 操作。
2. esxi agent python ==> Go

fix(esxi-agent): Fix some bugs and irregular contents

fix(esxi-agent): Partial parameter structure

fix(esxi-agent): Add ovf template and remove some binary file

fix(esxi-agent): Format Code

fix(esxi-agent): fix based on reviewers' comments

fix(esxi-agent): fix host-deployer because of occasional unknown panic

fix: DelayTask should have a new Context

fix(esxi-agent): call hostutils.DelayTask

change '_interface' package to 'iagent' package

fix(esxi-agent): Fix some irregular code
2020-01-04 20:57:13 +08:00

27 lines
656 B
Go

package diskutils
import (
comapi "yunion.io/x/onecloud/pkg/apis/compute"
"yunion.io/x/onecloud/pkg/hostman/guestfs/fsdriver"
"yunion.io/x/onecloud/pkg/hostman/hostdeployer/apis"
)
type IDisk interface {
Connect() bool
Disconnect() bool
MountRootfs() fsdriver.IRootFsDriver
UmountRootfs(driver fsdriver.IRootFsDriver)
}
func GetIDisk(params *apis.DeployParams) IDisk {
hypervisor := params.GuestDesc.Hypervisor
switch hypervisor {
case comapi.HYPERVISOR_KVM:
return NewKVMGuestDisk(params.DiskPath)
case comapi.HYPERVISOR_ESXI:
return NewVDDKDisk(params.VddkInfo, params.DiskPath)
default:
return NewKVMGuestDisk(params.DiskPath)
}
}