Conversation
manuelh-dev
commented
Feb 2, 2022
- To enable dynamic deployment scenarios, only require a gateway when there is routes defined
- To enable deployment of Windows VM (which do not use vsock), extend the CreateVirtualMachineSpec interface
Use the endpoint name instead of id to ensure the resource path remains constant across VM reboots. Otherwise, e.g. Windows VMs will recognize a different network adapter (leading to loss of static IP config)
|
@johnsonshih @madhanrm @nagiesek @jagadishmurugan @raghavendra-nataraj @seanyen I cannot add reviewers |
| // Hot detach an endpoint from the compute system | ||
| request := hcsschema.ModifySettingRequest{ | ||
| RequestType: requesttype.Remove, | ||
| ResourcePath: path.Join("VirtualMachine/Devices/NetworkAdapters", endpoint.Id), |
There was a problem hiding this comment.
what's the original motivation to change it from Id to Name?
There was a problem hiding this comment.
If we use the ID, the ID changes every time the VM is rebooted. This is a problem for the Windows VM because it detects a different physical network adapter and loses its networking configuration.
I.e. if we use the ID, a different physical network adapter is mapped into the VM each time the VM restarts.
There was a problem hiding this comment.
Add an optional input parameter to allow caller specify resource name, if caller specify resource name, use it, otherwise use ID to ensure no conflict to existing resource name.
Same for hotAttachEndpoint
| // Ensure the VM has access, we use opts.Id to create VM | ||
| if err := wclayer.GrantVmAccess(opts.Id, opts.VhdPath); err != nil { | ||
| return nil, err | ||
| return nil, fmt.Errorf("Failed to grant VM access to VHD file, error: %s", err) |
| } | ||
| if err := wclayer.GrantVmAccess(opts.Id, opts.IsoPath); err != nil { | ||
| return nil, err | ||
| return nil, fmt.Errorf("Failed to grant VM access to ISO file, error: %s", err) |
| for _, subnet := range ipam.Subnets { | ||
| if subnet.IpAddressPrefix != "" { | ||
| hasDefault := false | ||
| needsDefault := false |