github.com/vmware/govmomi@v0.51.0/simulator/esx/virtual_device.go (about)

     1  // © Broadcom. All Rights Reserved.
     2  // The term “Broadcom” refers to Broadcom Inc. and/or its subsidiaries.
     3  // SPDX-License-Identifier: Apache-2.0
     4  
     5  package esx
     6  
     7  import "github.com/vmware/govmomi/vim25/types"
     8  
     9  // VirtualDevice is the default set of VirtualDevice types created for a VirtualMachine
    10  // Capture method:
    11  //
    12  //	govc vm.create foo
    13  //	govc object.collect -s -dump vm/foo config.hardware.device
    14  var VirtualDevice = []types.BaseVirtualDevice{
    15  	&types.VirtualIDEController{
    16  		VirtualController: types.VirtualController{
    17  			VirtualDevice: types.VirtualDevice{
    18  				DynamicData: types.DynamicData{},
    19  				Key:         200,
    20  				DeviceInfo: &types.Description{
    21  					DynamicData: types.DynamicData{},
    22  					Label:       "IDE 0",
    23  					Summary:     "IDE 0",
    24  				},
    25  				Backing:       nil,
    26  				Connectable:   (*types.VirtualDeviceConnectInfo)(nil),
    27  				SlotInfo:      nil,
    28  				ControllerKey: 0,
    29  				UnitNumber:    (*int32)(nil),
    30  			},
    31  			BusNumber: 0,
    32  			Device:    nil,
    33  		},
    34  	},
    35  	&types.VirtualIDEController{
    36  		VirtualController: types.VirtualController{
    37  			VirtualDevice: types.VirtualDevice{
    38  				DynamicData: types.DynamicData{},
    39  				Key:         201,
    40  				DeviceInfo: &types.Description{
    41  					DynamicData: types.DynamicData{},
    42  					Label:       "IDE 1",
    43  					Summary:     "IDE 1",
    44  				},
    45  				Backing:       nil,
    46  				Connectable:   (*types.VirtualDeviceConnectInfo)(nil),
    47  				SlotInfo:      nil,
    48  				ControllerKey: 0,
    49  				UnitNumber:    (*int32)(nil),
    50  			},
    51  			BusNumber: 1,
    52  			Device:    nil,
    53  		},
    54  	},
    55  	&types.VirtualPS2Controller{
    56  		VirtualController: types.VirtualController{
    57  			VirtualDevice: types.VirtualDevice{
    58  				DynamicData: types.DynamicData{},
    59  				Key:         300,
    60  				DeviceInfo: &types.Description{
    61  					DynamicData: types.DynamicData{},
    62  					Label:       "PS2 controller 0",
    63  					Summary:     "PS2 controller 0",
    64  				},
    65  				Backing:       nil,
    66  				Connectable:   (*types.VirtualDeviceConnectInfo)(nil),
    67  				SlotInfo:      nil,
    68  				ControllerKey: 0,
    69  				UnitNumber:    (*int32)(nil),
    70  			},
    71  			BusNumber: 0,
    72  			Device:    []int32{600, 700},
    73  		},
    74  	},
    75  	&types.VirtualPCIController{
    76  		VirtualController: types.VirtualController{
    77  			VirtualDevice: types.VirtualDevice{
    78  				DynamicData: types.DynamicData{},
    79  				Key:         100,
    80  				DeviceInfo: &types.Description{
    81  					DynamicData: types.DynamicData{},
    82  					Label:       "PCI controller 0",
    83  					Summary:     "PCI controller 0",
    84  				},
    85  				Backing:       nil,
    86  				Connectable:   (*types.VirtualDeviceConnectInfo)(nil),
    87  				SlotInfo:      nil,
    88  				ControllerKey: 0,
    89  				UnitNumber:    (*int32)(nil),
    90  			},
    91  			BusNumber: 0,
    92  			Device:    []int32{500, 12000},
    93  		},
    94  	},
    95  	&types.VirtualSIOController{
    96  		VirtualController: types.VirtualController{
    97  			VirtualDevice: types.VirtualDevice{
    98  				DynamicData: types.DynamicData{},
    99  				Key:         400,
   100  				DeviceInfo: &types.Description{
   101  					DynamicData: types.DynamicData{},
   102  					Label:       "SIO controller 0",
   103  					Summary:     "SIO controller 0",
   104  				},
   105  				Backing:       nil,
   106  				Connectable:   (*types.VirtualDeviceConnectInfo)(nil),
   107  				SlotInfo:      nil,
   108  				ControllerKey: 0,
   109  				UnitNumber:    (*int32)(nil),
   110  			},
   111  			BusNumber: 0,
   112  			Device:    nil,
   113  		},
   114  	},
   115  	&types.VirtualKeyboard{
   116  		VirtualDevice: types.VirtualDevice{
   117  			DynamicData: types.DynamicData{},
   118  			Key:         600,
   119  			DeviceInfo: &types.Description{
   120  				DynamicData: types.DynamicData{},
   121  				Label:       "Keyboard ",
   122  				Summary:     "Keyboard",
   123  			},
   124  			Backing:       nil,
   125  			Connectable:   (*types.VirtualDeviceConnectInfo)(nil),
   126  			SlotInfo:      nil,
   127  			ControllerKey: 300,
   128  			UnitNumber:    types.NewInt32(0),
   129  		},
   130  	},
   131  	&types.VirtualPointingDevice{
   132  		VirtualDevice: types.VirtualDevice{
   133  			DynamicData: types.DynamicData{},
   134  			Key:         700,
   135  			DeviceInfo: &types.Description{
   136  				DynamicData: types.DynamicData{},
   137  				Label:       "Pointing device",
   138  				Summary:     "Pointing device; Device",
   139  			},
   140  			Backing: &types.VirtualPointingDeviceDeviceBackingInfo{
   141  				VirtualDeviceDeviceBackingInfo: types.VirtualDeviceDeviceBackingInfo{
   142  					VirtualDeviceBackingInfo: types.VirtualDeviceBackingInfo{},
   143  					DeviceName:               "",
   144  					UseAutoDetect:            types.NewBool(false),
   145  				},
   146  				HostPointingDevice: "autodetect",
   147  			},
   148  			Connectable:   (*types.VirtualDeviceConnectInfo)(nil),
   149  			SlotInfo:      nil,
   150  			ControllerKey: 300,
   151  			UnitNumber:    types.NewInt32(1),
   152  		},
   153  	},
   154  	&types.VirtualMachineVideoCard{
   155  		VirtualDevice: types.VirtualDevice{
   156  			DynamicData: types.DynamicData{},
   157  			Key:         500,
   158  			DeviceInfo: &types.Description{
   159  				DynamicData: types.DynamicData{},
   160  				Label:       "Video card ",
   161  				Summary:     "Video card",
   162  			},
   163  			Backing:       nil,
   164  			Connectable:   (*types.VirtualDeviceConnectInfo)(nil),
   165  			SlotInfo:      nil,
   166  			ControllerKey: 100,
   167  			UnitNumber:    types.NewInt32(0),
   168  		},
   169  		VideoRamSizeInKB:       4096,
   170  		NumDisplays:            1,
   171  		UseAutoDetect:          types.NewBool(false),
   172  		Enable3DSupport:        types.NewBool(false),
   173  		Use3dRenderer:          "automatic",
   174  		GraphicsMemorySizeInKB: 262144,
   175  	},
   176  	&types.VirtualMachineVMCIDevice{
   177  		VirtualDevice: types.VirtualDevice{
   178  			DynamicData: types.DynamicData{},
   179  			Key:         12000,
   180  			DeviceInfo: &types.Description{
   181  				DynamicData: types.DynamicData{},
   182  				Label:       "VMCI device",
   183  				Summary:     "Device on the virtual machine PCI bus that provides support for the virtual machine communication interface",
   184  			},
   185  			Backing:       nil,
   186  			Connectable:   (*types.VirtualDeviceConnectInfo)(nil),
   187  			SlotInfo:      nil,
   188  			ControllerKey: 100,
   189  			UnitNumber:    types.NewInt32(17),
   190  		},
   191  		Id:                             -1,
   192  		AllowUnrestrictedCommunication: types.NewBool(false),
   193  		FilterEnable:                   types.NewBool(true),
   194  		FilterInfo:                     (*types.VirtualMachineVMCIDeviceFilterInfo)(nil),
   195  	},
   196  }
   197  
   198  // EthernetCard template for types.VirtualEthernetCard
   199  var EthernetCard = types.VirtualE1000{
   200  	VirtualEthernetCard: types.VirtualEthernetCard{
   201  		VirtualDevice: types.VirtualDevice{
   202  			DynamicData: types.DynamicData{},
   203  			Key:         4000,
   204  			Backing: &types.VirtualEthernetCardNetworkBackingInfo{
   205  				VirtualDeviceDeviceBackingInfo: types.VirtualDeviceDeviceBackingInfo{
   206  					VirtualDeviceBackingInfo: types.VirtualDeviceBackingInfo{},
   207  					DeviceName:               "VM Network",
   208  					UseAutoDetect:            types.NewBool(false),
   209  				},
   210  				Network:           (*types.ManagedObjectReference)(nil),
   211  				InPassthroughMode: types.NewBool(false),
   212  			},
   213  			Connectable: &types.VirtualDeviceConnectInfo{
   214  				DynamicData:       types.DynamicData{},
   215  				StartConnected:    true,
   216  				AllowGuestControl: true,
   217  				Connected:         false,
   218  				Status:            "untried",
   219  			},
   220  			SlotInfo: &types.VirtualDevicePciBusSlotInfo{
   221  				VirtualDeviceBusSlotInfo: types.VirtualDeviceBusSlotInfo{},
   222  				PciSlotNumber:            32,
   223  			},
   224  			ControllerKey: 100,
   225  			UnitNumber:    types.NewInt32(7),
   226  		},
   227  		AddressType:      "generated",
   228  		MacAddress:       "",
   229  		WakeOnLanEnabled: types.NewBool(true),
   230  	},
   231  }