Skip to content

Commit

Permalink
vcsim: Implement VSLM ExtendDisk_Task
Browse files Browse the repository at this point in the history
Add support to vcsim for ExtendDisk_Task in VSLM. This allows you to
change the capcity of a FCD when using vcsim without the simulator
throwing an error.
  • Loading branch information
protochron committed Jun 4, 2021
1 parent 49d7d6c commit 6fba1da
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions simulator/vstorage_object_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,23 @@ func (m *VcenterVStorageObjectManager) VStorageObjectCreateSnapshotTask(ctx *Con
}
}

func (m *VcenterVStorageObjectManager) ExtendDiskTask(ctx *Context, req *types.ExtendDisk_Task) soap.HasFault {
task := CreateTask(m, "extendDisk", func(*Task) (types.AnyType, types.BaseMethodFault) {
obj := m.object(req.Datastore, req.Id)
if obj == nil {
return nil, new(types.InvalidArgument)
}

obj.Config.CapacityInMB = req.NewCapacityInMB
return nil, nil
})
return &methods.ExtendDisk_TaskBody{
Res: &types.ExtendDisk_TaskResponse{
Returnval: task.Run(ctx),
},
}
}

func (m *VcenterVStorageObjectManager) DeleteSnapshotTask(ctx *Context, req *types.DeleteSnapshot_Task) soap.HasFault {
task := CreateTask(m, "deleteSnapshot", func(*Task) (types.AnyType, types.BaseMethodFault) {
obj := m.object(req.Datastore, req.Id)
Expand Down

0 comments on commit 6fba1da

Please sign in to comment.