Skip to content

Commit 702fe1b

Browse files
committed
add nameserver & searchdomain
1 parent b926998 commit 702fe1b

File tree

3 files changed

+19
-17
lines changed

3 files changed

+19
-17
lines changed

cloud/services/compute/instance/reconcile.go

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -206,20 +206,22 @@ func SetCloudImage(ctx context.Context, vmid int, storageName string, ssh scope.
206206
func generateVMOptions(vmName, storageName string, network infrav1.Network) vm.VirtualMachineCreateOptions {
207207

208208
vmoptions := vm.VirtualMachineCreateOptions{
209-
Agent: "enabled=1",
210-
Cores: 2,
211-
Memory: 1024 * 4,
212-
Name: vmName,
213-
Boot: "order=scsi0",
214-
Ide: vm.Ide{Ide2: fmt.Sprintf("file=%s:cloudinit,media=cdrom", storageName)},
215-
CiCustom: fmt.Sprintf("user=%s:snippets/%s-user.yml", storageName, vmName),
216-
IPConfig: vm.IPConfig{IPConfig0: network.IPConfig.String()},
217-
OSType: vm.L26,
218-
Net: vm.Net{Net0: "model=virtio,bridge=vmbr0,firewall=1"},
219-
Scsi: vm.Scsi{Scsi0: fmt.Sprintf("file=%s:8", storageName)},
220-
ScsiHw: vm.VirtioScsiPci,
221-
Serial: vm.Serial{Serial0: "socket"},
222-
VGA: "serial0",
209+
Agent: "enabled=1",
210+
Cores: 2,
211+
Memory: 1024 * 4,
212+
Name: vmName,
213+
NameServer: network.NameServer,
214+
Boot: "order=scsi0",
215+
Ide: vm.Ide{Ide2: fmt.Sprintf("file=%s:cloudinit,media=cdrom", storageName)},
216+
CiCustom: fmt.Sprintf("user=%s:snippets/%s-user.yml", storageName, vmName),
217+
IPConfig: vm.IPConfig{IPConfig0: network.IPConfig.String()},
218+
OSType: vm.L26,
219+
Net: vm.Net{Net0: "model=virtio,bridge=vmbr0,firewall=1"},
220+
Scsi: vm.Scsi{Scsi0: fmt.Sprintf("file=%s:8", storageName)},
221+
ScsiHw: vm.VirtioScsiPci,
222+
SearchDomain: network.SearchDomain,
223+
Serial: vm.Serial{Serial0: "socket"},
224+
VGA: "serial0",
223225
}
224226
return vmoptions
225227
}

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ require (
77
github.com/onsi/ginkgo/v2 v2.9.2
88
github.com/onsi/gomega v1.27.5
99
github.com/pkg/errors v0.9.1
10-
github.com/sp-yduck/proxmox v0.0.0-20230611030631-783fc8d00395
10+
github.com/sp-yduck/proxmox v0.0.0-20230627144956-64b565d07db7
1111
golang.org/x/crypto v0.9.0
1212
gopkg.in/yaml.v3 v3.0.1
1313
k8s.io/api v0.26.1

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -288,8 +288,8 @@ github.com/shopspring/decimal v1.3.1 h1:2Usl1nmF/WZucqkFZhnfFYxxxu8LG21F6nPQBE5g
288288
github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo=
289289
github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE=
290290
github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88=
291-
github.com/sp-yduck/proxmox v0.0.0-20230611030631-783fc8d00395 h1:dRAwQmw/fCNj9dV2SQa83skpf18tnOQJJlOfClcAKkI=
292-
github.com/sp-yduck/proxmox v0.0.0-20230611030631-783fc8d00395/go.mod h1:VIKtGZXlx0nO9Y+K2vJ4z3rJLkZ3v0OvTnKbO22EnL4=
291+
github.com/sp-yduck/proxmox v0.0.0-20230627144956-64b565d07db7 h1:y2VI0xIOh35Dl3vKdbns6TVwe6ReSw4Akyr5qUVyUWU=
292+
github.com/sp-yduck/proxmox v0.0.0-20230627144956-64b565d07db7/go.mod h1:VIKtGZXlx0nO9Y+K2vJ4z3rJLkZ3v0OvTnKbO22EnL4=
293293
github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA=
294294
github.com/spf13/cast v1.5.0 h1:rj3WzYc11XZaIZMPKmwP96zkFEnnAmV8s6XbB2aY32w=
295295
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=

0 commit comments

Comments
 (0)