// CreateNewSCSIController will create a new ISCSI controller on this VM
CreateNewSCSIController will create a new ISCSI controller on this VM
// CreateNewSCSIController will create a new ISCSI controller on this VM
func (v *VirtualMachine) CreateNewSCSIController() (string, error) {
	resData, err := utils.GetResourceAllocSettings(v.mgr.con, SCSIControllerResSubType, ResourceAllocSettingDataClass)
	if err != nil {
		return "", errors.Wrap(err, "utils.GetResourceAllocSettings")
	}
	newID, err := utils.UUID4()
	if err != nil {
		return "", errors.Wrap(err, "UUID4")
	}
	if err := resData.Set("VirtualSystemIdentifiers", []string{fmt.Sprintf("{%s}", newID)}); err != nil {
		return "", errors.Wrap(err, "VirtualSystemIdentifiers")
	}
	dataText, err := resData.GetText(1)
	if err != nil {
		return "", errors.Wrap(err, "GetText")
	}
	resCtrl, err := utils.AddResourceSetting(v.mgr.svc, []string{dataText}, v.path)
	if err != nil {
		return "", errors.Wrap(err, "utils.AddResourceSetting")
	}
	return resCtrl[0], nil
}
func ( v * VirtualMachine ) CreateNewSCSIController ( ) ( string , error ) { resData , err := utils . GetResourceAllocSettings ( v . mgr . con , SCSIControllerResSubType , ResourceAllocSettingDataClass ) if err != nil { return " " , errors . Wrap ( err , " " ) } newID , err := utils . UUID4 ( ) if err != nil { return " " , errors . Wrap ( err , " " ) } if err := resData . Set ( " " , [ ] string { fmt . Sprintf ( " " , newID ) } ) ; err != nil { return " " , errors . Wrap ( err , " " ) } dataText , err := resData . GetText ( 1 ) if err != nil { return " " , errors . Wrap ( err , " " ) } resCtrl , err := utils . AddResourceSetting ( v . mgr . svc , [ ] string { dataText } , v . path ) if err != nil { return " " , errors . Wrap ( err , " " ) } return resCtrl [ 0 ] , nil }
CreateNewSCSIController will create a new ISCSI controller on this VM
CreateNewSCSIController will create a new ISCSI controller on this VM