You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I wanted to replace this huge list of instance types, so I did this:
DROP TABLE IF EXISTS Instace_Type_Providers;
CREATE TABLE Instace_Type_Providers ( ITP_ID int NOT NULL AUTO_INCREMENT, ITP_Name varchar(255) NOT NULL,
PRIMARY KEY (ITP_ID)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1;
INSERT INTO Instace_Type_Providers VALUES (1,'Local');
DROP TABLE IF EXISTS Instance_Types;
CREATE TABLE Instance_Types ( IT_ID int NOT NULL AUTO_INCREMENT, IT_Provider_ID int NOT NULL, IT_Name varchar(255) NOT NULL, IT_CPU float(6,2) NOT NULL, IT_Mem float(6,2) NOT NULL,
PRIMARY KEY (IT_ID)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=latin1;
INSERT INTO Instance_Types VALUES (1,1,'small',2.00,2.00),(2,1,'medium',4.00,4.00),(3,1,'large',8.00,8.00),(4,1,'huge',16.00,16.00);
they show up correctly in the container create dialog but on creation i'm getting 'HTTP 400 bad request, unknown instance type 'small'
rebooted everything just to be sure its not cached somewhere, didn't help, what am I missing?
BTW there is a typo in the table name "Instace" instead of "instance" ;)
The text was updated successfully, but these errors were encountered:
LXD actually uses a predefined list of instance types that can be found here, so the IT_Name column "cant" be arbitrary. (they haven't updated this list since 2019 though)
Instead we need to change it so we dont provide the instance type to LXD but lookup the limits from the database based on the name and apply them ourselves. To be backwards compatible names must be unique across all "providers" which is annoying but it will have to-do.
Admin page for managing instance types
Lookup instanceType names when using them and apply the limits to the new instance
I wanted to replace this huge list of instance types, so I did this:
DROP TABLE IF EXISTS
Instace_Type_Providers
;CREATE TABLE
Instace_Type_Providers
(ITP_ID
int NOT NULL AUTO_INCREMENT,ITP_Name
varchar(255) NOT NULL,PRIMARY KEY (
ITP_ID
)) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1;
INSERT INTO
Instace_Type_Providers
VALUES (1,'Local');DROP TABLE IF EXISTS
Instance_Types
;CREATE TABLE
Instance_Types
(IT_ID
int NOT NULL AUTO_INCREMENT,IT_Provider_ID
int NOT NULL,IT_Name
varchar(255) NOT NULL,IT_CPU
float(6,2) NOT NULL,IT_Mem
float(6,2) NOT NULL,PRIMARY KEY (
IT_ID
)) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=latin1;
INSERT INTO
Instance_Types
VALUES (1,1,'small',2.00,2.00),(2,1,'medium',4.00,4.00),(3,1,'large',8.00,8.00),(4,1,'huge',16.00,16.00);they show up correctly in the container create dialog but on creation i'm getting 'HTTP 400 bad request, unknown instance type 'small'
rebooted everything just to be sure its not cached somewhere, didn't help, what am I missing?
BTW there is a typo in the table name "Instace" instead of "instance" ;)
The text was updated successfully, but these errors were encountered: