f-62: vm: MAC fournie à la création par interface, fin de la table préchargée, migration #62
Signed-off-by: GnomeZworc <nicolas.boufidjeline@g3e.fr>
This commit is contained in:
parent
c26606787e
commit
077141443e
20 changed files with 338 additions and 171 deletions
|
|
@ -23,6 +23,7 @@ type VMDisk struct {
|
|||
type VMNIC struct {
|
||||
Subnet string
|
||||
IP string
|
||||
MAC string
|
||||
Primary bool
|
||||
}
|
||||
|
||||
|
|
@ -60,6 +61,9 @@ func (c StartVMCommand) Prepare(db *badger.DB, _ *configuration.Config) error {
|
|||
if err := kv.AddInDB(db, prefix+"ip", n.IP); err != nil {
|
||||
return fmt.Errorf("store nic %d ip: %w", i, err)
|
||||
}
|
||||
if err := kv.AddInDB(db, prefix+"mac", n.MAC); err != nil {
|
||||
return fmt.Errorf("store nic %d mac: %w", i, err)
|
||||
}
|
||||
if n.Primary {
|
||||
if err := kv.AddInDB(db, prefix+"primary", "true"); err != nil {
|
||||
return fmt.Errorf("store nic %d primary: %w", i, err)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue